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

ihevc_intra_pred_chroma_ref_substitution:
  135|  3.72M|{
  136|  3.72M|    UWORD8 pu1_ref_u, pu1_ref_v;
  137|  3.72M|    WORD32 dc_val, i, j;
  138|  3.72M|    WORD32 total_samples = (4 * nt) + 1;
  139|  3.72M|    WORD32 get_bits;
  140|  3.72M|    WORD32 next;
  141|  3.72M|    WORD32 bot_left, left, top, tp_right, tp_left;
  142|  3.72M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  143|  3.72M|    WORD32 a_nbr_flag[5];
  144|  3.72M|    UNUSED(dst_strd);
  ------------------
  |  |   38|  3.72M|#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.72M|    if(nbr_flags == 0)
  ------------------
  |  Branch (149:8): [True: 35.1k, False: 3.68M]
  ------------------
  150|  35.1k|    {
  151|       |/* If no neighbor flags are present, fill the neighbor samples with DC value */
  152|       |        /*dc_val = 1 << (BIT_DEPTH - 1);*/
  153|  35.1k|        dc_val = 1 << (8 - 1);
  154|  2.56M|        for(i = 0; i < (2 * total_samples); i++)
  ------------------
  |  Branch (154:20): [True: 2.52M, False: 35.1k]
  ------------------
  155|  2.52M|        {
  156|  2.52M|            pu1_dst[i] = dc_val;
  157|  2.52M|        }
  158|  35.1k|    }
  159|  3.68M|    else
  160|  3.68M|    {
  161|       |        /* Else fill the corresponding samples */
  162|       |
  163|       |        /* Check for the neighbors availibility */
  164|  3.68M|        tp_left     = (nbr_flags & 0x10000);
  165|  3.68M|        tp_right    = (nbr_flags & 0x0f000);
  166|  3.68M|        top         = (nbr_flags & 0x00f00);
  167|  3.68M|        left        = (nbr_flags & 0x000f0);
  168|  3.68M|        bot_left    = (nbr_flags & 0x0000f);
  169|       |
  170|       |        /* Fill nbrs depending on avalibility */
  171|       |        /* Top -Left nbrs  */
  172|  3.68M|        if(0 != tp_left)
  ------------------
  |  Branch (172:12): [True: 3.22M, False: 460k]
  ------------------
  173|  3.22M|        {
  174|  3.22M|            pu1_dst[(4 * nt)] = *pu1_top_left; // U top-left sample
  175|  3.22M|            pu1_dst[(4 * nt) + 1] = *(pu1_top_left + 1); // V top-left sample
  176|  3.22M|        }
  177|       |        /* Left nbrs  */
  178|  3.68M|        if(0 != left)
  ------------------
  |  Branch (178:12): [True: 3.54M, False: 140k]
  ------------------
  179|  3.54M|        {
  180|  34.8M|            for(i = 0, j = 0; i < (2 * nt); i += 2)
  ------------------
  |  Branch (180:31): [True: 31.3M, False: 3.54M]
  ------------------
  181|  31.3M|            {
  182|  31.3M|                pu1_dst[(4 * nt) - 2 - i] = pu1_left[j * src_strd]; // U left samples
  183|  31.3M|                pu1_dst[(4 * nt) - 1 - i] = pu1_left[(j * src_strd) + 1]; // V left samples
  184|  31.3M|                j++;
  185|  31.3M|            }
  186|  3.54M|        }
  187|       |        /* Bottom - Left nbrs  */
  188|  3.68M|        if(0 != bot_left)
  ------------------
  |  Branch (188:12): [True: 1.08M, False: 2.59M]
  ------------------
  189|  1.08M|        {
  190|  10.0M|            for(i = (2 * nt), j = nt; i < (4 * nt); i += 2)
  ------------------
  |  Branch (190:39): [True: 8.99M, False: 1.08M]
  ------------------
  191|  8.99M|            {
  192|  8.99M|                pu1_dst[(4 * nt) - 2 - i] = pu1_left[j * src_strd]; // U left samples
  193|  8.99M|                pu1_dst[(4 * nt) - 1 - i] = pu1_left[(j * src_strd) + 1]; // V left samples
  194|  8.99M|                j++;
  195|  8.99M|            }
  196|  1.08M|        }
  197|       |        /* Top nbrs  */
  198|  3.68M|        if(0 != top)
  ------------------
  |  Branch (198:12): [True: 3.38M, False: 304k]
  ------------------
  199|  3.38M|        {
  200|  3.38M|            memcpy(&pu1_dst[(4 * nt) + 2], pu1_top, 2 * nt);
  201|       |            // U-V interleaved Top-top right samples
  202|  3.38M|        }
  203|       |
  204|       |        /* Top - Right nbrs  */
  205|  3.68M|        if(0 != tp_right)
  ------------------
  |  Branch (205:12): [True: 2.17M, False: 1.51M]
  ------------------
  206|  2.17M|        {
  207|  2.17M|            memcpy(&pu1_dst[(4 * nt) + 2 + 2 * nt], pu1_top + 2 * nt, 2 * nt);
  208|       |            // U-V interleaved Top-top right samples
  209|  2.17M|        }
  210|       |
  211|  3.68M|        if(nt == 4 || (nt == 8 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (211:12): [True: 1.48M, False: 2.20M]
  |  Branch (211:24): [True: 1.06M, False: 1.13M]
  |  Branch (211:35): [True: 0, False: 1.06M]
  ------------------
  212|  1.51M|        {
  213|       |            /* 1 bit extraction for all the neighboring blocks */
  214|  1.51M|            tp_left = (nbr_flags & 0x10000) >> 16;
  215|  1.51M|            bot_left = (nbr_flags & 0x8) >> 3;
  216|  1.51M|            left = (nbr_flags & 0x80) >> 7;
  217|  1.51M|            top = (nbr_flags & 0x100) >> 8;
  218|  1.51M|            tp_right = (nbr_flags & 0x1000) >> 12;
  219|       |
  220|  1.51M|            next = 1;
  221|  1.51M|            a_nbr_flag[0] = bot_left;
  222|  1.51M|            a_nbr_flag[1] = left;
  223|  1.51M|            a_nbr_flag[2] = tp_left;
  224|  1.51M|            a_nbr_flag[3] = top;
  225|  1.51M|            a_nbr_flag[4] = tp_right;
  226|       |
  227|       |            /* If bottom -left is not available, reverse substitution process*/
  228|  1.51M|            if(bot_left == 0)
  ------------------
  |  Branch (228:16): [True: 1.05M, False: 466k]
  ------------------
  229|  1.05M|            {
  230|       |                /* Check for the 1st available sample from bottom-left*/
  231|  1.18M|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (231:23): [True: 133k, False: 1.05M]
  ------------------
  232|   133k|                    next++;
  233|       |
  234|       |                /* If Left, top-left are available*/
  235|  1.05M|                if(next <= 2)
  ------------------
  |  Branch (235:20): [True: 984k, False: 66.2k]
  ------------------
  236|   984k|                {
  237|   984k|                    UWORD16 *pu2_dst;
  238|   984k|                    idx = (nt * next);
  239|   984k|                    pu2_dst = (UWORD16 *)&pu1_dst[2 * idx];
  240|   984k|                    ihevc_memset_16bit((UWORD16 *)pu1_dst, pu2_dst[0], idx);
  241|   984k|                }
  242|  66.2k|                else /* If top, top-right are available */
  243|  66.2k|                {
  244|  66.2k|                    UWORD16 *pu2_dst;
  245|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available*/
  246|  66.2k|                    idx = (nt * (next - 1)) + 1;
  247|  66.2k|                    pu2_dst = (UWORD16 *)&pu1_dst[2 * idx];
  248|  66.2k|                    ihevc_memset_16bit((UWORD16 *)pu1_dst, pu2_dst[0], idx);
  249|  66.2k|                }
  250|  1.05M|            }
  251|       |
  252|  1.51M|            if(left == 0)
  ------------------
  |  Branch (252:16): [True: 66.7k, False: 1.45M]
  ------------------
  253|  66.7k|            {
  254|  66.7k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(2 * nt) - 2];
  255|  66.7k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(2 * nt)], pu2_dst[0], nt);
  256|       |
  257|       |
  258|  66.7k|            }
  259|  1.51M|            if(tp_left == 0)
  ------------------
  |  Branch (259:16): [True: 162k, False: 1.35M]
  ------------------
  260|   162k|            {
  261|   162k|                pu1_dst[4 * nt] = pu1_dst[(4 * nt) - 2];
  262|   162k|                pu1_dst[(4 * nt) + 1] = pu1_dst[(4 * nt) - 1];
  263|   162k|            }
  264|  1.51M|            if(top == 0)
  ------------------
  |  Branch (264:16): [True: 95.7k, False: 1.42M]
  ------------------
  265|  95.7k|            {
  266|  95.7k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(4 * nt)];
  267|  95.7k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(4 * nt) + 2], pu2_dst[0], nt);
  268|       |
  269|       |
  270|  95.7k|            }
  271|  1.51M|            if(tp_right == 0)
  ------------------
  |  Branch (271:16): [True: 646k, False: 870k]
  ------------------
  272|   646k|            {
  273|   646k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(6 * nt)];
  274|   646k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(6 * nt) + 2], pu2_dst[0], nt);
  275|       |
  276|       |
  277|   646k|            }
  278|  1.51M|        }
  279|  2.17M|        else if(nt == 8 || (nt == 16 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (279:17): [True: 1.03M, False: 1.13M]
  |  Branch (279:29): [True: 1.13M, False: 18.4E]
  |  Branch (279:41): [True: 0, False: 1.13M]
  ------------------
  280|  1.06M|        {
  281|  1.06M|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (281:33): [True: 0, False: 1.06M]
  ------------------
  282|  1.06M|            WORD32 nbr_flags_temp = 0;
  283|  1.06M|            nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4)
  284|  1.06M|                            + ((nbr_flags & 0x300) >> 4)
  285|  1.06M|                            + ((nbr_flags & 0x3000) >> 6)
  286|  1.06M|                            + ((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|  1.06M|            {
  291|  1.06M|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * (4 * sub_sample); /* for bottom left and left */
  ------------------
  |  |   43|  1.06M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 47.6k, False: 1.01M]
  |  |  ------------------
  ------------------
  292|  1.06M|                if(nbr_id_from_bl == 32 * sub_sample)
  ------------------
  |  Branch (292:20): [True: 47.6k, False: 1.01M]
  ------------------
  293|  47.6k|                    nbr_id_from_bl = 16 * sub_sample;
  294|  1.06M|                if(nbr_id_from_bl == 16 * sub_sample)
  ------------------
  |  Branch (294:20): [True: 47.6k, False: 1.01M]
  ------------------
  295|  47.6k|                {
  296|       |                    /* for top left : 1 pel per nbr bit */
  297|  47.6k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (297:24): [True: 47.4k, False: 213]
  ------------------
  298|  47.4k|                    {
  299|  47.4k|                        nbr_id_from_bl++;
  300|  47.4k|                        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|  47.4k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 47.4k]
  |  |  ------------------
  ------------------
  301|       |
  302|  47.4k|                    }
  303|  47.6k|                }
  304|       |                /* Reverse Substitution Process*/
  305|  1.06M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (305:20): [True: 721k, False: 345k]
  ------------------
  306|   721k|                {
  307|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  308|   721k|                    pu1_ref_u = pu1_dst[2 * nbr_id_from_bl];
  309|   721k|                    pu1_ref_v = pu1_dst[(2 * nbr_id_from_bl) + 1];
  310|  6.91M|                    for(i = 2 * (nbr_id_from_bl - 1); i >= 0; i -= 2)
  ------------------
  |  Branch (310:55): [True: 6.19M, False: 721k]
  ------------------
  311|  6.19M|                    {
  312|  6.19M|                        pu1_dst[i] = pu1_ref_u;
  313|  6.19M|                        pu1_dst[i + 1] = pu1_ref_v;
  314|  6.19M|                    }
  315|   721k|                }
  316|  1.06M|            }
  317|       |
  318|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  319|  9.06M|            while(nbr_id_from_bl < ((T8C_4NT * sub_sample)+1))
  ------------------
  |  |   84|  9.06M|#define T8C_4NT 32
  ------------------
  |  Branch (319:19): [True: 7.99M, False: 1.06M]
  ------------------
  320|  7.99M|            {
  321|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  322|       |                /* Divide by 8 to obtain the original index */
  323|  7.99M|                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.99M]
  ------------------
  324|       |
  325|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  326|  7.99M|                if(nbr_id_from_bl == (T8C_4NT * sub_sample / 2))
  ------------------
  |  |   84|  7.99M|#define T8C_4NT 32
  ------------------
  |  Branch (326:20): [True: 1.01M, False: 6.97M]
  ------------------
  327|  1.01M|                {
  328|  1.01M|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|  1.01M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  329|       |
  330|       |                    /* only pel substitution for TL */
  331|  1.01M|                    if(!get_bits)
  ------------------
  |  Branch (331:24): [True: 66.4k, False: 953k]
  ------------------
  332|  66.4k|                    {
  333|  66.4k|                        pu1_dst[2 * nbr_id_from_bl] = pu1_dst[(2 * nbr_id_from_bl) - 2];
  334|  66.4k|                        pu1_dst[(2 * nbr_id_from_bl) + 1] = pu1_dst[(2 * nbr_id_from_bl) - 1];
  335|  66.4k|                    }
  336|  1.01M|                }
  337|  6.97M|                else
  338|  6.97M|                {
  339|  6.97M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  6.97M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  340|  6.97M|                    if(!get_bits)
  ------------------
  |  Branch (340:24): [True: 1.05M, False: 5.92M]
  ------------------
  341|  1.05M|                    {
  342|  1.05M|                        UWORD16 *pu2_dst;
  343|       |                        /* 8 pel substitution (other than TL) */
  344|  1.05M|                        pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2];
  345|  1.05M|                        ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample);
  346|  1.05M|                    }
  347|       |
  348|  6.97M|                }
  349|  7.99M|                nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   84|  7.99M|#define T8C_4NT 32
  ------------------
  |  Branch (349:35): [True: 1.01M, False: 6.97M]
  ------------------
  350|  7.99M|            }
  351|       |
  352|  1.06M|        }
  353|  1.10M|        else if(nt == 16 || (nt == 32 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (353:17): [True: 1.10M, False: 0]
  |  Branch (353:30): [True: 0, False: 0]
  |  Branch (353:42): [True: 0, False: 0]
  ------------------
  354|  1.13M|        {
  355|  1.13M|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (355:33): [True: 0, False: 1.13M]
  ------------------
  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.13M|            {
  359|  1.13M|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4 * sub_sample; /* for bottom left and left */
  ------------------
  |  |   43|  1.13M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 28.6k, False: 1.11M]
  |  |  ------------------
  ------------------
  360|       |
  361|  1.13M|                if(nbr_id_from_bl == 32 * sub_sample)
  ------------------
  |  Branch (361:20): [True: 28.6k, False: 1.11M]
  ------------------
  362|  28.6k|                {
  363|       |                    /* for top left : 1 pel per nbr bit */
  364|  28.6k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (364:24): [True: 28.3k, False: 266]
  ------------------
  365|  28.3k|                    {
  366|       |                        /* top left not available */
  367|  28.3k|                        nbr_id_from_bl++;
  368|       |                        /* top and top right;  4 pels per nbr bit */
  369|  28.3k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4 * sub_sample;
  ------------------
  |  |   43|  28.3k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 28.3k]
  |  |  ------------------
  ------------------
  370|  28.3k|                    }
  371|  28.6k|                }
  372|       |                /* Reverse Substitution Process*/
  373|  1.13M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (373:20): [True: 869k, False: 268k]
  ------------------
  374|   869k|                {
  375|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  376|   869k|                    pu1_ref_u = pu1_dst[2 * nbr_id_from_bl];
  377|   869k|                    pu1_ref_v = pu1_dst[2 * nbr_id_from_bl + 1];
  378|  15.2M|                    for(i = (2 * (nbr_id_from_bl - 1)); i >= 0; i -= 2)
  ------------------
  |  Branch (378:57): [True: 14.3M, False: 869k]
  ------------------
  379|  14.3M|                    {
  380|  14.3M|                        pu1_dst[i] = pu1_ref_u;
  381|  14.3M|                        pu1_dst[i + 1] = pu1_ref_v;
  382|  14.3M|                    }
  383|   869k|                }
  384|  1.13M|            }
  385|       |
  386|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  387|  16.7M|            while(nbr_id_from_bl < ((T16C_4NT * sub_sample)+1))
  ------------------
  |  |   83|  16.7M|#define T16C_4NT 64
  ------------------
  |  Branch (387:19): [True: 15.6M, False: 1.13M]
  ------------------
  388|  15.6M|            {
  389|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  390|       |                /* Devide by 4 to obtain the original index */
  391|  15.6M|                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: 15.6M]
  ------------------
  392|       |
  393|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  394|  15.6M|                if(nbr_id_from_bl == (T16C_4NT * sub_sample / 2))
  ------------------
  |  |   83|  15.6M|#define T16C_4NT 64
  ------------------
  |  Branch (394:20): [True: 1.11M, False: 14.5M]
  ------------------
  395|  1.11M|                {
  396|  1.11M|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|  1.11M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  397|       |                    /* only pel substitution for TL */
  398|  1.11M|                    if(!get_bits)
  ------------------
  |  Branch (398:24): [True: 164k, False: 948k]
  ------------------
  399|   164k|                    {
  400|   164k|                        pu1_dst[2 * nbr_id_from_bl] = pu1_dst[(2 * nbr_id_from_bl) - 2];
  401|   164k|                        pu1_dst[(2 * nbr_id_from_bl) + 1] = pu1_dst[(2 * nbr_id_from_bl) - 1];
  402|   164k|                    }
  403|  1.11M|                }
  404|  14.5M|                else
  405|  14.5M|                {
  406|  14.5M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  14.5M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  407|  14.5M|                    if(!get_bits)
  ------------------
  |  Branch (407:24): [True: 2.45M, False: 12.0M]
  ------------------
  408|  2.45M|                    {
  409|  2.45M|                        UWORD16 *pu2_dst;
  410|       |                        /* 4 pel substitution (other than TL) */
  411|  2.45M|                        pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2];
  412|  2.45M|                        ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample);
  413|  2.45M|                    }
  414|       |
  415|  14.5M|                }
  416|  15.6M|                nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   83|  15.6M|#define T16C_4NT 64
  ------------------
  |  Branch (416:35): [True: 1.11M, False: 14.5M]
  ------------------
  417|  15.6M|            }
  418|  1.13M|        }
  419|  3.68M|    }
  420|  3.72M|}
ihevc_intra_pred_chroma_planar:
  560|   447k|{
  561|       |
  562|   447k|    WORD32 row, col;
  563|   447k|    WORD32 log2nt = 5;
  564|   447k|    WORD32 two_nt, three_nt;
  565|   447k|    UNUSED(src_strd);
  ------------------
  |  |   38|   447k|#define UNUSED(x) ((void)(x))
  ------------------
  566|   447k|    UNUSED(mode);
  ------------------
  |  |   38|   447k|#define UNUSED(x) ((void)(x))
  ------------------
  567|   447k|    switch(nt)
  568|   447k|    {
  569|   120k|        case 16:
  ------------------
  |  Branch (569:9): [True: 120k, False: 326k]
  ------------------
  570|   120k|            log2nt = 4;
  571|   120k|            break;
  572|   180k|        case 8:
  ------------------
  |  Branch (572:9): [True: 180k, False: 267k]
  ------------------
  573|   180k|            log2nt = 3;
  574|   180k|            break;
  575|   147k|        case 4:
  ------------------
  |  Branch (575:9): [True: 147k, False: 300k]
  ------------------
  576|   147k|            log2nt = 2;
  577|   147k|            break;
  578|      0|        default:
  ------------------
  |  Branch (578:9): [True: 0, False: 447k]
  ------------------
  579|      0|            break;
  580|   447k|    }
  581|   447k|    two_nt = 2 * nt;
  582|   447k|    three_nt = 3 * nt;
  583|       |    /* Planar filtering */
  584|  4.33M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (584:18): [True: 3.89M, False: 447k]
  ------------------
  585|  3.89M|    {
  586|  47.5M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (586:22): [True: 43.6M, False: 3.89M]
  ------------------
  587|  43.6M|        {
  588|  43.6M|            pu1_dst[row * dst_strd + col] = ((nt - 1 - col / 2)
  589|  43.6M|                            * pu1_ref[2 * (two_nt - 1 - row)]
  590|  43.6M|                            + (col / 2 + 1) * pu1_ref[2 * (three_nt + 1)]
  591|  43.6M|                            + (nt - 1 - row) * pu1_ref[2 * (two_nt + 1) + col]
  592|  43.6M|                            + (row + 1) * pu1_ref[2 * (nt - 1)] + nt) >> (log2nt + 1);
  593|       |
  594|  43.6M|            pu1_dst[row * dst_strd + col + 1] = ((nt - 1 - col / 2)
  595|  43.6M|                            * pu1_ref[2 * (two_nt - 1 - row) + 1]
  596|  43.6M|                            + (col / 2 + 1) * pu1_ref[2 * (three_nt + 1) + 1]
  597|  43.6M|                            + (nt - 1 - row) * pu1_ref[2 * (two_nt + 1) + col + 1]
  598|  43.6M|                            + (row + 1) * pu1_ref[2 * (nt - 1) + 1] + nt) >> (log2nt + 1);
  599|  43.6M|        }
  600|  3.89M|    }
  601|   447k|}
ihevc_intra_pred_chroma_dc:
  648|   195k|{
  649|       |
  650|   195k|    WORD32 acc_dc_u, acc_dc_v;
  651|   195k|    WORD32 dc_val_u, dc_val_v;
  652|   195k|    WORD32 i;
  653|   195k|    WORD32 row, col;
  654|   195k|    WORD32 log2nt = 5;
  655|   195k|    UNUSED(mode);
  ------------------
  |  |   38|   195k|#define UNUSED(x) ((void)(x))
  ------------------
  656|   195k|    UNUSED(src_strd);
  ------------------
  |  |   38|   195k|#define UNUSED(x) ((void)(x))
  ------------------
  657|   195k|    switch(nt)
  658|   195k|    {
  659|      0|        case 32:
  ------------------
  |  Branch (659:9): [True: 0, False: 195k]
  ------------------
  660|      0|            log2nt = 5;
  661|      0|            break;
  662|  31.1k|        case 16:
  ------------------
  |  Branch (662:9): [True: 31.1k, False: 164k]
  ------------------
  663|  31.1k|            log2nt = 4;
  664|  31.1k|            break;
  665|  70.5k|        case 8:
  ------------------
  |  Branch (665:9): [True: 70.5k, False: 124k]
  ------------------
  666|  70.5k|            log2nt = 3;
  667|  70.5k|            break;
  668|  93.7k|        case 4:
  ------------------
  |  Branch (668:9): [True: 93.7k, False: 101k]
  ------------------
  669|  93.7k|            log2nt = 2;
  670|  93.7k|            break;
  671|      0|        default:
  ------------------
  |  Branch (671:9): [True: 0, False: 195k]
  ------------------
  672|      0|            break;
  673|   195k|    }
  674|       |
  675|       |
  676|   195k|    acc_dc_u = 0;
  677|   195k|    acc_dc_v = 0;
  678|       |    /* Calculate DC value for the transform block */
  679|  1.63M|    for(i = (2 * nt); i < (4 * nt); i += 2)
  ------------------
  |  Branch (679:23): [True: 1.43M, False: 195k]
  ------------------
  680|  1.43M|    {
  681|  1.43M|        acc_dc_u += pu1_ref[i];
  682|  1.43M|        acc_dc_v += pu1_ref[i + 1];
  683|  1.43M|    }
  684|  1.63M|    for(i = ((4 * nt) + 2); i < ((6 * nt) + 2); i += 2)
  ------------------
  |  Branch (684:29): [True: 1.43M, False: 195k]
  ------------------
  685|  1.43M|    {
  686|  1.43M|        acc_dc_u += pu1_ref[i];
  687|  1.43M|        acc_dc_v += pu1_ref[i + 1];
  688|  1.43M|    }
  689|       |
  690|       |
  691|   195k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  692|   195k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  693|       |
  694|       |
  695|       |    /* Fill the remaining rows with DC value*/
  696|  1.62M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (696:18): [True: 1.43M, False: 195k]
  ------------------
  697|  1.43M|    {
  698|  15.3M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (698:22): [True: 13.9M, False: 1.43M]
  ------------------
  699|  13.9M|        {
  700|  13.9M|            pu1_dst[(row * dst_strd) + col] = dc_val_u;
  701|  13.9M|            pu1_dst[(row * dst_strd) + col + 1] = dc_val_v;
  702|  13.9M|        }
  703|  1.43M|    }
  704|       |
  705|   195k|}
ihevc_intra_pred_chroma_horz:
  752|  60.1k|{
  753|       |
  754|  60.1k|    WORD32 row, col;
  755|  60.1k|    UNUSED(mode);
  ------------------
  |  |   38|  60.1k|#define UNUSED(x) ((void)(x))
  ------------------
  756|  60.1k|    UNUSED(src_strd);
  ------------------
  |  |   38|  60.1k|#define UNUSED(x) ((void)(x))
  ------------------
  757|       |    /* Replication to next rows*/
  758|   444k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (758:18): [True: 383k, False: 60.1k]
  ------------------
  759|   383k|    {
  760|  3.65M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (760:22): [True: 3.27M, False: 383k]
  ------------------
  761|  3.27M|        {
  762|  3.27M|            pu1_dst[(row * dst_strd) + col] = pu1_ref[(4 * nt) - 2 - 2 * row];
  763|  3.27M|            pu1_dst[(row * dst_strd) + col + 1] = pu1_ref[(4 * nt) - 1 - 2 * row];
  764|  3.27M|        }
  765|   383k|    }
  766|  60.1k|}
ihevc_intra_pred_chroma_ver:
  814|   236k|{
  815|   236k|    WORD32 row, col;
  816|   236k|    UNUSED(mode);
  ------------------
  |  |   38|   236k|#define UNUSED(x) ((void)(x))
  ------------------
  817|   236k|    UNUSED(src_strd);
  ------------------
  |  |   38|   236k|#define UNUSED(x) ((void)(x))
  ------------------
  818|       |    /* Replication to next columns*/
  819|  2.15M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (819:18): [True: 1.92M, False: 236k]
  ------------------
  820|  1.92M|    {
  821|  21.8M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (821:22): [True: 19.9M, False: 1.92M]
  ------------------
  822|  19.9M|        {
  823|  19.9M|            pu1_dst[(row * dst_strd) + col] = pu1_ref[(4 * nt) + 2 + col];
  824|  19.9M|            pu1_dst[(row * dst_strd) + col + 1] = pu1_ref[(4 * nt) + 3 + col];
  825|  19.9M|        }
  826|  1.92M|    }
  827|   236k|}
ihevc_intra_pred_chroma_mode2:
  874|  59.8k|{
  875|  59.8k|    WORD32 row, col;
  876|       |
  877|  59.8k|    WORD32 intra_pred_ang = 32;
  878|  59.8k|    WORD32 idx_u, idx_v;
  879|  59.8k|    UNUSED(src_strd);
  ------------------
  |  |   38|  59.8k|#define UNUSED(x) ((void)(x))
  ------------------
  880|  59.8k|    UNUSED(mode);
  ------------------
  |  |   38|  59.8k|#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|   650k|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (883:18): [True: 591k, False: 59.8k]
  ------------------
  884|   591k|    {
  885|   591k|        idx_u = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  886|   591k|        idx_v = (((col + 1) + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  887|  8.34M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (887:22): [True: 7.75M, False: 591k]
  ------------------
  888|  7.75M|        {
  889|  7.75M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[(4 * nt) - 2 * row - idx_u - 3];
  890|  7.75M|            pu1_dst[(col + 1) + (row * dst_strd)] = pu1_ref[(4 * nt) - 2 * row - idx_v - 1];
  891|  7.75M|        }
  892|   591k|    }
  893|       |
  894|  59.8k|}
ihevc_intra_pred_chroma_mode_18_34:
  941|  68.0k|{
  942|  68.0k|    WORD32 row, col;
  943|  68.0k|    WORD32 intra_pred_ang;
  944|  68.0k|    WORD32 idx = 0;
  945|  68.0k|    UNUSED(src_strd);
  ------------------
  |  |   38|  68.0k|#define UNUSED(x) ((void)(x))
  ------------------
  946|  68.0k|    intra_pred_ang = 32; /*Default value*/
  947|       |    /* For mode 18, angle is -45degree */
  948|  68.0k|    if(mode == 18)
  ------------------
  |  Branch (948:8): [True: 16.1k, False: 51.8k]
  ------------------
  949|  16.1k|        intra_pred_ang = -32;
  950|       |    /* For mode 34, angle is 45degree */
  951|  51.8k|    else if(mode == 34)
  ------------------
  |  Branch (951:13): [True: 51.8k, False: 18.4E]
  ------------------
  952|  51.8k|        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|   566k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (955:18): [True: 498k, False: 68.0k]
  ------------------
  956|   498k|    {
  957|   498k|        idx = ((row + 1) * intra_pred_ang) >> 5;
  958|       |
  959|  5.27M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (959:22): [True: 4.77M, False: 498k]
  ------------------
  960|  4.77M|        {
  961|  4.77M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[(4 * nt) + col + 2 * idx + 2];
  962|  4.77M|            pu1_dst[(col + 1) + (row * dst_strd)] = pu1_ref[(4 * nt) + (col + 1) + 2 * idx + 2];
  963|  4.77M|        }
  964|       |
  965|   498k|    }
  966|       |
  967|  68.0k|}
ihevc_intra_pred_chroma_mode_3_to_9:
 1014|   118k|{
 1015|   118k|    WORD32 row, col;
 1016|       |
 1017|   118k|    WORD32 intra_pred_ang;
 1018|   118k|    WORD32 idx_u, ref_main_idx_u;
 1019|   118k|    WORD32 idx_v, ref_main_idx_v;
 1020|   118k|    WORD32 pos_u, fract_u;
 1021|   118k|    WORD32 pos_v, fract_v;
 1022|   118k|    UNUSED(src_strd);
  ------------------
  |  |   38|   118k|#define UNUSED(x) ((void)(x))
  ------------------
 1023|       |    /* Intra Pred Angle according to the mode */
 1024|   118k|    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|  1.07M|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1029:18): [True: 954k, False: 118k]
  ------------------
 1030|   954k|    {
 1031|   954k|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1032|   954k|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1033|       |
 1034|   954k|        idx_u = pos_u >> 5;
 1035|   954k|        fract_u = pos_u & (31);
 1036|       |
 1037|   954k|        idx_v = pos_v >> 5;
 1038|   954k|        fract_v = pos_v & (31);
 1039|       |        // Do linear filtering
 1040|  11.6M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1040:22): [True: 10.7M, False: 954k]
  ------------------
 1041|  10.7M|        {
 1042|  10.7M|            ref_main_idx_u = (4 * nt) - 2 * row - 2 * idx_u - 2;
 1043|  10.7M|            ref_main_idx_v = (4 * nt) - 2 * row - 2 * idx_v - 1;
 1044|       |
 1045|  10.7M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract_u)
 1046|  10.7M|                            * pu1_ref[ref_main_idx_u]
 1047|  10.7M|                            + fract_u * pu1_ref[ref_main_idx_u - 2] + 16) >> 5);
 1048|       |
 1049|  10.7M|            pu1_dst[(col + 1) + (row * dst_strd)] = (((32 - fract_v)
 1050|  10.7M|                            * pu1_ref[ref_main_idx_v]
 1051|  10.7M|                            + fract_v * pu1_ref[ref_main_idx_v - 2] + 16) >> 5);
 1052|  10.7M|        }
 1053|       |
 1054|   954k|    }
 1055|       |
 1056|   118k|}
ihevc_intra_pred_chroma_mode_11_to_17:
 1103|  90.5k|{
 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|  90.5k|    WORD32 row, col, k;
 1109|  90.5k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1110|  90.5k|    WORD32 idx_u, idx_v, ref_main_idx_u, ref_main_idx_v, ref_idx;
 1111|  90.5k|    WORD32 pos_u, pos_v, fract_u, fract_v;
 1112|       |
 1113|  90.5k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 2];
 1114|  90.5k|    UWORD8 *ref_main;
 1115|  90.5k|    UNUSED(src_strd);
  ------------------
  |  |   38|  90.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1116|  90.5k|    inv_ang_sum = 128;
 1117|       |
 1118|  90.5k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1119|       |
 1120|  90.5k|    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|  90.5k|    ref_main = ref_temp + 2 * nt;
 1128|   747k|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1128:16): [True: 656k, False: 90.5k]
  ------------------
 1129|   656k|    {
 1130|   656k|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k];
 1131|   656k|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k + 1];
 1132|   656k|    }
 1133|       |
 1134|  90.5k|    ref_main = ref_temp + (2 * (nt - 1));
 1135|  90.5k|    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|   289k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1140:17): [True: 199k, False: 90.5k]
  ------------------
 1141|   199k|    {
 1142|   199k|        inv_ang_sum += inv_ang;
 1143|   199k|        ref_main[k] = pu1_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1144|   199k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1145|   199k|    }
 1146|       |
 1147|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1148|       |    /* samples dependent on distance to obtain destination sample */
 1149|   656k|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1149:18): [True: 566k, False: 90.5k]
  ------------------
 1150|   566k|    {
 1151|   566k|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1152|   566k|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1153|   566k|        idx_u = pos_u >> 5;
 1154|   566k|        idx_v = pos_v >> 5;
 1155|   566k|        fract_u = pos_u & (31);
 1156|   566k|        fract_v = pos_v & (31);
 1157|       |
 1158|       |        // Do linear filtering
 1159|  5.42M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1159:22): [True: 4.85M, False: 566k]
  ------------------
 1160|  4.85M|        {
 1161|  4.85M|            ref_main_idx_u = 2 * (row + idx_u + 1);
 1162|  4.85M|            ref_main_idx_v = 2 * (row + idx_v + 1) + 1;
 1163|       |
 1164|  4.85M|            pu1_dst[col + (dst_strd * row)] = (UWORD8)(((32 - fract_u)
 1165|  4.85M|                            * ref_main[ref_main_idx_u]
 1166|  4.85M|                            + fract_u * ref_main[ref_main_idx_u + 2] + 16) >> 5);
 1167|  4.85M|            pu1_dst[(col + 1) + (dst_strd * row)] = (UWORD8)(((32 - fract_v)
 1168|  4.85M|                            * ref_main[ref_main_idx_v]
 1169|  4.85M|                            + fract_v * ref_main[ref_main_idx_v + 2] + 16) >> 5);
 1170|       |
 1171|  4.85M|        }
 1172|       |
 1173|   566k|    }
 1174|       |
 1175|  90.5k|}
ihevc_intra_pred_chroma_mode_19_to_25:
 1223|   119k|{
 1224|       |
 1225|   119k|    WORD32 row, col, k;
 1226|   119k|    WORD32 intra_pred_ang, idx;
 1227|   119k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1228|   119k|    WORD32 ref_main_idx_u, ref_main_idx_v, ref_idx;
 1229|   119k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 2];
 1230|   119k|    UWORD8 *ref_main;
 1231|   119k|    UNUSED(src_strd);
  ------------------
  |  |   38|   119k|#define UNUSED(x) ((void)(x))
  ------------------
 1232|       |
 1233|       |
 1234|   119k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1235|   119k|    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|   119k|    ref_main = ref_temp + 2 * nt;
 1241|   990k|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1241:16): [True: 870k, False: 119k]
  ------------------
 1242|   870k|    {
 1243|   870k|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k];
 1244|   870k|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k + 1];
 1245|   870k|    }
 1246|       |
 1247|       |
 1248|   119k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1249|   119k|    inv_ang_sum = 128;
 1250|   119k|    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|   380k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1254:17): [True: 260k, False: 119k]
  ------------------
 1255|   260k|    {
 1256|   260k|        inv_ang_sum += inv_ang;
 1257|   260k|        ref_main[k] = pu1_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 1258|   260k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 1259|   260k|    }
 1260|       |
 1261|   870k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1261:18): [True: 750k, False: 119k]
  ------------------
 1262|   750k|    {
 1263|   750k|        pos = ((row + 1) * intra_pred_ang);
 1264|   750k|        idx = pos >> 5;
 1265|   750k|        fract = pos & (31);
 1266|       |
 1267|       |        // Do linear filtering
 1268|  6.85M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1268:22): [True: 6.10M, False: 750k]
  ------------------
 1269|  6.10M|        {
 1270|  6.10M|            ref_main_idx_u = col + 2 * idx + 2;
 1271|  6.10M|            ref_main_idx_v = (col + 1) + 2 * idx + 2;
 1272|  6.10M|            pu1_dst[(row * dst_strd) + col] = (UWORD8)(((32 - fract)
 1273|  6.10M|                            * ref_main[ref_main_idx_u]
 1274|  6.10M|                            + fract * ref_main[ref_main_idx_u + 2] + 16) >> 5);
 1275|  6.10M|            pu1_dst[(row * dst_strd) + (col + 1)] = (UWORD8)(((32 - fract)
 1276|  6.10M|                            * ref_main[ref_main_idx_v]
 1277|  6.10M|                            + fract * ref_main[ref_main_idx_v + 2] + 16) >> 5);
 1278|       |
 1279|  6.10M|        }
 1280|       |
 1281|   750k|    }
 1282|       |
 1283|   119k|}
ihevc_intra_pred_chroma_mode_27_to_33:
 1331|   104k|{
 1332|   104k|    WORD32 row, col;
 1333|   104k|    WORD32 pos, fract;
 1334|   104k|    WORD32 intra_pred_ang;
 1335|   104k|    WORD32 idx, ref_main_idx_u, ref_main_idx_v;
 1336|   104k|    UNUSED(src_strd);
  ------------------
  |  |   38|   104k|#define UNUSED(x) ((void)(x))
  ------------------
 1337|       |
 1338|       |
 1339|   104k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1340|       |
 1341|   793k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1341:18): [True: 689k, False: 104k]
  ------------------
 1342|   689k|    {
 1343|   689k|        pos = ((row + 1) * intra_pred_ang);
 1344|   689k|        idx = pos >> 5;
 1345|   689k|        fract = pos & (31);
 1346|       |
 1347|       |
 1348|       |        // Do linear filtering
 1349|  6.87M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1349:22): [True: 6.18M, False: 689k]
  ------------------
 1350|  6.18M|        {
 1351|  6.18M|            ref_main_idx_u = (4 * nt) + col + 2 * idx + 2;
 1352|  6.18M|            ref_main_idx_v = (4 * nt) + (col + 1) + 2 * idx + 2;
 1353|  6.18M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1354|  6.18M|                            * pu1_ref[ref_main_idx_u]
 1355|  6.18M|                            + fract * pu1_ref[ref_main_idx_u + 2] + 16) >> 5);
 1356|  6.18M|            pu1_dst[(col + 1) + (row * dst_strd)] = (((32 - fract)
 1357|  6.18M|                            * pu1_ref[ref_main_idx_v]
 1358|  6.18M|                            + fract * pu1_ref[ref_main_idx_v + 2] + 16) >> 5);
 1359|       |
 1360|  6.18M|        }
 1361|   689k|    }
 1362|       |
 1363|   104k|}

ihevc_chroma_itrans_recon_4x4:
  115|   306k|{
  116|   306k|    WORD32 j;
  117|   306k|    WORD32 e[2], o[2];
  118|   306k|    WORD32 add;
  119|   306k|    WORD32 shift;
  120|   306k|    WORD16 *pi2_tmp_orig;
  121|   306k|    WORD32 trans_size;
  122|   306k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   306k|#define UNUSED(x) ((void)(x))
  ------------------
  123|   306k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   306k|#define TRANS_SIZE_4   4
  ------------------
  124|       |
  125|   306k|    pi2_tmp_orig = pi2_tmp;
  126|       |
  127|       |    /* Inverse Transform 1st stage */
  128|   306k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   306k|#define IT_SHIFT_STAGE_1 7
  ------------------
  129|   306k|    add = 1 << (shift - 1);
  130|       |
  131|  1.53M|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (131:16): [True: 1.22M, False: 306k]
  ------------------
  132|  1.22M|    {
  133|       |        /* Checking for Zero Cols */
  134|  1.22M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (134:12): [True: 558k, False: 669k]
  ------------------
  135|   558k|        {
  136|   558k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  137|   558k|        }
  138|   669k|        else
  139|   669k|        {
  140|       |
  141|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  142|   669k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  143|   669k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  144|   669k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  145|   669k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  146|   669k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  147|   669k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  148|   669k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  149|   669k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  150|       |
  151|   669k|            pi2_tmp[0] =
  152|   669k|                            CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|   669k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   669k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 12.3k, False: 656k]
  |  |  |  |  |  Branch (40:53): [True: 8.27k, False: 648k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   669k|            pi2_tmp[1] =
  154|   669k|                            CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|   669k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   669k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.29k, False: 661k]
  |  |  |  |  |  Branch (40:53): [True: 6.92k, False: 654k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|   669k|            pi2_tmp[2] =
  156|   669k|                            CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|   669k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   669k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.27k, False: 660k]
  |  |  |  |  |  Branch (40:53): [True: 5.95k, False: 654k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|   669k|            pi2_tmp[3] =
  158|   669k|                            CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|   669k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   669k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.34k, False: 660k]
  |  |  |  |  |  Branch (40:53): [True: 7.48k, False: 653k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|       |
  160|   669k|        }
  161|  1.22M|        pi2_src++;
  162|  1.22M|        pi2_tmp += trans_size;
  163|  1.22M|        zero_cols = zero_cols >> 1;
  164|  1.22M|    }
  165|       |
  166|   306k|    pi2_tmp = pi2_tmp_orig;
  167|       |
  168|       |    /* Inverse Transform 2nd stage */
  169|   306k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   306k|#define IT_SHIFT_STAGE_2 12
  ------------------
  170|   306k|    add = 1 << (shift - 1);
  171|       |
  172|  1.53M|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (172:16): [True: 1.22M, False: 306k]
  ------------------
  173|  1.22M|    {
  174|  1.22M|        WORD32 itrans_out;
  175|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  176|  1.22M|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  177|  1.22M|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  178|  1.22M|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  179|  1.22M|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  180|  1.22M|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  181|  1.22M|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  182|  1.22M|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  183|  1.22M|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  184|       |
  185|  1.22M|        itrans_out =
  186|  1.22M|                        CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  1.22M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.22M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|  1.22M|        pu1_dst[0 * 2] = CLIP_U8((itrans_out + pu1_pred[0 * 2]));
  ------------------
  |  |   40|  1.22M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 214k, False: 1.01M]
  |  |  |  |  |  Branch (40:53): [True: 201k, False: 811k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|  1.22M|        itrans_out =
  189|  1.22M|                        CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  1.22M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.22M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  1.22M|        pu1_dst[1 * 2] = CLIP_U8((itrans_out + pu1_pred[1 * 2]));
  ------------------
  |  |   40|  1.22M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 180k, False: 1.04M]
  |  |  |  |  |  Branch (40:53): [True: 197k, False: 849k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  1.22M|        itrans_out =
  192|  1.22M|                        CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  1.22M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.22M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  1.22M|        pu1_dst[2 * 2] = CLIP_U8((itrans_out + pu1_pred[2 * 2]));
  ------------------
  |  |   40|  1.22M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 164k, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 212k, False: 850k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|  1.22M|        itrans_out =
  195|  1.22M|                        CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  1.22M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.22M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|  1.22M|        pu1_dst[3 * 2] = CLIP_U8((itrans_out + pu1_pred[3 * 2]));
  ------------------
  |  |   40|  1.22M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 172k, False: 1.05M]
  |  |  |  |  |  Branch (40:53): [True: 243k, False: 811k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |
  198|  1.22M|        pi2_tmp++;
  199|  1.22M|        pu1_pred += pred_strd;
  200|  1.22M|        pu1_dst += dst_strd;
  201|       |
  202|  1.22M|    }
  203|   306k|}

ihevc_chroma_itrans_recon_16x16:
  116|   542k|{
  117|   542k|    WORD32 j, k;
  118|   542k|    WORD32 e[8], o[8];
  119|   542k|    WORD32 ee[4], eo[4];
  120|   542k|    WORD32 eee[2], eeo[2];
  121|   542k|    WORD32 add;
  122|   542k|    WORD32 shift;
  123|   542k|    WORD16 *pi2_tmp_orig;
  124|   542k|    WORD32 trans_size;
  125|   542k|    WORD32 row_limit_2nd_stage, zero_rows_2nd_stage = zero_cols;
  126|       |
  127|   542k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   542k|#define TRANS_SIZE_16 16
  ------------------
  128|   542k|    pi2_tmp_orig = pi2_tmp;
  129|       |
  130|   542k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (130:8): [True: 299k, False: 243k]
  ------------------
  131|   299k|        row_limit_2nd_stage = 4;
  132|   243k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (132:13): [True: 201k, False: 42.3k]
  ------------------
  133|   201k|        row_limit_2nd_stage = 8;
  134|  42.3k|    else
  135|  42.3k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  42.3k|#define TRANS_SIZE_16 16
  ------------------
  136|       |
  137|   542k|    if((zero_rows & 0xFFF0) == 0xFFF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (137:8): [True: 263k, False: 279k]
  ------------------
  138|   263k|    {
  139|       |        /************************************************************************************************/
  140|       |        /**********************************START - IT_RECON_16x16****************************************/
  141|       |        /************************************************************************************************/
  142|       |
  143|       |        /* Inverse Transform 1st stage */
  144|   263k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   263k|#define IT_SHIFT_STAGE_1 7
  ------------------
  145|   263k|        add = 1 << (shift - 1);
  146|       |
  147|  1.75M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (147:20): [True: 1.48M, False: 263k]
  ------------------
  148|  1.48M|        {
  149|       |            /* Checking for Zero Cols */
  150|  1.48M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (150:16): [True: 860k, False: 628k]
  ------------------
  151|   860k|            {
  152|   860k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  153|   860k|            }
  154|   628k|            else
  155|   628k|            {
  156|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  157|  5.69M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (157:28): [True: 5.07M, False: 628k]
  ------------------
  158|  5.07M|                {
  159|  5.07M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  160|  5.07M|                                    + g_ai2_ihevc_trans_16[3][k]
  161|  5.07M|                                                    * pi2_src[3 * src_strd];
  162|  5.07M|                }
  163|  3.17M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (163:28): [True: 2.54M, False: 628k]
  ------------------
  164|  2.54M|                {
  165|  2.54M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  166|  2.54M|                }
  167|   628k|                eeo[0] = 0;
  168|   628k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  169|   628k|                eeo[1] = 0;
  170|   628k|                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|  1.89M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (173:28): [True: 1.27M, False: 628k]
  ------------------
  174|  1.27M|                {
  175|  1.27M|                    ee[k] = eee[k] + eeo[k];
  176|  1.27M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  177|  1.27M|                }
  178|  3.16M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (178:28): [True: 2.54M, False: 628k]
  ------------------
  179|  2.54M|                {
  180|  2.54M|                    e[k] = ee[k] + eo[k];
  181|  2.54M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  182|  2.54M|                }
  183|  5.71M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (183:28): [True: 5.08M, False: 628k]
  ------------------
  184|  5.08M|                {
  185|  5.08M|                    pi2_tmp[k] =
  186|  5.08M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.43k, False: 5.07M]
  |  |  |  |  |  Branch (40:53): [True: 888, False: 5.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|  5.08M|                    pi2_tmp[k + 8] =
  188|  5.08M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  5.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.07k, False: 5.08M]
  |  |  |  |  |  Branch (40:53): [True: 779, False: 5.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|  5.08M|                }
  190|   628k|            }
  191|  1.48M|            pi2_src++;
  192|  1.48M|            pi2_tmp += trans_size;
  193|  1.48M|            zero_cols = zero_cols >> 1;
  194|  1.48M|        }
  195|       |
  196|   263k|        pi2_tmp = pi2_tmp_orig;
  197|       |
  198|       |        /* Inverse Transform 2nd stage */
  199|   263k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   263k|#define IT_SHIFT_STAGE_2 12
  ------------------
  200|   263k|        add = 1 << (shift - 1);
  201|   263k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (201:12): [True: 172k, False: 91.1k]
  ------------------
  202|   172k|        {
  203|  2.88M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (203:24): [True: 2.71M, False: 172k]
  ------------------
  204|  2.71M|            {
  205|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  206|  24.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (206:28): [True: 21.6M, False: 2.71M]
  ------------------
  207|  21.6M|                {
  208|  21.6M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  209|  21.6M|                                    + g_ai2_ihevc_trans_16[3][k]
  210|  21.6M|                                                    * pi2_tmp[3 * trans_size];
  211|  21.6M|                }
  212|  13.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (212:28): [True: 10.8M, False: 2.71M]
  ------------------
  213|  10.8M|                {
  214|  10.8M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  215|  10.8M|                }
  216|  2.71M|                eeo[0] = 0;
  217|  2.71M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  218|  2.71M|                eeo[1] = 0;
  219|  2.71M|                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|  8.12M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (222:28): [True: 5.41M, False: 2.71M]
  ------------------
  223|  5.41M|                {
  224|  5.41M|                    ee[k] = eee[k] + eeo[k];
  225|  5.41M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  226|  5.41M|                }
  227|  13.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (227:28): [True: 10.8M, False: 2.71M]
  ------------------
  228|  10.8M|                {
  229|  10.8M|                    e[k] = ee[k] + eo[k];
  230|  10.8M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  231|  10.8M|                }
  232|  24.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (232:28): [True: 21.6M, False: 2.71M]
  ------------------
  233|  21.6M|                {
  234|  21.6M|                    WORD32 itrans_out;
  235|  21.6M|                    itrans_out =
  236|  21.6M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  21.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  21.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 21.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 21.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  21.6M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  21.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  21.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 693k, False: 20.9M]
  |  |  |  |  |  Branch (40:53): [True: 832k, False: 20.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  21.6M|                    itrans_out =
  239|  21.6M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  21.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  21.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 21.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 21.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  21.6M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  21.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  21.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 664k, False: 20.9M]
  |  |  |  |  |  Branch (40:53): [True: 981k, False: 19.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  21.6M|                }
  242|  2.71M|                pi2_tmp++;
  243|  2.71M|                pu1_pred += pred_strd;
  244|  2.71M|                pu1_dst += dst_strd;
  245|  2.71M|            }
  246|   172k|        }
  247|  91.1k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (247:17): [True: 84.0k, False: 7.14k]
  ------------------
  248|  84.0k|        {
  249|  1.17M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (249:24): [True: 1.09M, False: 84.0k]
  ------------------
  250|  1.09M|            {
  251|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  252|  9.84M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (252:28): [True: 8.74M, False: 1.09M]
  ------------------
  253|  8.74M|                {
  254|  8.74M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  255|  8.74M|                                    + g_ai2_ihevc_trans_16[3][k]
  256|  8.74M|                                                    * pi2_tmp[3 * trans_size]
  257|  8.74M|                                    + g_ai2_ihevc_trans_16[5][k]
  258|  8.74M|                                                    * pi2_tmp[5 * trans_size]
  259|  8.74M|                                    + g_ai2_ihevc_trans_16[7][k]
  260|  8.74M|                                                    * pi2_tmp[7 * trans_size];
  261|  8.74M|                }
  262|  5.51M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (262:28): [True: 4.41M, False: 1.09M]
  ------------------
  263|  4.41M|                {
  264|  4.41M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  265|  4.41M|                                    + g_ai2_ihevc_trans_16[6][k]
  266|  4.41M|                                                    * pi2_tmp[6 * trans_size];
  267|  4.41M|                }
  268|  1.09M|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  269|  1.09M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  270|  1.09M|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  271|  1.09M|                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.31M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (274:28): [True: 2.22M, False: 1.09M]
  ------------------
  275|  2.22M|                {
  276|  2.22M|                    ee[k] = eee[k] + eeo[k];
  277|  2.22M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  278|  2.22M|                }
  279|  5.58M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (279:28): [True: 4.48M, False: 1.09M]
  ------------------
  280|  4.48M|                {
  281|  4.48M|                    e[k] = ee[k] + eo[k];
  282|  4.48M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  283|  4.48M|                }
  284|  9.65M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (284:28): [True: 8.55M, False: 1.09M]
  ------------------
  285|  8.55M|                {
  286|  8.55M|                    WORD32 itrans_out;
  287|  8.55M|                    itrans_out =
  288|  8.55M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  8.55M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.55M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|  8.55M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  8.55M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.05M, False: 6.50M]
  |  |  |  |  |  Branch (40:53): [True: 484k, False: 6.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|  8.55M|                    itrans_out =
  291|  8.55M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  8.55M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.55M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|  8.55M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  8.55M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.82M, False: 6.73M]
  |  |  |  |  |  Branch (40:53): [True: 451k, False: 6.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|  8.55M|                }
  294|  1.09M|                pi2_tmp++;
  295|  1.09M|                pu1_pred += pred_strd;
  296|  1.09M|                pu1_dst += dst_strd;
  297|  1.09M|            }
  298|  84.0k|        }
  299|  7.14k|        else /* All rows of output of 1st stage are non-zero */
  300|  7.14k|        {
  301|   152k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (301:24): [True: 145k, False: 7.14k]
  ------------------
  302|   145k|            {
  303|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  304|  1.30M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (304:28): [True: 1.15M, False: 145k]
  ------------------
  305|  1.15M|                {
  306|  1.15M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  307|  1.15M|                                    + g_ai2_ihevc_trans_16[3][k]
  308|  1.15M|                                                    * pi2_tmp[3 * trans_size]
  309|  1.15M|                                    + g_ai2_ihevc_trans_16[5][k]
  310|  1.15M|                                                    * pi2_tmp[5 * trans_size]
  311|  1.15M|                                    + g_ai2_ihevc_trans_16[7][k]
  312|  1.15M|                                                    * pi2_tmp[7 * trans_size]
  313|  1.15M|                                    + g_ai2_ihevc_trans_16[9][k]
  314|  1.15M|                                                    * pi2_tmp[9 * trans_size]
  315|  1.15M|                                    + g_ai2_ihevc_trans_16[11][k]
  316|  1.15M|                                                    * pi2_tmp[11 * trans_size]
  317|  1.15M|                                    + g_ai2_ihevc_trans_16[13][k]
  318|  1.15M|                                                    * pi2_tmp[13 * trans_size]
  319|  1.15M|                                    + g_ai2_ihevc_trans_16[15][k]
  320|  1.15M|                                                    * pi2_tmp[15 * trans_size];
  321|  1.15M|                }
  322|   728k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (322:28): [True: 583k, False: 145k]
  ------------------
  323|   583k|                {
  324|   583k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  325|   583k|                                    + g_ai2_ihevc_trans_16[6][k]
  326|   583k|                                                    * pi2_tmp[6 * trans_size]
  327|   583k|                                    + g_ai2_ihevc_trans_16[10][k]
  328|   583k|                                                    * pi2_tmp[10 * trans_size]
  329|   583k|                                    + g_ai2_ihevc_trans_16[14][k]
  330|   583k|                                                    * pi2_tmp[14 * trans_size];
  331|   583k|                }
  332|   145k|                eeo[0] =
  333|   145k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  334|   145k|                                                + g_ai2_ihevc_trans_16[12][0]
  335|   145k|                                                                * pi2_tmp[12
  336|   145k|                                                                                * trans_size];
  337|   145k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  338|   145k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  339|   145k|                eeo[1] =
  340|   145k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  341|   145k|                                                + g_ai2_ihevc_trans_16[12][1]
  342|   145k|                                                                * pi2_tmp[12
  343|   145k|                                                                                * trans_size];
  344|   145k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  345|   145k|                                + 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|   435k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (348:28): [True: 289k, False: 145k]
  ------------------
  349|   289k|                {
  350|   289k|                    ee[k] = eee[k] + eeo[k];
  351|   289k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  352|   289k|                }
  353|   725k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (353:28): [True: 580k, False: 145k]
  ------------------
  354|   580k|                {
  355|   580k|                    e[k] = ee[k] + eo[k];
  356|   580k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  357|   580k|                }
  358|  1.29M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (358:28): [True: 1.15M, False: 145k]
  ------------------
  359|  1.15M|                {
  360|  1.15M|                    WORD32 itrans_out;
  361|  1.15M|                    itrans_out =
  362|  1.15M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.15M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.15M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|  1.15M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  1.15M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 90.9k, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 149k, False: 913k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|  1.15M|                    itrans_out =
  365|  1.15M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.15M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.15M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  366|  1.15M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  1.15M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 78.8k, False: 1.07M]
  |  |  |  |  |  Branch (40:53): [True: 159k, False: 915k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|  1.15M|                }
  368|   145k|                pi2_tmp++;
  369|   145k|                pu1_pred += pred_strd;
  370|   145k|                pu1_dst += dst_strd;
  371|   145k|            }
  372|  7.14k|        }
  373|       |        /************************************************************************************************/
  374|       |        /************************************END - IT_RECON_16x16****************************************/
  375|       |        /************************************************************************************************/
  376|   263k|    }
  377|   279k|    else if((zero_rows & 0xFF00) == 0xFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (377:13): [True: 213k, False: 65.7k]
  ------------------
  378|   213k|    {
  379|       |        /************************************************************************************************/
  380|       |        /**********************************START - IT_RECON_16x16****************************************/
  381|       |        /************************************************************************************************/
  382|       |
  383|       |        /* Inverse Transform 1st stage */
  384|   213k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   213k|#define IT_SHIFT_STAGE_1 7
  ------------------
  385|   213k|        add = 1 << (shift - 1);
  386|       |
  387|  1.70M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (387:20): [True: 1.48M, False: 213k]
  ------------------
  388|  1.48M|        {
  389|       |            /* Checking for Zero Cols */
  390|  1.48M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (390:16): [True: 780k, False: 707k]
  ------------------
  391|   780k|            {
  392|   780k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  393|   780k|            }
  394|   707k|            else
  395|   707k|            {
  396|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  397|  6.49M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (397:28): [True: 5.78M, False: 707k]
  ------------------
  398|  5.78M|                {
  399|  5.78M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  400|  5.78M|                                    + g_ai2_ihevc_trans_16[3][k]
  401|  5.78M|                                                    * pi2_src[3 * src_strd]
  402|  5.78M|                                    + g_ai2_ihevc_trans_16[5][k]
  403|  5.78M|                                                    * pi2_src[5 * src_strd]
  404|  5.78M|                                    + g_ai2_ihevc_trans_16[7][k]
  405|  5.78M|                                                    * pi2_src[7 * src_strd];
  406|  5.78M|                }
  407|  3.62M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (407:28): [True: 2.91M, False: 707k]
  ------------------
  408|  2.91M|                {
  409|  2.91M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  410|  2.91M|                                    + g_ai2_ihevc_trans_16[6][k]
  411|  2.91M|                                                    * pi2_src[6 * src_strd];
  412|  2.91M|                }
  413|   707k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  414|   707k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  415|   707k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  416|   707k|                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|  2.16M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (419:28): [True: 1.45M, False: 707k]
  ------------------
  420|  1.45M|                {
  421|  1.45M|                    ee[k] = eee[k] + eeo[k];
  422|  1.45M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  423|  1.45M|                }
  424|  3.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (424:28): [True: 2.90M, False: 707k]
  ------------------
  425|  2.90M|                {
  426|  2.90M|                    e[k] = ee[k] + eo[k];
  427|  2.90M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  428|  2.90M|                }
  429|  6.51M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (429:28): [True: 5.81M, False: 707k]
  ------------------
  430|  5.81M|                {
  431|  5.81M|                    pi2_tmp[k] =
  432|  5.81M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.81M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.81M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.31k, False: 5.80M]
  |  |  |  |  |  Branch (40:53): [True: 2.35k, False: 5.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  5.81M|                    pi2_tmp[k + 8] =
  434|  5.81M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  5.81M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.81M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.87k, False: 5.81M]
  |  |  |  |  |  Branch (40:53): [True: 2.34k, False: 5.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  435|  5.81M|                }
  436|   707k|            }
  437|  1.48M|            pi2_src++;
  438|  1.48M|            pi2_tmp += trans_size;
  439|  1.48M|            zero_cols = zero_cols >> 1;
  440|  1.48M|        }
  441|       |
  442|   213k|        pi2_tmp = pi2_tmp_orig;
  443|       |
  444|       |        /* Inverse Transform 2nd stage */
  445|   213k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   213k|#define IT_SHIFT_STAGE_2 12
  ------------------
  446|   213k|        add = 1 << (shift - 1);
  447|   213k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (447:12): [True: 99.2k, False: 114k]
  ------------------
  448|  99.2k|        {
  449|  1.57M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (449:24): [True: 1.47M, False: 99.2k]
  ------------------
  450|  1.47M|            {
  451|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  452|  13.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (452:28): [True: 11.8M, False: 1.47M]
  ------------------
  453|  11.8M|                {
  454|  11.8M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  455|  11.8M|                                    + g_ai2_ihevc_trans_16[3][k]
  456|  11.8M|                                                    * pi2_tmp[3 * trans_size];
  457|  11.8M|                }
  458|  7.44M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (458:28): [True: 5.96M, False: 1.47M]
  ------------------
  459|  5.96M|                {
  460|  5.96M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  461|  5.96M|                }
  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.96M, False: 1.47M]
  ------------------
  469|  2.96M|                {
  470|  2.96M|                    ee[k] = eee[k] + eeo[k];
  471|  2.96M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  472|  2.96M|                }
  473|  7.43M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (473:28): [True: 5.95M, False: 1.47M]
  ------------------
  474|  5.95M|                {
  475|  5.95M|                    e[k] = ee[k] + eo[k];
  476|  5.95M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  477|  5.95M|                }
  478|  13.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (478:28): [True: 11.7M, False: 1.47M]
  ------------------
  479|  11.7M|                {
  480|  11.7M|                    WORD32 itrans_out;
  481|  11.7M|                    itrans_out =
  482|  11.7M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  11.7M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 11.7M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 11.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  11.7M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  11.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.79M, False: 9.90M]
  |  |  |  |  |  Branch (40:53): [True: 479k, False: 9.42M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|  11.7M|                    itrans_out =
  485|  11.7M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  11.7M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 11.7M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 11.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|  11.7M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  11.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.61M, False: 10.0M]
  |  |  |  |  |  Branch (40:53): [True: 519k, False: 9.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  11.7M|                }
  488|  1.47M|                pi2_tmp++;
  489|  1.47M|                pu1_pred += pred_strd;
  490|  1.47M|                pu1_dst += dst_strd;
  491|  1.47M|            }
  492|  99.2k|        }
  493|   114k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (493:17): [True: 93.1k, False: 21.0k]
  ------------------
  494|  93.1k|        {
  495|  1.34M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (495:24): [True: 1.25M, False: 93.1k]
  ------------------
  496|  1.25M|            {
  497|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  498|  11.2M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (498:28): [True: 10.0M, False: 1.25M]
  ------------------
  499|  10.0M|                {
  500|  10.0M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  501|  10.0M|                                    + g_ai2_ihevc_trans_16[3][k]
  502|  10.0M|                                                    * pi2_tmp[3 * trans_size]
  503|  10.0M|                                    + g_ai2_ihevc_trans_16[5][k]
  504|  10.0M|                                                    * pi2_tmp[5 * trans_size]
  505|  10.0M|                                    + g_ai2_ihevc_trans_16[7][k]
  506|  10.0M|                                                    * pi2_tmp[7 * trans_size];
  507|  10.0M|                }
  508|  6.32M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (508:28): [True: 5.07M, False: 1.25M]
  ------------------
  509|  5.07M|                {
  510|  5.07M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  511|  5.07M|                                    + g_ai2_ihevc_trans_16[6][k]
  512|  5.07M|                                                    * pi2_tmp[6 * trans_size];
  513|  5.07M|                }
  514|  1.25M|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  515|  1.25M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  516|  1.25M|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  517|  1.25M|                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.81M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (520:28): [True: 2.56M, False: 1.25M]
  ------------------
  521|  2.56M|                {
  522|  2.56M|                    ee[k] = eee[k] + eeo[k];
  523|  2.56M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  524|  2.56M|                }
  525|  6.28M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (525:28): [True: 5.03M, False: 1.25M]
  ------------------
  526|  5.03M|                {
  527|  5.03M|                    e[k] = ee[k] + eo[k];
  528|  5.03M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  529|  5.03M|                }
  530|  10.9M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (530:28): [True: 9.74M, False: 1.25M]
  ------------------
  531|  9.74M|                {
  532|  9.74M|                    WORD32 itrans_out;
  533|  9.74M|                    itrans_out =
  534|  9.74M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  9.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  9.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 9.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 9.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|  9.74M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  9.74M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.40M, False: 7.34M]
  |  |  |  |  |  Branch (40:53): [True: 378k, False: 6.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  536|  9.74M|                    itrans_out =
  537|  9.74M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  9.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  9.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 9.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 9.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  538|  9.74M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  9.74M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.25M, False: 7.48M]
  |  |  |  |  |  Branch (40:53): [True: 359k, False: 7.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  539|  9.74M|                }
  540|  1.25M|                pi2_tmp++;
  541|  1.25M|                pu1_pred += pred_strd;
  542|  1.25M|                pu1_dst += dst_strd;
  543|  1.25M|            }
  544|  93.1k|        }
  545|  21.0k|        else /* All rows of output of 1st stage are non-zero */
  546|  21.0k|        {
  547|   393k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (547:24): [True: 372k, False: 21.0k]
  ------------------
  548|   372k|            {
  549|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  550|  3.34M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (550:28): [True: 2.97M, False: 372k]
  ------------------
  551|  2.97M|                {
  552|  2.97M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  553|  2.97M|                                    + g_ai2_ihevc_trans_16[3][k]
  554|  2.97M|                                                    * pi2_tmp[3 * trans_size]
  555|  2.97M|                                    + g_ai2_ihevc_trans_16[5][k]
  556|  2.97M|                                                    * pi2_tmp[5 * trans_size]
  557|  2.97M|                                    + g_ai2_ihevc_trans_16[7][k]
  558|  2.97M|                                                    * pi2_tmp[7 * trans_size]
  559|  2.97M|                                    + g_ai2_ihevc_trans_16[9][k]
  560|  2.97M|                                                    * pi2_tmp[9 * trans_size]
  561|  2.97M|                                    + g_ai2_ihevc_trans_16[11][k]
  562|  2.97M|                                                    * pi2_tmp[11 * trans_size]
  563|  2.97M|                                    + g_ai2_ihevc_trans_16[13][k]
  564|  2.97M|                                                    * pi2_tmp[13 * trans_size]
  565|  2.97M|                                    + g_ai2_ihevc_trans_16[15][k]
  566|  2.97M|                                                    * pi2_tmp[15 * trans_size];
  567|  2.97M|                }
  568|  1.86M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (568:28): [True: 1.49M, False: 372k]
  ------------------
  569|  1.49M|                {
  570|  1.49M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  571|  1.49M|                                    + g_ai2_ihevc_trans_16[6][k]
  572|  1.49M|                                                    * pi2_tmp[6 * trans_size]
  573|  1.49M|                                    + g_ai2_ihevc_trans_16[10][k]
  574|  1.49M|                                                    * pi2_tmp[10 * trans_size]
  575|  1.49M|                                    + g_ai2_ihevc_trans_16[14][k]
  576|  1.49M|                                                    * pi2_tmp[14 * trans_size];
  577|  1.49M|                }
  578|   372k|                eeo[0] =
  579|   372k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  580|   372k|                                                + g_ai2_ihevc_trans_16[12][0]
  581|   372k|                                                                * pi2_tmp[12
  582|   372k|                                                                                * trans_size];
  583|   372k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  584|   372k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  585|   372k|                eeo[1] =
  586|   372k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  587|   372k|                                                + g_ai2_ihevc_trans_16[12][1]
  588|   372k|                                                                * pi2_tmp[12
  589|   372k|                                                                                * trans_size];
  590|   372k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  591|   372k|                                + 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|  1.11M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (594:28): [True: 746k, False: 372k]
  ------------------
  595|   746k|                {
  596|   746k|                    ee[k] = eee[k] + eeo[k];
  597|   746k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  598|   746k|                }
  599|  1.86M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (599:28): [True: 1.49M, False: 372k]
  ------------------
  600|  1.49M|                {
  601|  1.49M|                    e[k] = ee[k] + eo[k];
  602|  1.49M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  603|  1.49M|                }
  604|  3.33M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (604:28): [True: 2.96M, False: 372k]
  ------------------
  605|  2.96M|                {
  606|  2.96M|                    WORD32 itrans_out;
  607|  2.96M|                    itrans_out =
  608|  2.96M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.96M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.96M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  609|  2.96M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  2.96M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 375k, False: 2.58M]
  |  |  |  |  |  Branch (40:53): [True: 214k, False: 2.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|  2.96M|                    itrans_out =
  611|  2.96M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.96M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.96M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  612|  2.96M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  2.96M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 318k, False: 2.64M]
  |  |  |  |  |  Branch (40:53): [True: 215k, False: 2.42M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|  2.96M|                }
  614|   372k|                pi2_tmp++;
  615|   372k|                pu1_pred += pred_strd;
  616|   372k|                pu1_dst += dst_strd;
  617|   372k|            }
  618|  21.0k|        }
  619|       |        /************************************************************************************************/
  620|       |        /************************************END - IT_RECON_16x16****************************************/
  621|       |        /************************************************************************************************/
  622|   213k|    }
  623|  65.7k|    else /* All rows of input are non-zero */
  624|  65.7k|    {
  625|       |        /************************************************************************************************/
  626|       |        /**********************************START - IT_RECON_16x16****************************************/
  627|       |        /************************************************************************************************/
  628|       |
  629|       |        /* Inverse Transform 1st stage */
  630|  65.7k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  65.7k|#define IT_SHIFT_STAGE_1 7
  ------------------
  631|  65.7k|        add = 1 << (shift - 1);
  632|       |
  633|   584k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (633:20): [True: 518k, False: 65.7k]
  ------------------
  634|   518k|        {
  635|       |            /* Checking for Zero Cols */
  636|   518k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (636:16): [True: 346k, False: 172k]
  ------------------
  637|   346k|            {
  638|   346k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  639|   346k|            }
  640|   172k|            else
  641|   172k|            {
  642|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  643|  1.57M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (643:28): [True: 1.40M, False: 172k]
  ------------------
  644|  1.40M|                {
  645|  1.40M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  646|  1.40M|                                    + g_ai2_ihevc_trans_16[3][k]
  647|  1.40M|                                                    * pi2_src[3 * src_strd]
  648|  1.40M|                                    + g_ai2_ihevc_trans_16[5][k]
  649|  1.40M|                                                    * pi2_src[5 * src_strd]
  650|  1.40M|                                    + g_ai2_ihevc_trans_16[7][k]
  651|  1.40M|                                                    * pi2_src[7 * src_strd]
  652|  1.40M|                                    + g_ai2_ihevc_trans_16[9][k]
  653|  1.40M|                                                    * pi2_src[9 * src_strd]
  654|  1.40M|                                    + g_ai2_ihevc_trans_16[11][k]
  655|  1.40M|                                                    * pi2_src[11 * src_strd]
  656|  1.40M|                                    + g_ai2_ihevc_trans_16[13][k]
  657|  1.40M|                                                    * pi2_src[13 * src_strd]
  658|  1.40M|                                    + g_ai2_ihevc_trans_16[15][k]
  659|  1.40M|                                                    * pi2_src[15 * src_strd];
  660|  1.40M|                }
  661|   878k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (661:28): [True: 705k, False: 172k]
  ------------------
  662|   705k|                {
  663|   705k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  664|   705k|                                    + g_ai2_ihevc_trans_16[6][k]
  665|   705k|                                                    * pi2_src[6 * src_strd]
  666|   705k|                                    + g_ai2_ihevc_trans_16[10][k]
  667|   705k|                                                    * pi2_src[10 * src_strd]
  668|   705k|                                    + g_ai2_ihevc_trans_16[14][k]
  669|   705k|                                                    * pi2_src[14 * src_strd];
  670|   705k|                }
  671|   172k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  672|   172k|                                + g_ai2_ihevc_trans_16[12][0]
  673|   172k|                                                * pi2_src[12 * src_strd];
  674|   172k|                eee[0] =
  675|   172k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  676|   172k|                                                + g_ai2_ihevc_trans_16[8][0]
  677|   172k|                                                                * pi2_src[8
  678|   172k|                                                                                * src_strd];
  679|   172k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  680|   172k|                                + g_ai2_ihevc_trans_16[12][1]
  681|   172k|                                                * pi2_src[12 * src_strd];
  682|   172k|                eee[1] =
  683|   172k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  684|   172k|                                                + g_ai2_ihevc_trans_16[8][1]
  685|   172k|                                                                * pi2_src[8
  686|   172k|                                                                                * src_strd];
  687|       |
  688|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  689|   525k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (689:28): [True: 352k, False: 172k]
  ------------------
  690|   352k|                {
  691|   352k|                    ee[k] = eee[k] + eeo[k];
  692|   352k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  693|   352k|                }
  694|   877k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (694:28): [True: 705k, False: 172k]
  ------------------
  695|   705k|                {
  696|   705k|                    e[k] = ee[k] + eo[k];
  697|   705k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  698|   705k|                }
  699|  1.58M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (699:28): [True: 1.41M, False: 172k]
  ------------------
  700|  1.41M|                {
  701|  1.41M|                    pi2_tmp[k] =
  702|  1.41M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.41M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.30k, False: 1.40M]
  |  |  |  |  |  Branch (40:53): [True: 4.86k, False: 1.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  703|  1.41M|                    pi2_tmp[k + 8] =
  704|  1.41M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.41M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.61k, False: 1.40M]
  |  |  |  |  |  Branch (40:53): [True: 2.98k, False: 1.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|  1.41M|                }
  706|   172k|            }
  707|   518k|            pi2_src++;
  708|   518k|            pi2_tmp += trans_size;
  709|   518k|            zero_cols = zero_cols >> 1;
  710|   518k|        }
  711|       |
  712|  65.7k|        pi2_tmp = pi2_tmp_orig;
  713|       |
  714|       |        /* Inverse Transform 2nd stage */
  715|  65.7k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  65.7k|#define IT_SHIFT_STAGE_2 12
  ------------------
  716|  65.7k|        add = 1 << (shift - 1);
  717|  65.7k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (717:12): [True: 29.7k, False: 36.0k]
  ------------------
  718|  29.7k|        {
  719|   426k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (719:24): [True: 396k, False: 29.7k]
  ------------------
  720|   396k|            {
  721|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  722|  3.56M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (722:28): [True: 3.16M, False: 396k]
  ------------------
  723|  3.16M|                {
  724|  3.16M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  725|  3.16M|                                    + g_ai2_ihevc_trans_16[3][k]
  726|  3.16M|                                                    * pi2_tmp[3 * trans_size];
  727|  3.16M|                }
  728|  1.99M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (728:28): [True: 1.59M, False: 396k]
  ------------------
  729|  1.59M|                {
  730|  1.59M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  731|  1.59M|                }
  732|   396k|                eeo[0] = 0;
  733|   396k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  734|   396k|                eeo[1] = 0;
  735|   396k|                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.20M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (738:28): [True: 806k, False: 396k]
  ------------------
  739|   806k|                {
  740|   806k|                    ee[k] = eee[k] + eeo[k];
  741|   806k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  742|   806k|                }
  743|  1.99M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (743:28): [True: 1.59M, False: 396k]
  ------------------
  744|  1.59M|                {
  745|  1.59M|                    e[k] = ee[k] + eo[k];
  746|  1.59M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  747|  1.59M|                }
  748|  3.46M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (748:28): [True: 3.06M, False: 396k]
  ------------------
  749|  3.06M|                {
  750|  3.06M|                    WORD32 itrans_out;
  751|  3.06M|                    itrans_out =
  752|  3.06M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.06M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.06M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|  3.06M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  3.06M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 765k, False: 2.30M]
  |  |  |  |  |  Branch (40:53): [True: 277k, False: 2.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  754|  3.06M|                    itrans_out =
  755|  3.06M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.06M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.06M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  756|  3.06M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  3.06M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 799k, False: 2.26M]
  |  |  |  |  |  Branch (40:53): [True: 241k, False: 2.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|  3.06M|                }
  758|   396k|                pi2_tmp++;
  759|   396k|                pu1_pred += pred_strd;
  760|   396k|                pu1_dst += dst_strd;
  761|   396k|            }
  762|  29.7k|        }
  763|  36.0k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (763:17): [True: 27.5k, False: 8.51k]
  ------------------
  764|  27.5k|        {
  765|   436k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (765:24): [True: 408k, False: 27.5k]
  ------------------
  766|   408k|            {
  767|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  768|  3.66M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (768:28): [True: 3.25M, False: 408k]
  ------------------
  769|  3.25M|                {
  770|  3.25M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  771|  3.25M|                                    + g_ai2_ihevc_trans_16[3][k]
  772|  3.25M|                                                    * pi2_tmp[3 * trans_size]
  773|  3.25M|                                    + g_ai2_ihevc_trans_16[5][k]
  774|  3.25M|                                                    * pi2_tmp[5 * trans_size]
  775|  3.25M|                                    + g_ai2_ihevc_trans_16[7][k]
  776|  3.25M|                                                    * pi2_tmp[7 * trans_size];
  777|  3.25M|                }
  778|  2.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (778:28): [True: 1.64M, False: 408k]
  ------------------
  779|  1.64M|                {
  780|  1.64M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  781|  1.64M|                                    + g_ai2_ihevc_trans_16[6][k]
  782|  1.64M|                                                    * pi2_tmp[6 * trans_size];
  783|  1.64M|                }
  784|   408k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  785|   408k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  786|   408k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  787|   408k|                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|  1.23M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (790:28): [True: 824k, False: 408k]
  ------------------
  791|   824k|                {
  792|   824k|                    ee[k] = eee[k] + eeo[k];
  793|   824k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  794|   824k|                }
  795|  2.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (795:28): [True: 1.64M, False: 408k]
  ------------------
  796|  1.64M|                {
  797|  1.64M|                    e[k] = ee[k] + eo[k];
  798|  1.64M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  799|  1.64M|                }
  800|  3.63M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (800:28): [True: 3.23M, False: 408k]
  ------------------
  801|  3.23M|                {
  802|  3.23M|                    WORD32 itrans_out;
  803|  3.23M|                    itrans_out =
  804|  3.23M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.23M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.23M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|  3.23M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  3.23M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 394k, False: 2.83M]
  |  |  |  |  |  Branch (40:53): [True: 184k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  806|  3.23M|                    itrans_out =
  807|  3.23M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.23M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.23M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|  3.23M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  3.23M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 418k, False: 2.81M]
  |  |  |  |  |  Branch (40:53): [True: 171k, False: 2.64M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  809|  3.23M|                }
  810|   408k|                pi2_tmp++;
  811|   408k|                pu1_pred += pred_strd;
  812|   408k|                pu1_dst += dst_strd;
  813|   408k|            }
  814|  27.5k|        }
  815|  8.51k|        else /* All rows of output of 1st stage are non-zero */
  816|  8.51k|        {
  817|   190k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (817:24): [True: 182k, False: 8.51k]
  ------------------
  818|   182k|            {
  819|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  820|  1.63M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (820:28): [True: 1.45M, False: 182k]
  ------------------
  821|  1.45M|                {
  822|  1.45M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  823|  1.45M|                                    + g_ai2_ihevc_trans_16[3][k]
  824|  1.45M|                                                    * pi2_tmp[3 * trans_size]
  825|  1.45M|                                    + g_ai2_ihevc_trans_16[5][k]
  826|  1.45M|                                                    * pi2_tmp[5 * trans_size]
  827|  1.45M|                                    + g_ai2_ihevc_trans_16[7][k]
  828|  1.45M|                                                    * pi2_tmp[7 * trans_size]
  829|  1.45M|                                    + g_ai2_ihevc_trans_16[9][k]
  830|  1.45M|                                                    * pi2_tmp[9 * trans_size]
  831|  1.45M|                                    + g_ai2_ihevc_trans_16[11][k]
  832|  1.45M|                                                    * pi2_tmp[11 * trans_size]
  833|  1.45M|                                    + g_ai2_ihevc_trans_16[13][k]
  834|  1.45M|                                                    * pi2_tmp[13 * trans_size]
  835|  1.45M|                                    + g_ai2_ihevc_trans_16[15][k]
  836|  1.45M|                                                    * pi2_tmp[15 * trans_size];
  837|  1.45M|                }
  838|   911k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (838:28): [True: 729k, False: 182k]
  ------------------
  839|   729k|                {
  840|   729k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  841|   729k|                                    + g_ai2_ihevc_trans_16[6][k]
  842|   729k|                                                    * pi2_tmp[6 * trans_size]
  843|   729k|                                    + g_ai2_ihevc_trans_16[10][k]
  844|   729k|                                                    * pi2_tmp[10 * trans_size]
  845|   729k|                                    + g_ai2_ihevc_trans_16[14][k]
  846|   729k|                                                    * pi2_tmp[14 * trans_size];
  847|   729k|                }
  848|   182k|                eeo[0] =
  849|   182k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  850|   182k|                                                + g_ai2_ihevc_trans_16[12][0]
  851|   182k|                                                                * pi2_tmp[12
  852|   182k|                                                                                * trans_size];
  853|   182k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  854|   182k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  855|   182k|                eeo[1] =
  856|   182k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  857|   182k|                                                + g_ai2_ihevc_trans_16[12][1]
  858|   182k|                                                                * pi2_tmp[12
  859|   182k|                                                                                * trans_size];
  860|   182k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  861|   182k|                                + 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|   546k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (864:28): [True: 364k, False: 182k]
  ------------------
  865|   364k|                {
  866|   364k|                    ee[k] = eee[k] + eeo[k];
  867|   364k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  868|   364k|                }
  869|   910k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (869:28): [True: 728k, False: 182k]
  ------------------
  870|   728k|                {
  871|   728k|                    e[k] = ee[k] + eo[k];
  872|   728k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  873|   728k|                }
  874|  1.63M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (874:28): [True: 1.45M, False: 182k]
  ------------------
  875|  1.45M|                {
  876|  1.45M|                    WORD32 itrans_out;
  877|  1.45M|                    itrans_out =
  878|  1.45M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.45M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.45M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.45M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.45M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  879|  1.45M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  1.45M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.45M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 287k, False: 1.16M]
  |  |  |  |  |  Branch (40:53): [True: 293k, False: 869k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  880|  1.45M|                    itrans_out =
  881|  1.45M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.45M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.45M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.45M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.45M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  882|  1.45M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  1.45M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.45M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 287k, False: 1.16M]
  |  |  |  |  |  Branch (40:53): [True: 284k, False: 878k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  883|  1.45M|                }
  884|   182k|                pi2_tmp++;
  885|   182k|                pu1_pred += pred_strd;
  886|   182k|                pu1_dst += dst_strd;
  887|   182k|            }
  888|  8.51k|        }
  889|       |        /************************************************************************************************/
  890|       |        /************************************END - IT_RECON_16x16****************************************/
  891|       |        /************************************************************************************************/
  892|  65.7k|    }
  893|   542k|}

ihevc_chroma_itrans_recon_8x8:
  115|   196k|{
  116|   196k|    WORD32 j, k;
  117|   196k|    WORD32 e[4], o[4];
  118|   196k|    WORD32 ee[2], eo[2];
  119|   196k|    WORD32 add;
  120|   196k|    WORD32 shift;
  121|   196k|    WORD16 *pi2_tmp_orig;
  122|   196k|    WORD32 trans_size;
  123|   196k|    WORD32 zero_rows_2nd_stage = zero_cols;
  124|   196k|    WORD32 row_limit_2nd_stage;
  125|   196k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   196k|#define UNUSED(x) ((void)(x))
  ------------------
  126|   196k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   196k|#define TRANS_SIZE_8   8
  ------------------
  127|       |
  128|   196k|    pi2_tmp_orig = pi2_tmp;
  129|       |
  130|   196k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (130:8): [True: 180k, False: 16.1k]
  ------------------
  131|   180k|        row_limit_2nd_stage = 4;
  132|  16.1k|    else
  133|  16.1k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  16.1k|#define TRANS_SIZE_8   8
  ------------------
  134|       |
  135|       |    /* Inverse Transform 1st stage */
  136|   196k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   196k|#define IT_SHIFT_STAGE_1 7
  ------------------
  137|   196k|    add = 1 << (shift - 1);
  138|   196k|    {
  139|       |        /************************************************************************************************/
  140|       |        /**********************************START - IT_RECON_8x8******************************************/
  141|       |        /************************************************************************************************/
  142|       |
  143|  1.04M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (143:20): [True: 848k, False: 196k]
  ------------------
  144|   848k|        {
  145|       |            /* Checking for Zero Cols */
  146|   848k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (146:16): [True: 503k, False: 345k]
  ------------------
  147|   503k|            {
  148|   503k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  149|   503k|            }
  150|   345k|            else
  151|   345k|            {
  152|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  153|  1.73M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (153:28): [True: 1.38M, False: 345k]
  ------------------
  154|  1.38M|                {
  155|  1.38M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  156|  1.38M|                                    + g_ai2_ihevc_trans_8[3][k]
  157|  1.38M|                                                    * pi2_src[3 * src_strd]
  158|  1.38M|                                    + g_ai2_ihevc_trans_8[5][k]
  159|  1.38M|                                                    * pi2_src[5 * src_strd]
  160|  1.38M|                                    + g_ai2_ihevc_trans_8[7][k]
  161|  1.38M|                                                    * pi2_src[7 * src_strd];
  162|  1.38M|                }
  163|       |
  164|   345k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  165|   345k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  166|   345k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  167|   345k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  168|   345k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  169|   345k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  170|   345k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  171|   345k|                                + 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|   345k|                e[0] = ee[0] + eo[0];
  175|   345k|                e[3] = ee[0] - eo[0];
  176|   345k|                e[1] = ee[1] + eo[1];
  177|   345k|                e[2] = ee[1] - eo[1];
  178|  1.73M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (178:28): [True: 1.38M, False: 345k]
  ------------------
  179|  1.38M|                {
  180|  1.38M|                    pi2_tmp[k] =
  181|  1.38M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.38M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.38M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.46k, False: 1.38M]
  |  |  |  |  |  Branch (40:53): [True: 4.09k, False: 1.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.38M|                    pi2_tmp[k + 4] =
  183|  1.38M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  1.38M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.38M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.95k, False: 1.38M]
  |  |  |  |  |  Branch (40:53): [True: 2.97k, False: 1.38M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  184|  1.38M|                }
  185|   345k|            }
  186|   848k|            pi2_src++;
  187|   848k|            pi2_tmp += trans_size;
  188|   848k|            zero_cols = zero_cols >> 1;
  189|   848k|        }
  190|       |
  191|   196k|        pi2_tmp = pi2_tmp_orig;
  192|       |
  193|       |        /* Inverse Transform 2nd stage */
  194|   196k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   196k|#define IT_SHIFT_STAGE_2 12
  ------------------
  195|   196k|        add = 1 << (shift - 1);
  196|       |
  197|   196k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (197:12): [True: 180k, False: 15.7k]
  ------------------
  198|   180k|        {
  199|  1.61M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (199:24): [True: 1.43M, False: 180k]
  ------------------
  200|  1.43M|            {
  201|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  202|  7.17M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (202:28): [True: 5.74M, False: 1.43M]
  ------------------
  203|  5.74M|                {
  204|  5.74M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  205|  5.74M|                                    + g_ai2_ihevc_trans_8[3][k]
  206|  5.74M|                                                    * pi2_tmp[3 * trans_size];
  207|  5.74M|                }
  208|  1.43M|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  209|  1.43M|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  210|  1.43M|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  211|  1.43M|                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.43M|                e[0] = ee[0] + eo[0];
  215|  1.43M|                e[3] = ee[0] - eo[0];
  216|  1.43M|                e[1] = ee[1] + eo[1];
  217|  1.43M|                e[2] = ee[1] - eo[1];
  218|  7.17M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (218:28): [True: 5.73M, False: 1.43M]
  ------------------
  219|  5.73M|                {
  220|  5.73M|                    WORD32 itrans_out;
  221|  5.73M|                    itrans_out =
  222|  5.73M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.73M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.73M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.73M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|  5.73M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  5.73M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.73M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 735k, False: 5.00M]
  |  |  |  |  |  Branch (40:53): [True: 444k, False: 4.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  5.73M|                    itrans_out =
  225|  5.73M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  5.73M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.73M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.73M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  5.73M|                    pu1_dst[(k + 4) * 2] =
  227|  5.73M|                                    CLIP_U8((itrans_out + pu1_pred[(k + 4) * 2]));
  ------------------
  |  |   40|  5.73M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.73M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 729k, False: 5.00M]
  |  |  |  |  |  Branch (40:53): [True: 461k, False: 4.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  5.73M|                }
  229|  1.43M|                pi2_tmp++;
  230|  1.43M|                pu1_pred += pred_strd;
  231|  1.43M|                pu1_dst += dst_strd;
  232|  1.43M|            }
  233|   180k|        }
  234|  15.7k|        else /* All rows of output of 1st stage are non-zero */
  235|  15.7k|        {
  236|   144k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (236:24): [True: 128k, False: 15.7k]
  ------------------
  237|   128k|            {
  238|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  239|   644k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (239:28): [True: 515k, False: 128k]
  ------------------
  240|   515k|                {
  241|   515k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  242|   515k|                                    + g_ai2_ihevc_trans_8[3][k]
  243|   515k|                                                    * pi2_tmp[3 * trans_size]
  244|   515k|                                    + g_ai2_ihevc_trans_8[5][k]
  245|   515k|                                                    * pi2_tmp[5 * trans_size]
  246|   515k|                                    + g_ai2_ihevc_trans_8[7][k]
  247|   515k|                                                    * pi2_tmp[7 * trans_size];
  248|   515k|                }
  249|       |
  250|   128k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  251|   128k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  252|   128k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  253|   128k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  254|   128k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  255|   128k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  256|   128k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  257|   128k|                                + 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|   128k|                e[0] = ee[0] + eo[0];
  261|   128k|                e[3] = ee[0] - eo[0];
  262|   128k|                e[1] = ee[1] + eo[1];
  263|   128k|                e[2] = ee[1] - eo[1];
  264|   643k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (264:28): [True: 515k, False: 128k]
  ------------------
  265|   515k|                {
  266|   515k|                    WORD32 itrans_out;
  267|   515k|                    itrans_out =
  268|   515k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   515k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   515k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 515k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 515k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|   515k|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|   515k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   515k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 53.7k, False: 461k]
  |  |  |  |  |  Branch (40:53): [True: 71.1k, False: 390k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|   515k|                    itrans_out =
  271|   515k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   515k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   515k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 515k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 515k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|   515k|                    pu1_dst[(k + 4) * 2] =
  273|   515k|                                    CLIP_U8((itrans_out + pu1_pred[(k + 4) * 2]));
  ------------------
  |  |   40|   515k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   515k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 50.4k, False: 464k]
  |  |  |  |  |  Branch (40:53): [True: 72.4k, False: 392k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|   515k|                }
  275|   128k|                pi2_tmp++;
  276|   128k|                pu1_pred += pred_strd;
  277|   128k|                pu1_dst += dst_strd;
  278|   128k|            }
  279|  15.7k|        }
  280|       |        /************************************************************************************************/
  281|       |        /************************************END - IT_RECON_8x8******************************************/
  282|       |        /************************************************************************************************/
  283|   196k|    }
  284|   196k|}

ihevc_chroma_recon_4x4:
  109|   364k|{
  110|   364k|    WORD32 i, j;
  111|   364k|    WORD32 trans_size;
  112|       |
  113|   364k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   364k|#define TRANS_SIZE_4   4
  ------------------
  114|       |
  115|       |    /* Reconstruction */
  116|       |
  117|  1.82M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (117:16): [True: 1.45M, False: 364k]
  ------------------
  118|  1.45M|    {
  119|       |        /* Checking for Zero Cols */
  120|  1.45M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (120:12): [True: 882k, False: 574k]
  ------------------
  121|   882k|        {
  122|  4.41M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (122:24): [True: 3.52M, False: 882k]
  ------------------
  123|  3.52M|            {
  124|  3.52M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  125|  3.52M|            }
  126|   882k|        }
  127|   574k|        else
  128|   574k|        {
  129|  2.87M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (129:24): [True: 2.30M, False: 574k]
  ------------------
  130|  2.30M|            {
  131|  2.30M|                pu1_dst[j * dst_strd] =
  132|  2.30M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  2.30M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.30M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 167k, False: 2.13M]
  |  |  |  |  |  Branch (40:53): [True: 177k, False: 1.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|  2.30M|            }
  134|   574k|        }
  135|  1.45M|        pi2_src++;
  136|  1.45M|        pu1_dst += 2;
  137|  1.45M|        pu1_pred += 2;
  138|  1.45M|        zero_cols = zero_cols >> 1;
  139|  1.45M|    }
  140|   364k|}
ihevc_chroma_recon_8x8:
  192|  6.56k|{
  193|  6.56k|    WORD32 i, j;
  194|  6.56k|    WORD32 trans_size;
  195|       |
  196|  6.56k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  6.56k|#define TRANS_SIZE_8   8
  ------------------
  197|       |
  198|       |    /* Reconstruction */
  199|       |
  200|  58.9k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (200:16): [True: 52.3k, False: 6.56k]
  ------------------
  201|  52.3k|    {
  202|       |        /* Checking for Zero Cols */
  203|  52.3k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (203:12): [True: 39.1k, False: 13.2k]
  ------------------
  204|  39.1k|        {
  205|   352k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (205:24): [True: 313k, False: 39.1k]
  ------------------
  206|   313k|            {
  207|   313k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  208|   313k|            }
  209|  39.1k|        }
  210|  13.2k|        else
  211|  13.2k|        {
  212|   119k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (212:24): [True: 106k, False: 13.2k]
  ------------------
  213|   106k|            {
  214|   106k|                pu1_dst[j * dst_strd] =
  215|   106k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|   106k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   106k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 448, False: 105k]
  |  |  |  |  |  Branch (40:53): [True: 1.65k, False: 104k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|   106k|            }
  217|  13.2k|        }
  218|  52.3k|        pi2_src++;
  219|  52.3k|        pu1_dst += 2;
  220|  52.3k|        pu1_pred += 2;
  221|  52.3k|        zero_cols = zero_cols >> 1;
  222|  52.3k|    }
  223|  6.56k|}
ihevc_chroma_recon_16x16:
  275|  5.07k|{
  276|  5.07k|    WORD32 i, j;
  277|  5.07k|    WORD32 trans_size;
  278|       |
  279|  5.07k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  5.07k|#define TRANS_SIZE_16 16
  ------------------
  280|       |
  281|       |    /* Reconstruction */
  282|       |
  283|  86.1k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (283:16): [True: 81.1k, False: 5.07k]
  ------------------
  284|  81.1k|    {
  285|       |        /* Checking for Zero Cols */
  286|  81.1k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (286:12): [True: 69.3k, False: 11.7k]
  ------------------
  287|  69.3k|        {
  288|  1.17M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (288:24): [True: 1.11M, False: 69.3k]
  ------------------
  289|  1.11M|            {
  290|  1.11M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  291|  1.11M|            }
  292|  69.3k|        }
  293|  11.7k|        else
  294|  11.7k|        {
  295|   199k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (295:24): [True: 187k, False: 11.7k]
  ------------------
  296|   187k|            {
  297|   187k|                pu1_dst[j * dst_strd] =
  298|   187k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|   187k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   187k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.66k, False: 185k]
  |  |  |  |  |  Branch (40:53): [True: 2.23k, False: 182k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  299|   187k|            }
  300|  11.7k|        }
  301|  81.1k|        pi2_src++;
  302|  81.1k|        pu1_dst += 2;
  303|  81.1k|        pu1_pred += 2;
  304|  81.1k|        zero_cols = zero_cols >> 1;
  305|  81.1k|    }
  306|  5.07k|}
ihevc_chroma_recon_nxn_ccp:
  446|   350k|{
  447|   350k|    WORD32 i, j;
  448|       |
  449|  2.67M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (449:16): [True: 2.32M, False: 350k]
  ------------------
  450|  2.32M|    {
  451|  21.7M|        for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (451:20): [True: 19.4M, False: 2.32M]
  ------------------
  452|  19.4M|        {
  453|  19.4M|            WORD32 res = (alpha * pi2_luma_res[j]) >> 3;
  454|  19.4M|            pu1_dst[j * 2] = CLIP_U8(pu1_pred[j * 2] + (pi2_chroma_res[j] + res));
  ------------------
  |  |   40|  19.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  19.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 310k, False: 19.1M]
  |  |  |  |  |  Branch (40:53): [True: 369k, False: 18.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  455|  19.4M|        }
  456|  2.32M|        pi2_luma_res += luma_res_stride;
  457|  2.32M|        pi2_chroma_res += chroma_res_stride;
  458|  2.32M|        pu1_dst += dst_stride;
  459|  2.32M|        pu1_pred += pred_stride;
  460|  2.32M|    }
  461|   350k|}

ihevc_deblk_luma_vert:
  107|  20.9M|{
  108|  20.9M|    WORD32 qp_luma, beta_indx, tc_indx;
  109|  20.9M|    WORD32 beta, tc;
  110|  20.9M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  111|  20.9M|    WORD32 d_sam0, d_sam3;
  112|  20.9M|    WORD32 de, dep, deq;
  113|  20.9M|    WORD32 row;
  114|  20.9M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  115|  20.9M|    WORD32 delta, delta_p, delta_q;
  116|       |
  117|  20.9M|    ASSERT((bs > 0) && (bs <= 3));
  ------------------
  |  |   55|  20.9M|#define ASSERT(x) {}
  ------------------
  118|  20.9M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  20.9M|#define ASSERT(x) {}
  ------------------
  119|       |
  120|  20.9M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  121|  20.9M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  20.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 63.3k, False: 20.8M]
  |  |  |  Branch (40:53): [True: 1.39k, False: 20.8M]
  |  |  ------------------
  ------------------
  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|  20.9M|    tc_indx = CLIP3(qp_luma + (2 * (bs >> 1)) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  20.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.78k, False: 20.9M]
  |  |  |  Branch (40:53): [True: 1.79k, False: 20.9M]
  |  |  ------------------
  ------------------
  129|       |
  130|  20.9M|    beta = gai4_ihevc_beta_table[beta_indx];
  131|  20.9M|    tc = gai4_ihevc_tc_table[tc_indx];
  132|  20.9M|    if(0 == tc)
  ------------------
  |  Branch (132:8): [True: 1.10M, False: 19.8M]
  ------------------
  133|  1.10M|    {
  134|  1.10M|        return;
  135|  1.10M|    }
  136|       |
  137|  19.8M|    dq0 = ABS(pu1_src[2] - 2 * pu1_src[1] + pu1_src[0]);
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.47M, False: 18.3M]
  |  |  ------------------
  ------------------
  138|  19.8M|    dq3 = ABS(pu1_src[3 * src_strd + 2] - 2 * pu1_src[3 * src_strd + 1]
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.42M, False: 18.3M]
  |  |  ------------------
  ------------------
  139|  19.8M|                    + pu1_src[3 * src_strd + 0]);
  140|  19.8M|    dp0 = ABS(pu1_src[-3] - 2 * pu1_src[-2] + pu1_src[-1]);
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.43M, False: 18.3M]
  |  |  ------------------
  ------------------
  141|  19.8M|    dp3 = ABS(pu1_src[3 * src_strd - 3] - 2 * pu1_src[3 * src_strd - 2]
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.40M, False: 18.4M]
  |  |  ------------------
  ------------------
  142|  19.8M|                    + pu1_src[3 * src_strd - 1]);
  143|       |
  144|  19.8M|    d0 = dp0 + dq0;
  145|  19.8M|    d3 = dp3 + dq3;
  146|       |
  147|  19.8M|    dp = dp0 + dp3;
  148|  19.8M|    dq = dq0 + dq3;
  149|       |
  150|  19.8M|    d = d0 + d3;
  151|       |
  152|  19.8M|    de = 0;
  153|  19.8M|    dep = 0;
  154|  19.8M|    deq = 0;
  155|       |
  156|  19.8M|    if(d < beta)
  ------------------
  |  Branch (156:8): [True: 18.3M, False: 1.50M]
  ------------------
  157|  18.3M|    {
  158|  18.3M|        d_sam0 = 0;
  159|  18.3M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (159:12): [True: 17.5M, False: 781k]
  ------------------
  160|  17.5M|                        && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  17.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 667k, False: 16.8M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  17.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 953k, False: 16.5M]
  |  |  ------------------
  ------------------
  |  Branch (160:28): [True: 16.4M, False: 1.05M]
  ------------------
  161|  17.5M|                                        < (beta >> 3))
  162|  16.4M|                        && ABS(pu1_src[0] - pu1_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  16.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 624k, False: 15.8M]
  |  |  ------------------
  ------------------
  |  Branch (162:28): [True: 16.3M, False: 181k]
  ------------------
  163|  16.3M|        {
  164|  16.3M|            d_sam0 = 1;
  165|  16.3M|        }
  166|       |
  167|  18.3M|        pu1_src += 3 * src_strd;
  168|  18.3M|        d_sam3 = 0;
  169|  18.3M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (169:12): [True: 17.6M, False: 695k]
  ------------------
  170|  17.6M|                        && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  17.6M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 682k, False: 16.9M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  17.6M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 956k, False: 16.6M]
  |  |  ------------------
  ------------------
  |  Branch (170:28): [True: 16.5M, False: 1.08M]
  ------------------
  171|  17.6M|                                        < (beta >> 3))
  172|  16.5M|                        && ABS(pu1_src[0] - pu1_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  16.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 622k, False: 15.9M]
  |  |  ------------------
  ------------------
  |  Branch (172:28): [True: 16.4M, False: 140k]
  ------------------
  173|  16.7M|        {
  174|  16.7M|            d_sam3 = 1;
  175|  16.7M|        }
  176|  18.3M|        pu1_src -= 3 * src_strd;
  177|       |
  178|  18.3M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (178:15): [True: 16.6M, False: 1.63M]
  |  Branch (178:30): [True: 16.4M, False: 209k]
  ------------------
  179|  18.3M|        dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (179:15): [True: 18.2M, False: 77.5k]
  ------------------
  180|  18.3M|        deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (180:15): [True: 18.1M, False: 137k]
  ------------------
  181|  18.3M|        if(tc <= 1)
  ------------------
  |  Branch (181:12): [True: 933k, False: 17.3M]
  ------------------
  182|   933k|        {
  183|   933k|            dep = 0;
  184|   933k|            deq = 0;
  185|   933k|        }
  186|  18.3M|    }
  187|       |
  188|  19.8M|    if(de != 0)
  ------------------
  |  Branch (188:8): [True: 18.7M, False: 1.11M]
  ------------------
  189|  18.7M|    {
  190|  89.3M|        for(row = 0; row < 4; row++)
  ------------------
  |  Branch (190:22): [True: 70.6M, False: 18.7M]
  ------------------
  191|  70.6M|        {
  192|  70.6M|            tmp_p0 = pu1_src[-1];
  193|  70.6M|            tmp_p1 = pu1_src[-2];
  194|  70.6M|            tmp_p2 = pu1_src[-3];
  195|       |
  196|  70.6M|            tmp_q0 = pu1_src[0];
  197|  70.6M|            tmp_q1 = pu1_src[1];
  198|  70.6M|            tmp_q2 = pu1_src[2];
  199|       |
  200|  70.6M|            if(de == 2)
  ------------------
  |  Branch (200:16): [True: 61.8M, False: 8.81M]
  ------------------
  201|  61.8M|            {
  202|  61.8M|                tmp_q0 = CLIP3((pu1_src[2] + 2 * pu1_src[1] +
  ------------------
  |  |   40|  61.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.95k, False: 61.8M]
  |  |  |  Branch (40:53): [True: 8.55k, False: 61.8M]
  |  |  ------------------
  ------------------
  203|  61.8M|                                2 * pu1_src[0] + 2 * pu1_src[-1] +
  204|  61.8M|                                pu1_src[-2] + 4) >> 3,
  205|  61.8M|                                pu1_src[0] - 2 * tc,
  206|  61.8M|                                pu1_src[0] + 2 * tc);
  207|       |
  208|  61.8M|                tmp_q1 = CLIP3((pu1_src[2] + pu1_src[1] + pu1_src[0] +
  ------------------
  |  |   40|  61.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.18k, False: 61.8M]
  |  |  |  Branch (40:53): [True: 6.86k, False: 61.8M]
  |  |  ------------------
  ------------------
  209|  61.8M|                                pu1_src[-1] + 2) >> 2,
  210|  61.8M|                                pu1_src[1] - 2 * tc,
  211|  61.8M|                                pu1_src[1] + 2 * tc);
  212|       |
  213|  61.8M|                tmp_q2 = CLIP3((2 * pu1_src[3] + 3 * pu1_src[2] +
  ------------------
  |  |   40|  61.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.42k, False: 61.8M]
  |  |  |  Branch (40:53): [True: 4.42k, False: 61.8M]
  |  |  ------------------
  ------------------
  214|  61.8M|                                pu1_src[1] + pu1_src[0] +
  215|  61.8M|                                pu1_src[-1] + 4) >> 3,
  216|  61.8M|                                pu1_src[2] - 2 * tc,
  217|  61.8M|                                pu1_src[2] + 2 * tc);
  218|       |
  219|  61.8M|                tmp_p0 = CLIP3((pu1_src[1] + 2 * pu1_src[0] +
  ------------------
  |  |   40|  61.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 7.74k, False: 61.8M]
  |  |  |  Branch (40:53): [True: 6.80k, False: 61.8M]
  |  |  ------------------
  ------------------
  220|  61.8M|                                2 * pu1_src[-1] + 2 * pu1_src[-2] +
  221|  61.8M|                                pu1_src[-3] + 4) >> 3,
  222|  61.8M|                                pu1_src[-1] - 2 * tc,
  223|  61.8M|                                pu1_src[-1] + 2 * tc);
  224|       |
  225|  61.8M|                tmp_p1 = CLIP3((pu1_src[0] + pu1_src[-1] +
  ------------------
  |  |   40|  61.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.18k, False: 61.8M]
  |  |  |  Branch (40:53): [True: 6.52k, False: 61.8M]
  |  |  ------------------
  ------------------
  226|  61.8M|                                pu1_src[-2] + pu1_src[-3] + 2) >> 2,
  227|  61.8M|                                pu1_src[-2] - 2 * tc,
  228|  61.8M|                                pu1_src[-2] + 2 * tc);
  229|       |
  230|  61.8M|                tmp_p2 = CLIP3((pu1_src[0] + pu1_src[-1] +
  ------------------
  |  |   40|  61.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.80k, False: 61.8M]
  |  |  |  Branch (40:53): [True: 3.75k, False: 61.8M]
  |  |  ------------------
  ------------------
  231|  61.8M|                                pu1_src[-2] + 3 * pu1_src[-3] +
  232|  61.8M|                                2 * pu1_src[-4] + 4) >> 3,
  233|  61.8M|                                pu1_src[-3] - 2 * tc,
  234|  61.8M|                                pu1_src[-3] + 2 * tc);
  235|  61.8M|            }
  236|  8.81M|            else
  237|  8.81M|            {
  238|  8.81M|                delta = (9 * (pu1_src[0] - pu1_src[-1]) -
  239|  8.81M|                                3 * (pu1_src[1] - pu1_src[-2]) + 8) >> 4;
  240|  8.81M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  8.81M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.51M, False: 5.30M]
  |  |  ------------------
  ------------------
  |  Branch (240:20): [True: 9.44M, False: 18.4E]
  ------------------
  241|  9.44M|                {
  242|  9.44M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  9.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 878k, False: 8.56M]
  |  |  |  Branch (40:53): [True: 812k, False: 7.75M]
  |  |  ------------------
  ------------------
  243|       |
  244|  9.44M|                    tmp_p0 = CLIP_U8(pu1_src[-1] + delta);
  ------------------
  |  |   40|  9.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 44.9k, False: 9.40M]
  |  |  |  |  |  Branch (40:53): [True: 20.5k, False: 9.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  9.44M|                    tmp_q0 = CLIP_U8(pu1_src[0] - delta);
  ------------------
  |  |   40|  9.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 234k, False: 9.21M]
  |  |  |  |  |  Branch (40:53): [True: 18.2k, False: 9.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|       |
  247|  9.44M|                    if(dep == 1)
  ------------------
  |  Branch (247:24): [True: 6.69M, False: 2.75M]
  ------------------
  248|  6.69M|                    {
  249|  6.69M|                        delta_p = CLIP3((((pu1_src[-3] + pu1_src[-1] + 1) >> 1)
  ------------------
  |  |   40|  6.69M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 82.8k, False: 6.60M]
  |  |  |  Branch (40:53): [True: 201k, False: 6.40M]
  |  |  ------------------
  ------------------
  250|  6.69M|                                        - pu1_src[-2] + delta) >> 1,
  251|  6.69M|                                        -(tc >> 1),
  252|  6.69M|                                        (tc >> 1));
  253|  6.69M|                        tmp_p1 = CLIP_U8(pu1_src[-2] + delta_p);
  ------------------
  |  |   40|  6.69M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.69M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 18.4k, False: 6.67M]
  |  |  |  |  |  Branch (40:53): [True: 16.2k, False: 6.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  6.69M|                    }
  255|       |
  256|  9.44M|                    if(deq == 1)
  ------------------
  |  Branch (256:24): [True: 6.43M, False: 3.01M]
  ------------------
  257|  6.43M|                    {
  258|  6.43M|                        delta_q = CLIP3((((pu1_src[2] + pu1_src[0] + 1) >> 1)
  ------------------
  |  |   40|  6.43M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 77.3k, False: 6.35M]
  |  |  |  Branch (40:53): [True: 198k, False: 6.15M]
  |  |  ------------------
  ------------------
  259|  6.43M|                                        - pu1_src[1] - delta) >> 1,
  260|  6.43M|                                        -(tc >> 1),
  261|  6.43M|                                        (tc >> 1));
  262|  6.43M|                        tmp_q1 = CLIP_U8(pu1_src[1] + delta_q);
  ------------------
  |  |   40|  6.43M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.43M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 167k, False: 6.26M]
  |  |  |  |  |  Branch (40:53): [True: 13.8k, False: 6.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|  6.43M|                    }
  264|  9.44M|                }
  265|  8.81M|            }
  266|       |
  267|  70.6M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (267:16): [True: 70.2M, False: 367k]
  ------------------
  268|  70.2M|            {
  269|  70.2M|                pu1_src[-3] = tmp_p2;
  270|  70.2M|                pu1_src[-2] = tmp_p1;
  271|  70.2M|                pu1_src[-1] = tmp_p0;
  272|  70.2M|            }
  273|       |
  274|  70.6M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (274:16): [True: 70.3M, False: 318k]
  ------------------
  275|  70.3M|            {
  276|  70.3M|                pu1_src[0] = tmp_q0;
  277|  70.3M|                pu1_src[1] = tmp_q1;
  278|  70.3M|                pu1_src[2] = tmp_q2;
  279|  70.3M|            }
  280|       |
  281|  70.6M|            pu1_src += src_strd;
  282|  70.6M|        }
  283|  18.7M|    }
  284|       |
  285|  19.8M|}
ihevc_deblk_luma_horz:
  344|  21.7M|{
  345|  21.7M|    WORD32 qp_luma, beta_indx, tc_indx;
  346|  21.7M|    WORD32 beta, tc;
  347|  21.7M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  348|  21.7M|    WORD32 d_sam0, d_sam3;
  349|  21.7M|    WORD32 de, dep, deq;
  350|  21.7M|    WORD32 col;
  351|  21.7M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  352|  21.7M|    WORD32 delta, delta_p, delta_q;
  353|       |
  354|  21.7M|    ASSERT((bs > 0));
  ------------------
  |  |   55|  21.7M|#define ASSERT(x) {}
  ------------------
  355|  21.7M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  21.7M|#define ASSERT(x) {}
  ------------------
  356|       |
  357|  21.7M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  358|  21.7M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  21.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 16.9k, False: 21.7M]
  |  |  |  Branch (40:53): [True: 1.42k, False: 21.7M]
  |  |  ------------------
  ------------------
  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|  21.7M|    tc_indx = CLIP3(qp_luma + 2 * (bs >> 1) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  21.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.09k, False: 21.7M]
  |  |  |  Branch (40:53): [True: 1.87k, False: 21.7M]
  |  |  ------------------
  ------------------
  366|       |
  367|  21.7M|    beta = gai4_ihevc_beta_table[beta_indx];
  368|  21.7M|    tc = gai4_ihevc_tc_table[tc_indx];
  369|  21.7M|    if(0 == tc)
  ------------------
  |  Branch (369:8): [True: 1.37M, False: 20.3M]
  ------------------
  370|  1.37M|    {
  371|  1.37M|        return;
  372|  1.37M|    }
  373|       |
  374|  20.3M|    dq0 = ABS(pu1_src[2 * src_strd] - 2 * pu1_src[1 * src_strd] +
  ------------------
  |  |   45|  20.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.41M, False: 18.9M]
  |  |  ------------------
  ------------------
  375|  20.3M|                    pu1_src[0 * src_strd]);
  376|       |
  377|  20.3M|    dq3 = ABS(pu1_src[3 + 2 * src_strd] - 2 * pu1_src[3 + 1 * src_strd] +
  ------------------
  |  |   45|  20.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.36M, False: 19.0M]
  |  |  ------------------
  ------------------
  378|  20.3M|                    pu1_src[3 + 0 * src_strd]);
  379|       |
  380|  20.3M|    dp0 = ABS(pu1_src[-3 * src_strd] - 2 * pu1_src[-2 * src_strd] +
  ------------------
  |  |   45|  20.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.38M, False: 18.9M]
  |  |  ------------------
  ------------------
  381|  20.3M|                    pu1_src[-1 * src_strd]);
  382|       |
  383|  20.3M|    dp3 = ABS(pu1_src[3 - 3 * src_strd] - 2 * pu1_src[3 - 2 * src_strd] +
  ------------------
  |  |   45|  20.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.37M, False: 19.0M]
  |  |  ------------------
  ------------------
  384|  20.3M|                    pu1_src[3 - 1 * src_strd]);
  385|       |
  386|  20.3M|    d0 = dp0 + dq0;
  387|  20.3M|    d3 = dp3 + dq3;
  388|       |
  389|  20.3M|    dp = dp0 + dp3;
  390|  20.3M|    dq = dq0 + dq3;
  391|       |
  392|  20.3M|    d = d0 + d3;
  393|       |
  394|  20.3M|    de = 0;
  395|  20.3M|    dep = 0;
  396|  20.3M|    deq = 0;
  397|       |
  398|  20.3M|    if(d < beta)
  ------------------
  |  Branch (398:8): [True: 18.8M, False: 1.50M]
  ------------------
  399|  18.8M|    {
  400|  18.8M|        d_sam0 = 0;
  401|  18.8M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (401:12): [True: 18.0M, False: 841k]
  ------------------
  402|  18.0M|                        && (ABS(pu1_src[3 * src_strd] - pu1_src[0 * src_strd]) +
  ------------------
  |  |   45|  18.0M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 788k, False: 17.2M]
  |  |  ------------------
  ------------------
  |  Branch (402:28): [True: 17.0M, False: 986k]
  ------------------
  403|  18.0M|                                        ABS(pu1_src[-1 * src_strd] - pu1_src[-4 * src_strd])
  ------------------
  |  |   45|  18.0M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 958k, False: 17.0M]
  |  |  ------------------
  ------------------
  404|  18.0M|                                        < (beta >> 3))
  405|  17.0M|                        && ABS(pu1_src[0 * src_strd] - pu1_src[-1 * src_strd])
  ------------------
  |  |   45|  17.0M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 645k, False: 16.3M]
  |  |  ------------------
  ------------------
  |  Branch (405:28): [True: 16.8M, False: 184k]
  ------------------
  406|  17.0M|                        < ((5 * tc + 1) >> 1))
  407|  17.0M|        {
  408|  17.0M|            d_sam0 = 1;
  409|  17.0M|        }
  410|       |
  411|  18.8M|        pu1_src += 3;
  412|  18.8M|        d_sam3 = 0;
  413|  18.8M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (413:12): [True: 18.2M, False: 670k]
  ------------------
  414|  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: 791k, False: 17.4M]
  |  |  ------------------
  ------------------
  |  Branch (414:28): [True: 17.2M, False: 981k]
  ------------------
  415|  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: 970k, False: 17.2M]
  |  |  ------------------
  ------------------
  416|  18.2M|                                        < (beta >> 3))
  417|  17.1M|                        && ABS(pu1_src[0 * src_strd] - pu1_src[-1 * src_strd])
  ------------------
  |  |   45|  17.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 652k, False: 16.5M]
  |  |  ------------------
  ------------------
  |  Branch (417:28): [True: 16.7M, False: 377k]
  ------------------
  418|  17.1M|                        < ((5 * tc + 1) >> 1))
  419|  16.6M|        {
  420|  16.6M|            d_sam3 = 1;
  421|  16.6M|        }
  422|  18.8M|        pu1_src -= 3;
  423|       |
  424|  18.8M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (424:15): [True: 16.5M, False: 2.34M]
  |  Branch (424:30): [True: 16.2M, False: 283k]
  ------------------
  425|  18.8M|        dep = (dp < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (425:15): [True: 17.9M, False: 943k]
  ------------------
  426|  18.8M|        deq = (dq < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (426:15): [True: 17.8M, False: 1.01M]
  ------------------
  427|  18.8M|        if(tc <= 1)
  ------------------
  |  Branch (427:12): [True: 1.16M, False: 17.7M]
  ------------------
  428|  1.16M|        {
  429|  1.16M|            dep = 0;
  430|  1.16M|            deq = 0;
  431|  1.16M|        }
  432|  18.8M|    }
  433|       |
  434|  20.3M|    if(de != 0)
  ------------------
  |  Branch (434:8): [True: 18.5M, False: 1.81M]
  ------------------
  435|  18.5M|    {
  436|  86.8M|        for(col = 0; col < 4; col++)
  ------------------
  |  Branch (436:22): [True: 68.3M, False: 18.5M]
  ------------------
  437|  68.3M|        {
  438|  68.3M|            tmp_p0 = pu1_src[-1 * src_strd];
  439|  68.3M|            tmp_p1 = pu1_src[-2 * src_strd];
  440|  68.3M|            tmp_p2 = pu1_src[-3 * src_strd];
  441|       |
  442|  68.3M|            tmp_q0 = pu1_src[0 * src_strd];
  443|  68.3M|            tmp_q1 = pu1_src[1 * src_strd];
  444|  68.3M|            tmp_q2 = pu1_src[2 * src_strd];
  445|  68.3M|            if(de == 2)
  ------------------
  |  Branch (445:16): [True: 59.3M, False: 8.93M]
  ------------------
  446|  59.3M|            {
  447|  59.3M|                tmp_q0 = CLIP3((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  59.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.31k, False: 59.3M]
  |  |  |  Branch (40:53): [True: 6.02k, False: 59.3M]
  |  |  ------------------
  ------------------
  448|  59.3M|                                2 * pu1_src[1 * src_strd] +
  449|  59.3M|                                2 * pu1_src[0 * src_strd] +
  450|  59.3M|                                2 * pu1_src[-1 * src_strd] +
  451|  59.3M|                                pu1_src[-2 * src_strd] + 4) >> 3,
  452|  59.3M|                                pu1_src[0 * src_strd] - 2 * tc,
  453|  59.3M|                                pu1_src[0 * src_strd] + 2 * tc);
  454|       |
  455|  59.3M|                tmp_q1 = CLIP3((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  59.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.97k, False: 59.3M]
  |  |  |  Branch (40:53): [True: 6.49k, False: 59.3M]
  |  |  ------------------
  ------------------
  456|  59.3M|                                pu1_src[1 * src_strd] +
  457|  59.3M|                                pu1_src[0 * src_strd] +
  458|  59.3M|                                pu1_src[-1 * src_strd] + 2) >> 2,
  459|  59.3M|                                pu1_src[1 * src_strd] - 2 * tc,
  460|  59.3M|                                pu1_src[1 * src_strd] + 2 * tc);
  461|       |
  462|  59.3M|                tmp_q2 = CLIP3((2 * pu1_src[3 * src_strd] +
  ------------------
  |  |   40|  59.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.82k, False: 59.3M]
  |  |  |  Branch (40:53): [True: 3.87k, False: 59.3M]
  |  |  ------------------
  ------------------
  463|  59.3M|                                3 * pu1_src[2 * src_strd] +
  464|  59.3M|                                pu1_src[1 * src_strd] +
  465|  59.3M|                                pu1_src[0 * src_strd] +
  466|  59.3M|                                pu1_src[-1 * src_strd] + 4) >> 3,
  467|  59.3M|                                pu1_src[2 * src_strd] - 2 * tc,
  468|  59.3M|                                pu1_src[2 * src_strd] + 2 * tc);
  469|       |
  470|  59.3M|                tmp_p0 = CLIP3((pu1_src[1 * src_strd] +
  ------------------
  |  |   40|  59.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.73k, False: 59.3M]
  |  |  |  Branch (40:53): [True: 6.23k, False: 59.3M]
  |  |  ------------------
  ------------------
  471|  59.3M|                                2 * pu1_src[0 * src_strd] +
  472|  59.3M|                                2 * pu1_src[-1 * src_strd] +
  473|  59.3M|                                2 * pu1_src[-2 * src_strd] +
  474|  59.3M|                                pu1_src[-3 * src_strd] + 4) >> 3,
  475|  59.3M|                                pu1_src[-1 * src_strd] - 2 * tc,
  476|  59.3M|                                pu1_src[-1 * src_strd] + 2 * tc);
  477|       |
  478|  59.3M|                tmp_p1 = CLIP3((pu1_src[0 * src_strd] +
  ------------------
  |  |   40|  59.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.45k, False: 59.3M]
  |  |  |  Branch (40:53): [True: 5.62k, False: 59.3M]
  |  |  ------------------
  ------------------
  479|  59.3M|                                pu1_src[-1 * src_strd] +
  480|  59.3M|                                pu1_src[-2 * src_strd] +
  481|  59.3M|                                pu1_src[-3 * src_strd] + 2) >> 2,
  482|  59.3M|                                pu1_src[-2 * src_strd] - 2 * tc,
  483|  59.3M|                                pu1_src[-2 * src_strd] + 2 * tc);
  484|       |
  485|  59.3M|                tmp_p2 = CLIP3((pu1_src[0 * src_strd] +
  ------------------
  |  |   40|  59.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.48k, False: 59.3M]
  |  |  |  Branch (40:53): [True: 5.18k, False: 59.3M]
  |  |  ------------------
  ------------------
  486|  59.3M|                                pu1_src[-1 * src_strd] +
  487|  59.3M|                                pu1_src[-2 * src_strd] +
  488|  59.3M|                                3 * pu1_src[-3 * src_strd] +
  489|  59.3M|                                2 * pu1_src[-4 * src_strd] + 4) >> 3,
  490|  59.3M|                                pu1_src[-3 * src_strd] - 2 * tc,
  491|  59.3M|                                pu1_src[-3 * src_strd] + 2 * tc);
  492|  59.3M|            }
  493|  8.93M|            else
  494|  8.93M|            {
  495|  8.93M|                delta = (9 * (pu1_src[0 * src_strd] - pu1_src[-1 * src_strd]) -
  496|  8.93M|                                3 * (pu1_src[1 * src_strd] - pu1_src[-2 * src_strd]) +
  497|  8.93M|                                8) >> 4;
  498|  8.93M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  8.93M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.76M, False: 5.16M]
  |  |  ------------------
  ------------------
  |  Branch (498:20): [True: 9.41M, False: 18.4E]
  ------------------
  499|  9.41M|                {
  500|  9.41M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  9.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 991k, False: 8.41M]
  |  |  |  Branch (40:53): [True: 1.14M, False: 7.27M]
  |  |  ------------------
  ------------------
  501|       |
  502|  9.41M|                    tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|  9.41M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 50.4k, False: 9.36M]
  |  |  |  |  |  Branch (40:53): [True: 16.4k, False: 9.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  503|  9.41M|                    tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|  9.41M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 107k, False: 9.30M]
  |  |  |  |  |  Branch (40:53): [True: 18.9k, False: 9.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  504|       |
  505|  9.41M|                    if(dep == 1)
  ------------------
  |  Branch (505:24): [True: 6.55M, False: 2.85M]
  ------------------
  506|  6.55M|                    {
  507|  6.55M|                        delta_p = CLIP3((((pu1_src[-3 * src_strd] +
  ------------------
  |  |   40|  6.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 76.8k, False: 6.47M]
  |  |  |  Branch (40:53): [True: 247k, False: 6.23M]
  |  |  ------------------
  ------------------
  508|  6.55M|                                        pu1_src[-1 * src_strd] + 1) >> 1) -
  509|  6.55M|                                        pu1_src[-2 * src_strd] + delta) >> 1,
  510|  6.55M|                                        -(tc >> 1),
  511|  6.55M|                                        (tc >> 1));
  512|  6.55M|                        tmp_p1 = CLIP_U8(pu1_src[-2 * src_strd] + delta_p);
  ------------------
  |  |   40|  6.55M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 15.8k, False: 6.53M]
  |  |  |  |  |  Branch (40:53): [True: 13.0k, False: 6.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  6.55M|                    }
  514|       |
  515|  9.41M|                    if(deq == 1)
  ------------------
  |  Branch (515:24): [True: 6.11M, False: 3.29M]
  ------------------
  516|  6.11M|                    {
  517|  6.11M|                        delta_q = CLIP3((((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  6.11M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 84.0k, False: 6.02M]
  |  |  |  Branch (40:53): [True: 212k, False: 5.81M]
  |  |  ------------------
  ------------------
  518|  6.11M|                                        pu1_src[0 * src_strd] + 1) >> 1) -
  519|  6.11M|                                        pu1_src[1 * src_strd] - delta) >> 1,
  520|  6.11M|                                        -(tc >> 1),
  521|  6.11M|                                        (tc >> 1));
  522|  6.11M|                        tmp_q1 = CLIP_U8(pu1_src[1 * src_strd] + delta_q);
  ------------------
  |  |   40|  6.11M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.11M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 19.3k, False: 6.09M]
  |  |  |  |  |  Branch (40:53): [True: 14.1k, False: 6.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  523|  6.11M|                    }
  524|  9.41M|                }
  525|  8.93M|            }
  526|       |
  527|  68.3M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (527:16): [True: 68.2M, False: 78.9k]
  ------------------
  528|  68.2M|            {
  529|  68.2M|                pu1_src[-3 * src_strd] = tmp_p2;
  530|  68.2M|                pu1_src[-2 * src_strd] = tmp_p1;
  531|  68.2M|                pu1_src[-1 * src_strd] = tmp_p0;
  532|  68.2M|            }
  533|       |
  534|  68.3M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (534:16): [True: 68.2M, False: 56.3k]
  ------------------
  535|  68.2M|            {
  536|  68.2M|                pu1_src[0 * src_strd] = tmp_q0;
  537|  68.2M|                pu1_src[1 * src_strd] = tmp_q1;
  538|  68.2M|                pu1_src[2 * src_strd] = tmp_q2;
  539|  68.2M|            }
  540|       |
  541|  68.3M|            pu1_src += 1;
  542|  68.3M|        }
  543|  18.5M|    }
  544|       |
  545|  20.3M|}
ihevc_deblk_chroma_vert:
  603|  7.28M|{
  604|  7.28M|    WORD32 qp_indx_u, qp_chroma_u;
  605|  7.28M|    WORD32 qp_indx_v, qp_chroma_v;
  606|  7.28M|    WORD32 tc_indx_u, tc_u;
  607|  7.28M|    WORD32 tc_indx_v, tc_v;
  608|  7.28M|    WORD32 delta_u, tmp_p0_u, tmp_q0_u;
  609|  7.28M|    WORD32 delta_v, tmp_p0_v, tmp_q0_v;
  610|  7.28M|    WORD32 row;
  611|       |
  612|  7.28M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  7.28M|#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.28M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  617|  7.28M|    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.28M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (620:8): [True: 0, False: 7.28M]
  ------------------
  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.28M|    else
  626|  7.28M|    {
  627|  7.28M|        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.29k, False: 7.27M]
  |  Branch (627:52): [True: 15.2k, False: 7.26M]
  ------------------
  628|  7.28M|        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: 13.1k, False: 7.26M]
  |  Branch (628:52): [True: 1.88k, False: 7.26M]
  ------------------
  629|  7.28M|    }
  630|       |
  631|  7.28M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 15.2k, False: 7.26M]
  |  |  |  Branch (40:53): [True: 882, False: 7.26M]
  |  |  ------------------
  ------------------
  632|  7.28M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  633|       |
  634|  7.28M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.88k, False: 7.28M]
  |  |  |  Branch (40:53): [True: 590, False: 7.27M]
  |  |  ------------------
  ------------------
  635|  7.28M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  636|       |
  637|  7.28M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (637:8): [True: 289k, False: 6.99M]
  |  Branch (637:21): [True: 288k, False: 579]
  ------------------
  638|   288k|    {
  639|   288k|        return;
  640|   288k|    }
  641|       |
  642|  34.9M|    for(row = 0; row < 4; row++)
  ------------------
  |  Branch (642:18): [True: 27.9M, False: 6.99M]
  ------------------
  643|  27.9M|    {
  644|  27.9M|        delta_u = CLIP3((((pu1_src[0] - pu1_src[-2]) << 2) +
  ------------------
  |  |   40|  27.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 603k, False: 27.3M]
  |  |  |  Branch (40:53): [True: 560k, False: 26.7M]
  |  |  ------------------
  ------------------
  645|  27.9M|                        pu1_src[-4] - pu1_src[2] + 4) >> 3,
  646|  27.9M|                        -tc_u, tc_u);
  647|       |
  648|  27.9M|        tmp_p0_u = CLIP_U8(pu1_src[-2] + delta_u);
  ------------------
  |  |   40|  27.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  27.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.3k, False: 27.9M]
  |  |  |  |  |  Branch (40:53): [True: 15.3k, False: 27.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  649|  27.9M|        tmp_q0_u = CLIP_U8(pu1_src[0] - delta_u);
  ------------------
  |  |   40|  27.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  27.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 12.6k, False: 27.9M]
  |  |  |  |  |  Branch (40:53): [True: 14.1k, False: 27.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  650|       |
  651|  27.9M|        delta_v = CLIP3((((pu1_src[1] - pu1_src[-1]) << 2) +
  ------------------
  |  |   40|  27.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 637k, False: 27.2M]
  |  |  |  Branch (40:53): [True: 569k, False: 26.7M]
  |  |  ------------------
  ------------------
  652|  27.9M|                        pu1_src[-3] - pu1_src[3] + 4) >> 3,
  653|  27.9M|                        -tc_v, tc_v);
  654|       |
  655|  27.9M|        tmp_p0_v = CLIP_U8(pu1_src[-1] + delta_v);
  ------------------
  |  |   40|  27.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  27.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.4k, False: 27.9M]
  |  |  |  |  |  Branch (40:53): [True: 14.8k, False: 27.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|  27.9M|        tmp_q0_v = CLIP_U8(pu1_src[1] - delta_v);
  ------------------
  |  |   40|  27.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  27.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 12.0k, False: 27.9M]
  |  |  |  |  |  Branch (40:53): [True: 17.5k, False: 27.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  657|       |
  658|  27.9M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (658:12): [True: 27.8M, False: 47.0k]
  ------------------
  659|  27.8M|        {
  660|  27.8M|            pu1_src[-2] = tmp_p0_u;
  661|  27.8M|            pu1_src[-1] = tmp_p0_v;
  662|  27.8M|        }
  663|       |
  664|  27.9M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (664:12): [True: 27.8M, False: 47.1k]
  ------------------
  665|  27.8M|        {
  666|  27.8M|            pu1_src[0] = tmp_q0_u;
  667|  27.8M|            pu1_src[1] = tmp_q0_v;
  668|  27.8M|        }
  669|       |
  670|  27.9M|        pu1_src += src_strd;
  671|  27.9M|    }
  672|       |
  673|  6.99M|}
ihevc_deblk_chroma_horz:
  733|  7.09M|{
  734|  7.09M|    WORD32 qp_indx_u, qp_chroma_u;
  735|  7.09M|    WORD32 qp_indx_v, qp_chroma_v;
  736|  7.09M|    WORD32 tc_indx_u, tc_u;
  737|  7.09M|    WORD32 tc_indx_v, tc_v;
  738|  7.09M|    WORD32 tc;
  739|       |
  740|  7.09M|    WORD32 delta, tmp_p0, tmp_q0;
  741|  7.09M|    WORD32 col;
  742|       |
  743|  7.09M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  7.09M|#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.09M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  748|  7.09M|    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.09M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (751:8): [True: 0, False: 7.09M]
  ------------------
  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.09M|    else
  757|  7.09M|    {
  758|  7.09M|        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.21k, False: 7.09M]
  |  Branch (758:52): [True: 12.5k, False: 7.07M]
  ------------------
  759|  7.09M|        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: 13.8k, False: 7.08M]
  |  Branch (759:52): [True: 1.73k, False: 7.07M]
  ------------------
  760|  7.09M|    }
  761|       |
  762|  7.09M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.5k, False: 7.08M]
  |  |  |  Branch (40:53): [True: 1.09k, False: 7.08M]
  |  |  ------------------
  ------------------
  763|  7.09M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  764|       |
  765|  7.09M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.73k, False: 7.09M]
  |  |  |  Branch (40:53): [True: 756, False: 7.09M]
  |  |  ------------------
  ------------------
  766|  7.09M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  767|       |
  768|  7.09M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (768:8): [True: 302k, False: 6.79M]
  |  Branch (768:21): [True: 301k, False: 1.14k]
  ------------------
  769|   301k|    {
  770|   301k|        return;
  771|   301k|    }
  772|       |
  773|  60.7M|    for(col = 0; col < 8; col++)
  ------------------
  |  Branch (773:18): [True: 53.9M, False: 6.79M]
  ------------------
  774|  53.9M|    {
  775|  53.9M|        tc = (col & 1) ? tc_v : tc_u;
  ------------------
  |  Branch (775:14): [True: 26.9M, False: 26.9M]
  ------------------
  776|  53.9M|        delta = CLIP3((((pu1_src[0 * src_strd] -
  ------------------
  |  |   40|  53.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.70M, False: 52.2M]
  |  |  |  Branch (40:53): [True: 1.42M, False: 50.8M]
  |  |  ------------------
  ------------------
  777|  53.9M|                      pu1_src[-1 * src_strd]) << 2) +
  778|  53.9M|                      pu1_src[-2 * src_strd] -
  779|  53.9M|                      pu1_src[1 * src_strd] + 4) >> 3,
  780|  53.9M|                      -tc, tc);
  781|       |
  782|  53.9M|        tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|  53.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  53.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 28.6k, False: 53.9M]
  |  |  |  |  |  Branch (40:53): [True: 25.5k, False: 53.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  783|  53.9M|        tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|  53.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  53.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 31.5k, False: 53.9M]
  |  |  |  |  |  Branch (40:53): [True: 38.6k, False: 53.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  784|       |
  785|  53.9M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (785:12): [True: 53.8M, False: 93.4k]
  ------------------
  786|  53.8M|        {
  787|  53.8M|            pu1_src[-1 * src_strd] = tmp_p0;
  788|  53.8M|        }
  789|       |
  790|  53.9M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (790:12): [True: 53.8M, False: 95.2k]
  ------------------
  791|  53.8M|        {
  792|  53.8M|            pu1_src[0 * src_strd] = tmp_q0;
  793|  53.8M|        }
  794|       |
  795|  53.9M|        pu1_src += 1;
  796|  53.9M|    }
  797|       |
  798|  6.79M|}

ihevc_disp_mgr_init:
   66|  28.3k|{
   67|  28.3k|    WORD32 id;
   68|       |
   69|  28.3k|    ps_disp_mgr->u4_last_abs_poc = DEFAULT_POC;
  ------------------
  |  |   39|  28.3k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
   70|       |
   71|  1.84M|    for(id = 0; id < DISP_MGR_MAX_CNT; id++)
  ------------------
  |  |   38|  1.84M|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (71:17): [True: 1.81M, False: 28.3k]
  ------------------
   72|  1.81M|    {
   73|  1.81M|        ps_disp_mgr->ai4_abs_poc[id] = DEFAULT_POC;
  ------------------
  |  |   39|  1.81M|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
   74|       |        ps_disp_mgr->apv_ptr[id] = NULL;
   75|  1.81M|    }
   76|  28.3k|}
ihevc_disp_mgr_add:
  111|  72.9k|{
  112|  72.9k|    if(buf_id >= DISP_MGR_MAX_CNT)
  ------------------
  |  |   38|  72.9k|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (112:8): [True: 0, False: 72.9k]
  ------------------
  113|      0|    {
  114|      0|        return (-1);
  115|      0|    }
  116|       |
  117|  72.9k|    if(ps_disp_mgr->apv_ptr[buf_id] != NULL)
  ------------------
  |  Branch (117:8): [True: 0, False: 72.9k]
  ------------------
  118|      0|    {
  119|      0|        return (-1);
  120|      0|    }
  121|       |
  122|  72.9k|    ps_disp_mgr->apv_ptr[buf_id] = pv_ptr;
  123|  72.9k|    ps_disp_mgr->ai4_abs_poc[buf_id] = abs_poc;
  124|  72.9k|    return 0;
  125|  72.9k|}
ihevc_disp_mgr_get:
  153|  71.1k|{
  154|  71.1k|    WORD32 id;
  155|  71.1k|    void *pv_ret_ptr;
  156|  71.1k|    WORD32 i4_min_poc;
  157|  71.1k|    WORD32 min_poc_id;
  158|       |
  159|       |
  160|  71.1k|    pv_ret_ptr = NULL;
  161|  71.1k|    i4_min_poc = 0x7FFFFFFF;
  162|  71.1k|    min_poc_id = -1;
  163|       |
  164|       |    /* Find minimum POC */
  165|  4.62M|    for(id = 0; id < DISP_MGR_MAX_CNT; id++)
  ------------------
  |  |   38|  4.62M|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (165:17): [True: 4.55M, False: 71.1k]
  ------------------
  166|  4.55M|    {
  167|  4.55M|        if((DEFAULT_POC != ps_disp_mgr->ai4_abs_poc[id]) &&
  ------------------
  |  |   39|  4.55M|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
  |  Branch (167:12): [True: 89.1k, False: 4.46M]
  ------------------
  168|  89.1k|                        (ps_disp_mgr->ai4_abs_poc[id] <= i4_min_poc))
  ------------------
  |  Branch (168:25): [True: 75.5k, False: 13.5k]
  ------------------
  169|  75.5k|        {
  170|  75.5k|            i4_min_poc = ps_disp_mgr->ai4_abs_poc[id];
  171|  75.5k|            min_poc_id = id;
  172|  75.5k|        }
  173|  4.55M|    }
  174|  71.1k|    *pi4_buf_id = min_poc_id;
  175|       |    /* If all pocs are still default_poc then return NULL */
  176|  71.1k|    if(-1 == min_poc_id)
  ------------------
  |  Branch (176:8): [True: 655, False: 70.4k]
  ------------------
  177|    655|    {
  178|    655|        return NULL;
  179|    655|    }
  180|       |
  181|  70.4k|    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|  70.4k|    ps_disp_mgr->apv_ptr[min_poc_id] = NULL;
  185|  70.4k|    ps_disp_mgr->ai4_abs_poc[min_poc_id] = DEFAULT_POC;
  ------------------
  |  |   39|  70.4k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
  186|  70.4k|    return pv_ret_ptr;
  187|  71.1k|}

ihevc_dpb_mgr_init:
   75|  28.3k|{
   76|  28.3k|    UWORD32 i;
   77|  28.3k|    dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
   78|  1.84M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  1.84M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  1.84M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (78:16): [True: 1.81M, False: 28.3k]
  ------------------
   79|  1.81M|    {
   80|  1.81M|        ps_dpb_info[i].ps_prev_dpb = NULL;
   81|  1.81M|        ps_dpb_info[i].ps_pic_buf = NULL;
   82|       |
   83|  1.81M|    }
   84|       |
   85|  28.3k|    ps_dpb_mgr->u1_num_ref_bufs = 0;
   86|  28.3k|    ps_dpb_mgr->ps_dpb_head = NULL;
   87|       |
   88|  28.3k|}
ihevc_dpb_mgr_insert_ref:
  121|  72.9k|{
  122|  72.9k|    int i;
  123|  72.9k|    dpb_info_t *ps_dpb_info;
  124|       |
  125|  72.9k|    ps_dpb_info = ps_dpb_mgr->as_dpb_info;
  126|       |
  127|       |    /* Return error if buffer is already present in the DPB */
  128|  4.74M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  4.74M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  4.74M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (128:16): [True: 4.66M, False: 72.9k]
  ------------------
  129|  4.66M|    {
  130|  4.66M|        if((ps_dpb_info[i].ps_pic_buf == ps_pic_buf)
  ------------------
  |  Branch (130:12): [True: 0, False: 4.66M]
  ------------------
  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.66M|    }
  138|       |
  139|       |    /* Find an unused DPB location */
  140|  87.2k|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  87.2k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  87.2k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (140:16): [True: 87.2k, False: 0]
  ------------------
  141|  87.2k|    {
  142|  87.2k|        if(NULL == ps_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (142:12): [True: 72.9k, False: 14.3k]
  ------------------
  143|  72.9k|        {
  144|  72.9k|            break;
  145|  72.9k|        }
  146|  87.2k|    }
  147|  72.9k|    if(i == MAX_DPB_BUFS)
  ------------------
  |  |   41|  72.9k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  72.9k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (147:8): [True: 0, False: 72.9k]
  ------------------
  148|      0|    {
  149|      0|        return (-1);
  150|      0|    }
  151|       |
  152|       |    /* Create DPB info */
  153|  72.9k|    ps_dpb_info[i].ps_pic_buf = ps_pic_buf;
  154|  72.9k|    ps_dpb_info[i].ps_prev_dpb = ps_dpb_mgr->ps_dpb_head;
  155|  72.9k|    ps_dpb_info[i].ps_pic_buf->u1_buf_id = buf_id;
  156|  72.9k|    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|  72.9k|    ps_dpb_mgr->ps_dpb_head = ps_dpb_info + i;
  160|       |
  161|       |    /* Increment Short term buffer count */
  162|  72.9k|    ps_dpb_mgr->u1_num_ref_bufs++;
  163|       |
  164|  72.9k|    return 0;
  165|  72.9k|}
ihevc_dpb_mgr_del_ref:
  198|  49.3k|{
  199|  49.3k|    int i;
  200|  49.3k|    dpb_info_t *ps_next_dpb;
  201|       |
  202|  49.3k|    dpb_info_t *ps_unmark_node;
  203|  49.3k|    UWORD8 u1_del_node;
  204|  49.3k|    UNUSED(u1_del_node);
  ------------------
  |  |   38|  49.3k|#define UNUSED(x) ((void)(x))
  ------------------
  205|  49.3k|    u1_del_node = 0;
  206|       |
  207|       |    /* Find the node with matching absolute POC */
  208|  49.3k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_head;
  209|  49.3k|    if(ps_next_dpb->ps_pic_buf->i4_abs_poc == i4_abs_poc)
  ------------------
  |  Branch (209:8): [True: 46.3k, False: 2.97k]
  ------------------
  210|  46.3k|    {
  211|  46.3k|        ps_unmark_node = ps_next_dpb;
  212|  46.3k|    }
  213|  2.97k|    else
  214|  2.97k|    {
  215|  3.57k|        for(i = 1; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (215:20): [True: 3.57k, False: 0]
  ------------------
  216|  3.57k|        {
  217|  3.57k|            if(ps_next_dpb->ps_prev_dpb->ps_pic_buf->i4_abs_poc == i4_abs_poc)
  ------------------
  |  Branch (217:16): [True: 2.97k, False: 595]
  ------------------
  218|  2.97k|                break;
  219|    595|            ps_next_dpb = ps_next_dpb->ps_prev_dpb;
  220|    595|        }
  221|       |
  222|  2.97k|        if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (222:12): [True: 0, False: 2.97k]
  ------------------
  223|      0|        {
  224|      0|            return;
  225|      0|        }
  226|  2.97k|        else
  227|  2.97k|            ps_unmark_node = ps_next_dpb->ps_prev_dpb;
  228|  2.97k|    }
  229|       |
  230|  49.3k|    if(ps_unmark_node == ps_dpb_mgr->ps_dpb_head)
  ------------------
  |  Branch (230:8): [True: 46.3k, False: 2.97k]
  ------------------
  231|  46.3k|    {
  232|  46.3k|        ps_dpb_mgr->ps_dpb_head = ps_unmark_node->ps_prev_dpb;
  233|  46.3k|    }
  234|  2.97k|    else
  235|  2.97k|    {
  236|  2.97k|        ps_next_dpb->ps_prev_dpb = ps_unmark_node->ps_prev_dpb; //update link
  237|  2.97k|        ps_unmark_node->ps_prev_dpb = NULL;
  238|  2.97k|    }
  239|  49.3k|    ps_dpb_mgr->u1_num_ref_bufs--; //decrement buffer count
  240|       |
  241|       |    /* Release the physical buffer */
  242|  49.3k|    ihevc_buf_mgr_release((buf_mgr_t *)ps_buf_mgr, ps_unmark_node->ps_pic_buf->u1_buf_id,
  243|  49.3k|                          BUF_MGR_REF);
  ------------------
  |  |   40|  49.3k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  244|  49.3k|    ps_unmark_node->ps_prev_dpb = NULL;
  245|       |    ps_unmark_node->ps_pic_buf = NULL;
  246|  49.3k|}
ihevc_dpb_mgr_get_ref_by_nearest_poc:
  275|   134k|{
  276|   134k|    WORD32 i;
  277|   134k|    WORD32 min_diff = 0x7FFFFFFF;
  278|   134k|    pic_buf_t *ps_pic_buf = NULL;
  279|       |
  280|  8.76M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  8.76M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  8.76M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (280:16): [True: 8.63M, False: 134k]
  ------------------
  281|  8.63M|    {
  282|  8.63M|        if((ps_dpb_mgr->as_dpb_info[i].ps_pic_buf) &&
  ------------------
  |  Branch (282:12): [True: 128k, False: 8.50M]
  ------------------
  283|   128k|                        (ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref != UNUSED_FOR_REF))
  ------------------
  |  Branch (283:25): [True: 104k, False: 23.6k]
  ------------------
  284|   104k|        {
  285|   104k|            WORD32 poc_diff = cur_abs_poc - ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->i4_abs_poc;
  286|   104k|            if((poc_diff > 0) && (poc_diff < min_diff))
  ------------------
  |  Branch (286:16): [True: 64.8k, False: 39.8k]
  |  Branch (286:34): [True: 47.3k, False: 17.4k]
  ------------------
  287|  47.3k|            {
  288|  47.3k|                min_diff = poc_diff;
  289|  47.3k|                ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  290|  47.3k|            }
  291|   104k|        }
  292|  8.63M|    }
  293|       |
  294|   134k|    if(NULL == ps_pic_buf)
  ------------------
  |  Branch (294:8): [True: 96.8k, False: 38.0k]
  ------------------
  295|  96.8k|    {
  296|  96.8k|        min_diff = 0x7FFFFFFF;
  297|  6.29M|        for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  6.29M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  6.29M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (297:20): [True: 6.20M, False: 96.8k]
  ------------------
  298|  6.20M|        {
  299|  6.20M|            if((ps_dpb_mgr->as_dpb_info[i].ps_pic_buf) &&
  ------------------
  |  Branch (299:16): [True: 41.4k, False: 6.15M]
  ------------------
  300|  41.4k|                            (ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref != UNUSED_FOR_REF))
  ------------------
  |  Branch (300:29): [True: 29.1k, False: 12.2k]
  ------------------
  301|  29.1k|            {
  302|  29.1k|                WORD32 poc_diff = cur_abs_poc - ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->i4_abs_poc;
  303|  29.1k|                if(ABS(poc_diff) < min_diff)
  ------------------
  |  |   45|  29.1k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 29.1k]
  |  |  ------------------
  ------------------
  |  Branch (303:20): [True: 25.7k, False: 3.45k]
  ------------------
  304|  25.7k|                {
  305|  25.7k|                    min_diff = ABS(poc_diff);
  ------------------
  |  |   45|  25.7k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 25.7k]
  |  |  ------------------
  ------------------
  306|  25.7k|                    ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  307|  25.7k|                }
  308|  29.1k|            }
  309|  6.20M|        }
  310|  96.8k|    }
  311|       |
  312|   134k|    return ps_pic_buf;
  313|   134k|}
ihevc_dpb_mgr_get_ref_by_poc:
  342|  97.5k|{
  343|  97.5k|    UWORD32 i;
  344|  97.5k|    dpb_info_t *ps_next_ref;
  345|  97.5k|    pic_buf_t *ps_pic_buf = NULL;
  346|       |
  347|       |
  348|  97.5k|    ps_next_ref = ps_dpb_mgr->ps_dpb_head;
  349|   271k|    for(i = 0; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (349:16): [True: 206k, False: 65.0k]
  ------------------
  350|   206k|    {
  351|   206k|        if(ps_next_ref->ps_pic_buf->i4_abs_poc == abs_poc)
  ------------------
  |  Branch (351:12): [True: 32.4k, False: 174k]
  ------------------
  352|  32.4k|        {
  353|  32.4k|            ps_pic_buf = ps_next_ref->ps_pic_buf;
  354|  32.4k|            break;
  355|  32.4k|        }
  356|       |
  357|   174k|        ps_next_ref = ps_next_ref->ps_prev_dpb;
  358|   174k|    }
  359|       |
  360|  97.5k|    if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (360:8): [True: 65.0k, False: 32.4k]
  ------------------
  361|  65.0k|    {
  362|  65.0k|        ps_pic_buf = NULL;
  363|  65.0k|    }
  364|       |
  365|  97.5k|    return ps_pic_buf;
  366|  97.5k|}
ihevc_dpb_mgr_get_ref_by_poc_lsb:
  395|  10.3k|{
  396|  10.3k|    pic_buf_t *ps_pic_buf = NULL;
  397|  10.3k|    UWORD32 i;
  398|  10.3k|    dpb_info_t *ps_next_ref;
  399|       |
  400|  10.3k|    ps_next_ref = ps_dpb_mgr->ps_dpb_head;
  401|  19.7k|    for(i = 0; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (401:16): [True: 12.2k, False: 7.51k]
  ------------------
  402|  12.2k|    {
  403|  12.2k|        if(ps_next_ref->ps_pic_buf->i4_poc_lsb == poc_lsb)
  ------------------
  |  Branch (403:12): [True: 2.84k, False: 9.36k]
  ------------------
  404|  2.84k|        {
  405|  2.84k|            ps_pic_buf = ps_next_ref->ps_pic_buf;
  406|  2.84k|            break;
  407|  2.84k|        }
  408|       |
  409|  9.36k|        ps_next_ref = ps_next_ref->ps_prev_dpb;
  410|  9.36k|    }
  411|       |
  412|  10.3k|    if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (412:8): [True: 7.51k, False: 2.84k]
  ------------------
  413|  7.51k|    {
  414|  7.51k|        ps_pic_buf = NULL;
  415|  7.51k|    }
  416|       |
  417|  10.3k|    return ps_pic_buf;
  418|  10.3k|}

ihevc_hbd_intra_pred_chroma_ref_substitution:
  231|  3.64M|{
  232|  3.64M|    UWORD16 pu2_ref_u, pu2_ref_v;
  233|  3.64M|    WORD32 dc_val, i, j;
  234|  3.64M|    WORD32 total_samples = (4 * nt) + 1;
  235|  3.64M|    WORD32 get_bits;
  236|  3.64M|    WORD32 next;
  237|  3.64M|    WORD32 bot_left, left, top, tp_right, tp_left;
  238|  3.64M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  239|  3.64M|    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|  3.64M|    dc_val = 1 << (bit_depth - 1);
  245|  3.64M|    if(nbr_flags == 0)
  ------------------
  |  Branch (245:8): [True: 26.2k, False: 3.61M]
  ------------------
  246|  26.2k|    {
  247|  2.46M|        for(i = 0; i < (2 * total_samples); i++)
  ------------------
  |  Branch (247:20): [True: 2.43M, False: 26.2k]
  ------------------
  248|  2.43M|        {
  249|  2.43M|            pu2_dst[i] = dc_val;
  250|  2.43M|        }
  251|  26.2k|    }
  252|  3.61M|    else
  253|  3.61M|    {
  254|       |        /* Else fill the corresponding samples */
  255|       |
  256|       |        /* Check for the neighbors availibility */
  257|  3.61M|        tp_left     = (nbr_flags & 0x10000);
  258|  3.61M|        tp_right    = (nbr_flags & 0x0f000);
  259|  3.61M|        top         = (nbr_flags & 0x00f00);
  260|  3.61M|        left        = (nbr_flags & 0x000f0);
  261|  3.61M|        bot_left    = (nbr_flags & 0x0000f);
  262|       |
  263|       |        /* Fill nbrs depending on avalibility */
  264|       |        /* Top -Left nbrs  */
  265|  3.61M|        if(0 != tp_left)
  ------------------
  |  Branch (265:12): [True: 3.13M, False: 477k]
  ------------------
  266|  3.13M|        {
  267|  3.13M|            pu2_dst[(4 * nt )] = *pu2_top_left ; // U top-left sample
  268|  3.13M|            pu2_dst[(4 * nt ) + 1] = *(pu2_top_left + 1 ) ; // V top-left sample
  269|  3.13M|        }
  270|       |        /* Left nbrs  */
  271|  3.61M|        if(0 != left)
  ------------------
  |  Branch (271:12): [True: 3.42M, False: 186k]
  ------------------
  272|  3.42M|        {
  273|  32.3M|            for(i = 0, j=0; i < (2 * nt ); i+=2)
  ------------------
  |  Branch (273:29): [True: 28.8M, False: 3.42M]
  ------------------
  274|  28.8M|            {
  275|  28.8M|                pu2_dst[(4 * nt ) - 2 - i] = pu2_left[j * src_strd]; // U left samples
  276|  28.8M|                pu2_dst[(4 * nt ) - 1 - i] = pu2_left[(j * src_strd) + 1]; // V left samples
  277|  28.8M|                j++;
  278|  28.8M|            }
  279|  3.42M|        }
  280|       |        /* Bottom - Left nbrs  */
  281|  3.61M|        if(0 != bot_left)
  ------------------
  |  Branch (281:12): [True: 2.05M, False: 1.55M]
  ------------------
  282|  2.05M|        {
  283|  19.4M|            for(i = (2 * nt), j=nt; i < (4 * nt ); i+=2)
  ------------------
  |  Branch (283:37): [True: 17.3M, False: 2.05M]
  ------------------
  284|  17.3M|            {
  285|  17.3M|                 pu2_dst[(4 * nt ) - 2 - i] = pu2_left[j * src_strd]; // U left samples
  286|  17.3M|                 pu2_dst[(4 * nt ) - 1 - i] = pu2_left[(j * src_strd) + 1]; // V left samples
  287|  17.3M|                 j++;
  288|  17.3M|            }
  289|  2.05M|        }
  290|       |        /* Top nbrs  */
  291|  3.61M|        if(0 != top)
  ------------------
  |  Branch (291:12): [True: 3.32M, False: 285k]
  ------------------
  292|  3.32M|        {
  293|  57.5M|            for(i = 0; i < (2 * nt ); i++)
  ------------------
  |  Branch (293:24): [True: 54.2M, False: 3.32M]
  ------------------
  294|  54.2M|            {
  295|  54.2M|                pu2_dst[(4 * nt ) + 2 + i] = pu2_top[i]; // U-V interleaved Top-top right samples
  296|  54.2M|            }
  297|  3.32M|        }
  298|       |        /* Top - Right nbrs  */
  299|  3.61M|        if(0 != tp_right)
  ------------------
  |  Branch (299:12): [True: 1.10M, False: 2.51M]
  ------------------
  300|  1.10M|        {
  301|  18.1M|            for(i = (2 * nt); i < (4 * nt ); i++)
  ------------------
  |  Branch (301:31): [True: 17.0M, False: 1.10M]
  ------------------
  302|  17.0M|            {
  303|  17.0M|                pu2_dst[(4 * nt ) + 2 + i] = pu2_top[i]; // U-V interleaved Top-top right samples
  304|  17.0M|            }
  305|  1.10M|        }
  306|  3.61M|        if(nt == 4 || (nt == 8 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (306:12): [True: 1.83M, False: 1.77M]
  |  Branch (306:24): [True: 649k, False: 1.12M]
  |  Branch (306:35): [True: 0, False: 649k]
  ------------------
  307|  1.86M|        {
  308|       |            /* 1 bit extraction for all the neighboring blocks */
  309|  1.86M|            tp_left = (nbr_flags & 0x10000) >> 16;
  310|  1.86M|            bot_left = (nbr_flags & 0x8)>>3;
  311|  1.86M|            left = (nbr_flags & 0x80) >> 7;
  312|  1.86M|            top = (nbr_flags & 0x100) >> 8;
  313|  1.86M|            tp_right = (nbr_flags & 0x1000) >> 12;
  314|       |
  315|  1.86M|            next = 1;
  316|  1.86M|            a_nbr_flag[0] = bot_left;
  317|  1.86M|            a_nbr_flag[1] = left;
  318|  1.86M|            a_nbr_flag[2] = tp_left;
  319|  1.86M|            a_nbr_flag[3] = top;
  320|  1.86M|            a_nbr_flag[4] = tp_right;
  321|       |
  322|       |            /* If bottom -left is not available, reverse substitution process */
  323|  1.86M|            if(bot_left == 0)
  ------------------
  |  Branch (323:16): [True: 764k, False: 1.09M]
  ------------------
  324|   764k|            {
  325|       |                /* Check for the 1st available sample from bottom-left */
  326|   943k|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (326:23): [True: 178k, False: 764k]
  ------------------
  327|   178k|                    next++;
  328|       |
  329|       |                /* If Left, top-left are available */
  330|   764k|                if(next <= 2)
  ------------------
  |  Branch (330:20): [True: 675k, False: 88.8k]
  ------------------
  331|   675k|                {
  332|   675k|                    idx = (nt * next);
  333|   675k|                    pu2_ref_u = pu2_dst[2 * idx];
  334|   675k|                    pu2_ref_v = pu2_dst[(2 * idx) + 1];
  335|  3.37M|                    for(i = 0; i < (2 * idx); i+=2)
  ------------------
  |  Branch (335:32): [True: 2.70M, False: 675k]
  ------------------
  336|  2.70M|                    {
  337|  2.70M|                        pu2_dst[i] = pu2_ref_u;
  338|  2.70M|                        pu2_dst[i + 1 ] = pu2_ref_v;
  339|  2.70M|                    }
  340|   675k|                }
  341|  88.8k|                else /* If top, top-right are available */
  342|  88.8k|                {
  343|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available */
  344|  88.8k|                    idx = (nt * (next - 1)) + 1;
  345|  88.8k|                    pu2_ref_u = pu2_dst[2 * idx];
  346|  88.8k|                    pu2_ref_v = pu2_dst[(2 * idx) + 1];
  347|   890k|                    for(i = 0; i < (2 * idx); i+=2)
  ------------------
  |  Branch (347:32): [True: 802k, False: 88.8k]
  ------------------
  348|   802k|                    {
  349|   802k|                        pu2_dst[i] = pu2_ref_u;
  350|   802k|                        pu2_dst[i + 1] = pu2_ref_v;
  351|   802k|                    }
  352|  88.8k|                }
  353|   764k|            }
  354|       |
  355|  1.86M|            if(left == 0)
  ------------------
  |  Branch (355:16): [True: 89.6k, False: 1.77M]
  ------------------
  356|  89.6k|            {
  357|   448k|                for(i = 0; i < (2 * nt); i+=2)
  ------------------
  |  Branch (357:28): [True: 358k, False: 89.6k]
  ------------------
  358|   358k|                {
  359|   358k|                    pu2_dst[(2 * nt) + i] = pu2_dst[(2 * nt) - 2];
  360|   358k|                    pu2_dst[(2 * nt) + 1 + i] = pu2_dst[(2 * nt) - 1];
  361|   358k|                }
  362|  89.6k|            }
  363|  1.86M|            if(tp_left == 0)
  ------------------
  |  Branch (363:16): [True: 157k, False: 1.70M]
  ------------------
  364|   157k|            {
  365|   157k|                pu2_dst[4 * nt] = pu2_dst[(4 * nt) - 2];
  366|   157k|                pu2_dst[(4 * nt) + 1] = pu2_dst[(4 * nt) - 1];
  367|   157k|            }
  368|  1.86M|            if(top == 0)
  ------------------
  |  Branch (368:16): [True: 68.0k, False: 1.79M]
  ------------------
  369|  68.0k|            {
  370|   340k|                for(i = 0; i < (2 * nt); i+=2)
  ------------------
  |  Branch (370:28): [True: 272k, False: 68.0k]
  ------------------
  371|   272k|                {
  372|   272k|                    pu2_dst[(4 * nt) + 2 + i] = pu2_dst[(4 * nt)];
  373|   272k|                    pu2_dst[(4 * nt) + 3 + i] = pu2_dst[(4 * nt) + 1];
  374|   272k|                }
  375|  68.0k|            }
  376|  1.86M|            if(tp_right == 0)
  ------------------
  |  Branch (376:16): [True: 1.27M, False: 587k]
  ------------------
  377|  1.27M|            {
  378|  6.36M|                for(i = 0; i < (2 * nt); i+=2)
  ------------------
  |  Branch (378:28): [True: 5.09M, False: 1.27M]
  ------------------
  379|  5.09M|                {
  380|  5.09M|                    pu2_dst[(6 * nt) + 2 + i] = pu2_dst[(6 * nt)];
  381|  5.09M|                    pu2_dst[(6 * nt) + 3 + i] = pu2_dst[(6 * nt) + 1];
  382|  5.09M|                }
  383|  1.27M|            }
  384|  1.86M|        }
  385|  1.75M|        else if(nt == 8 || (nt == 16 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (385:17): [True: 627k, False: 1.12M]
  |  Branch (385:29): [True: 1.12M, False: 18.4E]
  |  Branch (385:41): [True: 0, False: 1.12M]
  ------------------
  386|   649k|        {
  387|   649k|            WORD32 nbr_flags_temp = 0;
  388|   649k|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (388:33): [True: 0, False: 649k]
  ------------------
  389|   649k|            nbr_flags_temp = ((nbr_flags & 0xC)>>2) + ((nbr_flags & 0xC0) >> 4)
  390|   649k|                            + ((nbr_flags & 0x300) >> 4)
  391|   649k|                            + ((nbr_flags & 0x3000) >> 6)
  392|   649k|                            + ((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|   649k|            {
  397|   649k|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * (4 * sub_sample); /* for bottom left and left */
  ------------------
  |  |   43|   649k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 48.9k, False: 600k]
  |  |  ------------------
  ------------------
  398|   649k|                if(nbr_id_from_bl == (32 * sub_sample))
  ------------------
  |  Branch (398:20): [True: 48.9k, False: 600k]
  ------------------
  399|  48.9k|                {
  400|  48.9k|                    nbr_id_from_bl = (16 * sub_sample);
  401|  48.9k|                }
  402|   649k|                if(nbr_id_from_bl == (16 * sub_sample))
  ------------------
  |  Branch (402:20): [True: 48.9k, False: 600k]
  ------------------
  403|  48.9k|                {
  404|       |                    /* for top left : 1 pel per nbr bit */
  405|  48.9k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (405:24): [True: 48.1k, False: 707]
  ------------------
  406|  48.1k|                    {
  407|  48.1k|                        nbr_id_from_bl++;
  408|  48.1k|                        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|  48.1k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 48.1k]
  |  |  ------------------
  ------------------
  409|       |
  410|  48.1k|                    }
  411|  48.9k|                }
  412|       |                /* Reverse Substitution Process */
  413|   649k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (413:20): [True: 353k, False: 295k]
  ------------------
  414|   353k|                {
  415|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  416|   353k|                    pu2_ref_u = pu2_dst[2 * nbr_id_from_bl];
  417|   353k|                    pu2_ref_v = pu2_dst[(2 * nbr_id_from_bl) + 1];
  418|  3.61M|                    for(i = 2 * (nbr_id_from_bl - 1); i >= 0; i-=2)
  ------------------
  |  Branch (418:55): [True: 3.26M, False: 353k]
  ------------------
  419|  3.26M|                    {
  420|  3.26M|                        pu2_dst[i] = pu2_ref_u;
  421|  3.26M|                        pu2_dst[i + 1] = pu2_ref_v;
  422|  3.26M|                    }
  423|   353k|                }
  424|   649k|            }
  425|       |
  426|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  427|  5.63M|            while(nbr_id_from_bl < ((T8C_4NT * sub_sample) + 1))
  ------------------
  |  |   81|  5.63M|#define T8C_4NT 32
  ------------------
  |  Branch (427:19): [True: 4.98M, False: 649k]
  ------------------
  428|  4.98M|            {
  429|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  430|       |                /* Divide by 8 to obtain the original index */
  431|  4.98M|                frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2));
  ------------------
  |  Branch (431:53): [True: 0, False: 4.98M]
  ------------------
  432|       |
  433|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  434|  4.98M|                if(nbr_id_from_bl == (T8C_4NT * sub_sample / 2))
  ------------------
  |  |   81|  4.98M|#define T8C_4NT 32
  ------------------
  |  Branch (434:20): [True: 600k, False: 4.38M]
  ------------------
  435|   600k|                {
  436|   600k|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|   600k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  437|       |
  438|       |                    /* only pel substitution for TL */
  439|   600k|                    if(!get_bits)
  ------------------
  |  Branch (439:24): [True: 59.1k, False: 541k]
  ------------------
  440|  59.1k|                    {
  441|  59.1k|                        pu2_dst[2 * nbr_id_from_bl] = pu2_dst[(2 * nbr_id_from_bl) - 2];
  442|  59.1k|                        pu2_dst[(2 * nbr_id_from_bl) + 1] = pu2_dst[(2 * nbr_id_from_bl) - 1];
  443|  59.1k|                    }
  444|   600k|                }
  445|  4.38M|                else
  446|  4.38M|                {
  447|  4.38M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  4.38M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  448|  4.38M|                    if(!get_bits)
  ------------------
  |  Branch (448:24): [True: 913k, False: 3.47M]
  ------------------
  449|   913k|                    {
  450|       |                        /* 8 pel substitution (other than TL) */
  451|   913k|                        pu2_ref_u = pu2_dst[(2 * nbr_id_from_bl) - 2];
  452|   913k|                        pu2_ref_v = pu2_dst[(2 * nbr_id_from_bl) - 1];
  453|  4.56M|                        for(i = 0; i < 8 * sub_sample; i += 2)
  ------------------
  |  Branch (453:36): [True: 3.65M, False: 913k]
  ------------------
  454|  3.65M|                        {
  455|  3.65M|                            pu2_dst[(2 * nbr_id_from_bl) + i] = pu2_ref_u;
  456|  3.65M|                            pu2_dst[(2 * nbr_id_from_bl) + 1 + i] = pu2_ref_v;
  457|  3.65M|                        }
  458|   913k|                    }
  459|  4.38M|                }
  460|  4.98M|                nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   81|  4.98M|#define T8C_4NT 32
  ------------------
  |  Branch (460:35): [True: 600k, False: 4.38M]
  ------------------
  461|  4.98M|            }
  462|   649k|        }
  463|  1.10M|        else if(nt == 16 || (nt == 32 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (463:17): [True: 1.10M, False: 0]
  |  Branch (463:30): [True: 0, False: 0]
  |  Branch (463:42): [True: 0, False: 0]
  ------------------
  464|  1.12M|        {
  465|  1.12M|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (465:33): [True: 0, False: 1.12M]
  ------------------
  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|  1.12M|            {
  469|  1.12M|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4 * sub_sample; /* for bottom left and left */
  ------------------
  |  |   43|  1.12M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 50.8k, False: 1.07M]
  |  |  ------------------
  ------------------
  470|       |
  471|  1.12M|                if(nbr_id_from_bl == 32 * sub_sample)
  ------------------
  |  Branch (471:20): [True: 50.8k, False: 1.07M]
  ------------------
  472|  50.8k|                {
  473|       |                    /* for top left : 1 pel per nbr bit */
  474|  50.8k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (474:24): [True: 50.5k, False: 210]
  ------------------
  475|  50.5k|                    {
  476|       |                        /* top left not available */
  477|  50.5k|                        nbr_id_from_bl++;
  478|       |                        /* top and top right;  4 pels per nbr bit */
  479|  50.5k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4 * sub_sample;
  ------------------
  |  |   43|  50.5k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 50.5k]
  |  |  ------------------
  ------------------
  480|  50.5k|                    }
  481|  50.8k|                }
  482|       |                /* Reverse Substitution Process */
  483|  1.12M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (483:20): [True: 464k, False: 662k]
  ------------------
  484|   464k|                {
  485|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  486|   464k|                    pu2_ref_u = pu2_dst[2 * nbr_id_from_bl];
  487|   464k|                    pu2_ref_v = pu2_dst[2 * nbr_id_from_bl + 1];
  488|  8.74M|                    for(i = (2 * (nbr_id_from_bl - 1)); i >= 0; i-=2)
  ------------------
  |  Branch (488:57): [True: 8.28M, False: 464k]
  ------------------
  489|  8.28M|                    {
  490|  8.28M|                        pu2_dst[i] = pu2_ref_u;
  491|  8.28M|                        pu2_dst[i + 1] = pu2_ref_v;
  492|  8.28M|                    }
  493|   464k|                }
  494|  1.12M|            }
  495|       |
  496|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  497|  18.1M|            while(nbr_id_from_bl < ((T16C_4NT * sub_sample) + 1))
  ------------------
  |  |   80|  18.1M|#define T16C_4NT 64
  ------------------
  |  Branch (497:19): [True: 16.9M, False: 1.12M]
  ------------------
  498|  16.9M|            {
  499|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  500|       |                /* Divide by 4 to obtain the original index */
  501|  16.9M|                frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2));
  ------------------
  |  Branch (501:53): [True: 0, False: 16.9M]
  ------------------
  502|       |
  503|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  504|  16.9M|                if(nbr_id_from_bl == (T16C_4NT * sub_sample / 2))
  ------------------
  |  |   80|  16.9M|#define T16C_4NT 64
  ------------------
  |  Branch (504:20): [True: 1.07M, False: 15.9M]
  ------------------
  505|  1.07M|                {
  506|  1.07M|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|  1.07M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  507|       |                    /* only pel substitution for TL */
  508|  1.07M|                    if(!get_bits)
  ------------------
  |  Branch (508:24): [True: 167k, False: 908k]
  ------------------
  509|   167k|                    {
  510|   167k|                        pu2_dst[2 * nbr_id_from_bl] = pu2_dst[(2 * nbr_id_from_bl) - 2];
  511|   167k|                        pu2_dst[(2 * nbr_id_from_bl) + 1] = pu2_dst[(2 * nbr_id_from_bl) - 1];
  512|   167k|                    }
  513|  1.07M|                }
  514|  15.9M|                else
  515|  15.9M|                {
  516|  15.9M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  15.9M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  517|  15.9M|                    if(!get_bits)
  ------------------
  |  Branch (517:24): [True: 4.15M, False: 11.7M]
  ------------------
  518|  4.15M|                    {
  519|       |                        /* 4 pel substitution (other than TL) */
  520|  4.15M|                        pu2_ref_u = pu2_dst[(2 * nbr_id_from_bl) - 2];
  521|  4.15M|                        pu2_ref_v = pu2_dst[(2 * nbr_id_from_bl) - 1];
  522|  20.7M|                        for(i = 0; i < 4 * sub_sample; i++)
  ------------------
  |  Branch (522:36): [True: 16.6M, False: 4.15M]
  ------------------
  523|  16.6M|                        {
  524|  16.6M|                            pu2_dst[(2 * nbr_id_from_bl) + 2 * i] = pu2_ref_u;
  525|  16.6M|                            pu2_dst[(2 * nbr_id_from_bl) + 1 + 2 * i] = pu2_ref_v;
  526|  16.6M|                        }
  527|  4.15M|                    }
  528|  15.9M|                }
  529|  16.9M|                nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   80|  16.9M|#define T16C_4NT 64
  ------------------
  |  Branch (529:35): [True: 1.07M, False: 15.9M]
  ------------------
  530|  16.9M|            }
  531|  1.12M|        }
  532|  3.61M|    }
  533|  3.64M|}
ihevc_hbd_intra_pred_chroma_planar:
  580|  1.12M|{
  581|  1.12M|    WORD32 row, col;
  582|  1.12M|    WORD32 log2nt = 5;
  583|  1.12M|    WORD32 two_nt, three_nt;
  584|       |
  585|  1.12M|    switch(nt)
  586|  1.12M|    {
  587|   407k|        case 16:
  ------------------
  |  Branch (587:9): [True: 407k, False: 712k]
  ------------------
  588|   407k|            log2nt = 4;
  589|   407k|            break;
  590|   195k|        case 8:
  ------------------
  |  Branch (590:9): [True: 195k, False: 924k]
  ------------------
  591|   195k|            log2nt = 3;
  592|   195k|            break;
  593|   517k|        case 4:
  ------------------
  |  Branch (593:9): [True: 517k, False: 602k]
  ------------------
  594|   517k|            log2nt = 2;
  595|   517k|            break;
  596|      0|        default:
  ------------------
  |  Branch (596:9): [True: 0, False: 1.12M]
  ------------------
  597|      0|            break;
  598|  1.12M|    }
  599|  1.12M|    two_nt = 2 * nt;
  600|  1.12M|    three_nt = 3 * nt;
  601|       |    /* Planar filtering */
  602|  11.0M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (602:18): [True: 9.90M, False: 1.12M]
  ------------------
  603|  9.90M|    {
  604|   131M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (604:22): [True: 121M, False: 9.90M]
  ------------------
  605|   121M|        {
  606|   121M|            pu2_dst[row * dst_strd + col] = ((nt - 1 - col / 2)
  607|   121M|                            * pu2_ref[2 * (two_nt - 1 - row)]
  608|   121M|                            + (col / 2 + 1) * pu2_ref[2 * (three_nt + 1)]
  609|   121M|                            + (nt - 1 - row) * pu2_ref[2 * (two_nt + 1) + col]
  610|   121M|                            + (row + 1) * pu2_ref[2 * (nt - 1)] + nt) >> (log2nt + 1);
  611|       |
  612|   121M|            pu2_dst[row * dst_strd + col + 1] = ((nt - 1 - col / 2)
  613|   121M|                            * pu2_ref[2 * (two_nt - 1 - row) + 1]
  614|   121M|                            + (col / 2 + 1) * pu2_ref[2 * (three_nt + 1) + 1]
  615|   121M|                            + (nt - 1 - row) * pu2_ref[2 * (two_nt + 1) + col + 1]
  616|   121M|                            + (row + 1) * pu2_ref[2 * (nt - 1) + 1] + nt) >> (log2nt + 1);
  617|   121M|        }
  618|  9.90M|    }
  619|  1.12M|}
ihevc_hbd_intra_pred_chroma_dc:
  666|   631k|{
  667|   631k|    WORD32 acc_dc_u, acc_dc_v;
  668|   631k|    WORD32 dc_val_u , dc_val_v;
  669|   631k|    WORD32 i;
  670|   631k|    WORD32 row, col;
  671|   631k|    WORD32 log2nt = 5;
  672|       |
  673|   631k|    switch(nt)
  674|   631k|    {
  675|      0|        case 32:
  ------------------
  |  Branch (675:9): [True: 0, False: 631k]
  ------------------
  676|      0|            log2nt = 5;
  677|      0|            break;
  678|   191k|        case 16:
  ------------------
  |  Branch (678:9): [True: 191k, False: 439k]
  ------------------
  679|   191k|            log2nt = 4;
  680|   191k|            break;
  681|   118k|        case 8:
  ------------------
  |  Branch (681:9): [True: 118k, False: 513k]
  ------------------
  682|   118k|            log2nt = 3;
  683|   118k|            break;
  684|   321k|        case 4:
  ------------------
  |  Branch (684:9): [True: 321k, False: 309k]
  ------------------
  685|   321k|            log2nt = 2;
  686|   321k|            break;
  687|      0|        default:
  ------------------
  |  Branch (687:9): [True: 0, False: 631k]
  ------------------
  688|      0|            break;
  689|   631k|    }
  690|       |
  691|   631k|    acc_dc_u = 0;
  692|   631k|    acc_dc_v = 0;
  693|       |    /* Calculate DC value for the transform block */
  694|  5.92M|    for(i = (2 * nt); i < (4 * nt); i+=2)
  ------------------
  |  Branch (694:23): [True: 5.29M, False: 631k]
  ------------------
  695|  5.29M|    {
  696|  5.29M|        acc_dc_u += pu2_ref[i];
  697|  5.29M|        acc_dc_v += pu2_ref[i+1];
  698|  5.29M|    }
  699|  5.92M|    for(i = ((4 * nt) + 2); i < ((6 * nt) + 2); i+=2)
  ------------------
  |  Branch (699:29): [True: 5.29M, False: 631k]
  ------------------
  700|  5.29M|    {
  701|  5.29M|        acc_dc_u += pu2_ref[i];
  702|  5.29M|        acc_dc_v += pu2_ref[i+1];
  703|  5.29M|    }
  704|       |
  705|   631k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  706|   631k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  707|       |
  708|       |    /* Fill the remaining rows with DC value */
  709|  5.90M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (709:18): [True: 5.27M, False: 631k]
  ------------------
  710|  5.27M|    {
  711|  66.6M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (711:22): [True: 61.3M, False: 5.27M]
  ------------------
  712|  61.3M|        {
  713|  61.3M|            pu2_dst[(row * dst_strd) + col] = dc_val_u;
  714|  61.3M|            pu2_dst[(row * dst_strd) + col + 1] = dc_val_v;
  715|  61.3M|        }
  716|  5.27M|    }
  717|   631k|}
ihevc_hbd_intra_pred_chroma_horz:
  764|   126k|{
  765|   126k|    WORD32 row, col;
  766|       |
  767|       |    /* Replication to next rows */
  768|  1.16M|    for(row = 0; row < nt ; row++)
  ------------------
  |  Branch (768:18): [True: 1.03M, False: 126k]
  ------------------
  769|  1.03M|    {
  770|  13.0M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (770:22): [True: 12.0M, False: 1.03M]
  ------------------
  771|  12.0M|        {
  772|  12.0M|            pu2_dst[(row * dst_strd) + col] = pu2_ref[(4 * nt) - 2 - 2 * row];
  773|  12.0M|            pu2_dst[(row * dst_strd) + col+1] = pu2_ref[(4 * nt) - 1 - 2 * row];
  774|  12.0M|        }
  775|  1.03M|    }
  776|   126k|}
ihevc_hbd_intra_pred_chroma_ver:
  824|   550k|{
  825|   550k|    WORD32 row, col;
  826|       |
  827|       |    /* Replication to next columns */
  828|  5.33M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (828:18): [True: 4.78M, False: 550k]
  ------------------
  829|  4.78M|    {
  830|  61.6M|        for(col =0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (830:21): [True: 56.8M, False: 4.78M]
  ------------------
  831|  56.8M|        {
  832|  56.8M|            pu2_dst[(row * dst_strd) + col] = pu2_ref[(4 * nt) + 2 + col];
  833|  56.8M|            pu2_dst[(row * dst_strd) + col+1] = pu2_ref[(4 * nt) + 3 + col];
  834|  56.8M|        }
  835|  4.78M|    }
  836|   550k|}
ihevc_hbd_intra_pred_chroma_mode2:
  883|   296k|{
  884|   296k|    WORD32 row, col;
  885|       |
  886|   296k|    WORD32 intra_pred_ang = 32;
  887|   296k|    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|  2.56M|    for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (891:18): [True: 2.26M, False: 296k]
  ------------------
  892|  2.26M|    {
  893|  2.26M|        idx_u = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  894|  2.26M|        idx_v = (((col + 1) + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  895|  27.6M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (895:22): [True: 25.4M, False: 2.26M]
  ------------------
  896|  25.4M|        {
  897|  25.4M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[(4 * nt) - 2 * row - idx_u - 3];
  898|  25.4M|            pu2_dst[(col + 1) + (row * dst_strd)] = pu2_ref[(4 * nt) - 2 * row - idx_v - 1];
  899|  25.4M|        }
  900|  2.26M|    }
  901|   296k|}
ihevc_hbd_intra_pred_chroma_mode_18_34:
  948|  37.8k|{
  949|  37.8k|    WORD32 row, col;
  950|  37.8k|    WORD32 intra_pred_ang;
  951|  37.8k|    WORD32 idx = 0;
  952|       |
  953|  37.8k|    intra_pred_ang = 32; /* Default value */
  954|       |    /* For mode 18, angle is -45degree */
  955|  37.8k|    if(mode == 18)
  ------------------
  |  Branch (955:8): [True: 29.3k, False: 8.53k]
  ------------------
  956|  29.3k|    {
  957|  29.3k|        intra_pred_ang = -32;
  958|  29.3k|    }
  959|       |    /* For mode 34, angle is 45degree */
  960|  8.53k|    else if(mode == 34)
  ------------------
  |  Branch (960:13): [True: 8.53k, False: 0]
  ------------------
  961|  8.53k|    {
  962|  8.53k|        intra_pred_ang = 32;
  963|  8.53k|    }
  964|       |    /* For the angle 45 and -45, replication is done from the corresponding angle */
  965|       |    /* No interpolation is done for 45 degree */
  966|   341k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (966:18): [True: 303k, False: 37.8k]
  ------------------
  967|   303k|    {
  968|   303k|        idx = ((row + 1) * intra_pred_ang) >> 5;
  969|       |
  970|  3.72M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (970:22): [True: 3.42M, False: 303k]
  ------------------
  971|  3.42M|        {
  972|  3.42M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[(4 * nt) + col + 2 * idx + 2];
  973|  3.42M|            pu2_dst[(col + 1) + (row * dst_strd)] = pu2_ref[(4 * nt) + (col + 1) + 2 * idx + 2];
  974|  3.42M|        }
  975|   303k|    }
  976|  37.8k|}
ihevc_hbd_intra_pred_chroma_mode_3_to_9:
 1023|   119k|{
 1024|   119k|    WORD32 row, col;
 1025|   119k|    WORD32 intra_pred_ang;
 1026|   119k|    WORD32 idx_u, ref_main_idx_u;
 1027|   119k|    WORD32 idx_v, ref_main_idx_v;
 1028|   119k|    WORD32 pos_u, fract_u;
 1029|   119k|    WORD32 pos_v, fract_v;
 1030|       |
 1031|       |    /* Intra Pred Angle according to the mode */
 1032|   119k|    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|  1.00M|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1037:18): [True: 887k, False: 119k]
  ------------------
 1038|   887k|    {
 1039|   887k|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1040|   887k|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1041|       |
 1042|   887k|        idx_u = pos_u >> 5;
 1043|   887k|        fract_u = pos_u & (31);
 1044|       |
 1045|   887k|        idx_v = pos_v >> 5;
 1046|   887k|        fract_v = pos_v & (31);
 1047|       |        // Do linear filtering
 1048|  10.3M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1048:22): [True: 9.45M, False: 887k]
  ------------------
 1049|  9.45M|        {
 1050|  9.45M|            ref_main_idx_u = (4 * nt) - 2 * row - 2 * idx_u - 2;
 1051|  9.45M|            ref_main_idx_v = (4 * nt) - 2 * row - 2 * idx_v - 1;
 1052|       |
 1053|  9.45M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract_u)
 1054|  9.45M|                            * pu2_ref[ref_main_idx_u]
 1055|  9.45M|                            + fract_u * pu2_ref[ref_main_idx_u - 2] + 16) >> 5 );
 1056|       |
 1057|  9.45M|            pu2_dst[(col + 1) + (row * dst_strd)] = (((32 - fract_v)
 1058|  9.45M|                            * pu2_ref[ref_main_idx_v]
 1059|  9.45M|                            + fract_v * pu2_ref[ref_main_idx_v - 2] + 16) >> 5 );
 1060|  9.45M|        }
 1061|   887k|    }
 1062|   119k|}
ihevc_hbd_intra_pred_chroma_mode_11_to_17:
 1109|   135k|{
 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|   135k|    WORD32 row, col, k;
 1115|   135k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1116|   135k|    WORD32 idx_u, idx_v, ref_main_idx_u, ref_main_idx_v, ref_idx;
 1117|   135k|    WORD32 pos_u, pos_v, fract_u, fract_v;
 1118|       |
 1119|   135k|    UWORD16 ref_temp[2 * MAX_CU_SIZE + 2];
 1120|   135k|    UWORD16 *ref_main;
 1121|   135k|    inv_ang_sum = 128;
 1122|       |
 1123|   135k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1124|       |
 1125|   135k|    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|   135k|    ref_main = ref_temp + 2*nt;
 1132|  1.30M|    for(k = 0; k < (2 * (nt + 1)); k+=2)
  ------------------
  |  Branch (1132:16): [True: 1.16M, False: 135k]
  ------------------
 1133|  1.16M|    {
 1134|  1.16M|        ref_temp[k + (2* (nt - 1))] = pu2_ref[(4 * nt) - k];
 1135|  1.16M|        ref_temp[k + 1+ (2* (nt - 1))] = pu2_ref[(4 * nt) - k + 1];
 1136|  1.16M|    }
 1137|       |
 1138|   135k|    ref_main = ref_temp + (2 * (nt - 1));
 1139|   135k|    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|   547k|    for(k = -2; k > (2 * ref_idx); k-=2)
  ------------------
  |  Branch (1144:17): [True: 411k, False: 135k]
  ------------------
 1145|   411k|    {
 1146|   411k|        inv_ang_sum += inv_ang;
 1147|   411k|        ref_main[k] = pu2_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1148|   411k|        ref_main[k + 1] = pu2_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1149|   411k|    }
 1150|       |
 1151|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1152|       |    /* samples dependent on distance to obtain destination sample */
 1153|  1.16M|    for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (1153:18): [True: 1.03M, False: 135k]
  ------------------
 1154|  1.03M|    {
 1155|  1.03M|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1156|  1.03M|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1157|  1.03M|        idx_u = pos_u >> 5;
 1158|  1.03M|        idx_v = pos_v >> 5;
 1159|  1.03M|        fract_u = pos_u & (31);
 1160|  1.03M|        fract_v = pos_v & (31);
 1161|       |
 1162|       |        // Do linear filtering
 1163|  11.7M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1163:22): [True: 10.7M, False: 1.03M]
  ------------------
 1164|  10.7M|        {
 1165|  10.7M|            ref_main_idx_u = 2 * (row + idx_u + 1);
 1166|  10.7M|            ref_main_idx_v = 2 * (row + idx_v + 1) + 1;
 1167|       |
 1168|  10.7M|            pu2_dst[col + (dst_strd * row)] = (UWORD16)(((32 - fract_u)
 1169|  10.7M|                            * ref_main[ref_main_idx_u]
 1170|  10.7M|                            + fract_u * ref_main[ref_main_idx_u + 2] + 16) >> 5 );
 1171|  10.7M|            pu2_dst[(col + 1) + (dst_strd * row)] = (UWORD16)(((32 - fract_v)
 1172|  10.7M|                                        * ref_main[ref_main_idx_v]
 1173|  10.7M|                                        + fract_v * ref_main[ref_main_idx_v + 2] + 16) >> 5 );
 1174|  10.7M|        }
 1175|  1.03M|    }
 1176|   135k|}
ihevc_hbd_intra_pred_chroma_mode_19_to_25:
 1224|   323k|{
 1225|   323k|    WORD32 row, col, k;
 1226|   323k|    WORD32 intra_pred_ang, idx;
 1227|   323k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1228|   323k|    WORD32 ref_main_idx_u, ref_main_idx_v, ref_idx;
 1229|   323k|    UWORD16 ref_temp[(2 * MAX_CU_SIZE) + 2];
 1230|   323k|    UWORD16 *ref_main;
 1231|       |
 1232|   323k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1233|   323k|    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|   323k|    ref_main = ref_temp + 2*nt;
 1239|  3.14M|    for(k = 0; k < (2 * (nt + 1)); k+=2)
  ------------------
  |  Branch (1239:16): [True: 2.82M, False: 323k]
  ------------------
 1240|  2.82M|    {
 1241|  2.82M|        ref_temp[k + (2* (nt - 1))] = pu2_ref[(4 * nt) + k];
 1242|  2.82M|        ref_temp[k + 1 + (2* (nt - 1))] = pu2_ref[(4 * nt) + k + 1];
 1243|  2.82M|    }
 1244|       |
 1245|   323k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1246|   323k|    inv_ang_sum = 128;
 1247|   323k|    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|  1.01M|    for(k = -2; k > (2 * ref_idx) ; k-=2)
  ------------------
  |  Branch (1251:17): [True: 695k, False: 323k]
  ------------------
 1252|   695k|    {
 1253|   695k|        inv_ang_sum += inv_ang;
 1254|   695k|        ref_main[k] = pu2_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 1255|   695k|        ref_main[k + 1] = pu2_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 1256|   695k|    }
 1257|       |
 1258|  2.81M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1258:18): [True: 2.48M, False: 323k]
  ------------------
 1259|  2.48M|    {
 1260|  2.48M|        pos = ((row + 1) * intra_pred_ang);
 1261|  2.48M|        idx = pos >> 5;
 1262|  2.48M|        fract = pos & (31);
 1263|       |
 1264|       |        // Do linear filtering
 1265|  29.9M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (1265:22): [True: 27.4M, False: 2.48M]
  ------------------
 1266|  27.4M|        {
 1267|  27.4M|            ref_main_idx_u = col + 2 * idx + 2;
 1268|  27.4M|            ref_main_idx_v = (col + 1) + 2 * idx + 2;
 1269|  27.4M|            pu2_dst[(row * dst_strd) + col] = (UWORD16)(((32 - fract)
 1270|  27.4M|                            * ref_main[ref_main_idx_u]
 1271|  27.4M|                            + fract * ref_main[ref_main_idx_u + 2] + 16) >> 5 );
 1272|  27.4M|            pu2_dst[(row * dst_strd) + (col + 1)] = (UWORD16)(((32 - fract)
 1273|  27.4M|                                        * ref_main[ref_main_idx_v]
 1274|  27.4M|                                        + fract * ref_main[ref_main_idx_v + 2] + 16) >> 5 );
 1275|  27.4M|        }
 1276|  2.48M|    }
 1277|   323k|}
ihevc_hbd_intra_pred_chroma_mode_27_to_33:
 1322|   326k|{
 1323|   326k|    WORD32 row, col ;
 1324|   326k|    WORD32 pos, fract;
 1325|   326k|    WORD32 intra_pred_ang;
 1326|   326k|    WORD32 idx, ref_main_idx_u, ref_main_idx_v;
 1327|       |
 1328|   326k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1329|       |
 1330|  3.02M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1330:18): [True: 2.69M, False: 326k]
  ------------------
 1331|  2.69M|    {
 1332|  2.69M|        pos = ((row + 1) * intra_pred_ang);
 1333|  2.69M|        idx = pos >> 5;
 1334|  2.69M|        fract = pos & (31);
 1335|       |
 1336|       |        // Do linear filtering
 1337|  33.8M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (1337:22): [True: 31.1M, False: 2.69M]
  ------------------
 1338|  31.1M|        {
 1339|  31.1M|            ref_main_idx_u = (4 * nt) + col + 2 * idx + 2;
 1340|  31.1M|            ref_main_idx_v = (4 * nt) + (col + 1) + 2 * idx + 2;
 1341|  31.1M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract)
 1342|  31.1M|                            * pu2_ref[ref_main_idx_u]
 1343|  31.1M|                            + fract * pu2_ref[ref_main_idx_u + 2] + 16) >> 5 );
 1344|  31.1M|            pu2_dst[(col+1) + (row * dst_strd)] = (((32 - fract)
 1345|  31.1M|                                        * pu2_ref[ref_main_idx_v]
 1346|  31.1M|                                        + fract * pu2_ref[ref_main_idx_v + 2] + 16) >> 5 );
 1347|  31.1M|        }
 1348|  2.69M|    }
 1349|   326k|}

ihevc_hbd_chroma_itrans_recon_4x4:
  117|   265k|{
  118|   265k|    WORD32 j;
  119|   265k|    WORD32 e[2], o[2];
  120|   265k|    WORD32 add;
  121|   265k|    WORD32 shift;
  122|   265k|    WORD16 *pi2_tmp_orig;
  123|   265k|    WORD32 trans_size;
  124|   265k|    WORD16 clip_limit;
  125|       |
  126|   265k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   265k|#define TRANS_SIZE_4   4
  ------------------
  127|       |
  128|   265k|    pi2_tmp_orig = pi2_tmp;
  129|       |
  130|       |    /* Inverse Transform 1st stage */
  131|   265k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   265k|#define IT_SHIFT_STAGE_1 7
  ------------------
  132|   265k|    add = 1 << (shift - 1);
  133|       |
  134|  1.32M|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (134:16): [True: 1.06M, False: 265k]
  ------------------
  135|  1.06M|    {
  136|       |        /* Checking for Zero Cols */
  137|  1.06M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (137:12): [True: 568k, False: 492k]
  ------------------
  138|   568k|        {
  139|   568k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  140|   568k|        }
  141|   492k|        else
  142|   492k|        {
  143|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  144|   492k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  145|   492k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  146|   492k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  147|   492k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  148|   492k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  149|   492k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  150|   492k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  151|   492k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  152|       |
  153|   492k|            pi2_tmp[0] =
  154|   492k|                            CLIP_S16( ((e[0] + o[0] + add)>>shift) );
  ------------------
  |  |   53|   492k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   492k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 512, False: 491k]
  |  |  |  |  |  Branch (40:53): [True: 459, False: 491k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|   492k|            pi2_tmp[1] =
  156|   492k|                            CLIP_S16( ((e[1] + o[1] + add)>>shift) );
  ------------------
  |  |   53|   492k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   492k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 132, False: 492k]
  |  |  |  |  |  Branch (40:53): [True: 266, False: 491k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|   492k|            pi2_tmp[2] =
  158|   492k|                            CLIP_S16( ((e[1] - o[1] + add)>>shift) );
  ------------------
  |  |   53|   492k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   492k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 90, False: 492k]
  |  |  |  |  |  Branch (40:53): [True: 251, False: 491k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|   492k|            pi2_tmp[3] =
  160|   492k|                            CLIP_S16( ((e[0] - o[0] + add)>>shift) );
  ------------------
  |  |   53|   492k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   492k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 247, False: 491k]
  |  |  |  |  |  Branch (40:53): [True: 356, False: 491k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|   492k|        }
  162|  1.06M|        pi2_src++;
  163|  1.06M|        pi2_tmp += trans_size;
  164|  1.06M|        zero_cols = zero_cols >> 1;
  165|  1.06M|    }
  166|       |
  167|   265k|    pi2_tmp = pi2_tmp_orig;
  168|       |
  169|       |    /* Inverse Transform 2nd stage */
  170|   265k|    shift = 20 - u1_bit_depth;
  171|   265k|    add = 1 << (shift - 1);
  172|   265k|    clip_limit = (1 << u1_bit_depth) - 1;
  173|       |
  174|  1.32M|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (174:16): [True: 1.06M, False: 265k]
  ------------------
  175|  1.06M|    {
  176|  1.06M|        WORD32 itrans_out;
  177|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  178|  1.06M|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  179|  1.06M|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  180|  1.06M|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  181|  1.06M|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  182|  1.06M|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  183|  1.06M|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  184|  1.06M|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  185|  1.06M|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  186|       |
  187|  1.06M|        itrans_out =
  188|  1.06M|                        CLIP_S16( ((e[0] + o[0] + add)>>shift ) );
  ------------------
  |  |   53|  1.06M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|  1.06M|        pu2_dst[0 * 2] = CLIP3( (itrans_out + pu2_pred[0 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 104k, False: 956k]
  |  |  |  Branch (40:53): [True: 60.5k, False: 895k]
  |  |  ------------------
  ------------------
  190|  1.06M|        itrans_out =
  191|  1.06M|                        CLIP_S16( ((e[1] + o[1] + add)>>shift ) );
  ------------------
  |  |   53|  1.06M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  1.06M|        pu2_dst[1 * 2] = CLIP3( (itrans_out + pu2_pred[1 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 79.7k, False: 980k]
  |  |  |  Branch (40:53): [True: 48.6k, False: 932k]
  |  |  ------------------
  ------------------
  193|  1.06M|        itrans_out =
  194|  1.06M|                        CLIP_S16( ((e[1] - o[1] + add)>>shift ) );
  ------------------
  |  |   53|  1.06M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  1.06M|        pu2_dst[2 * 2] = CLIP3( (itrans_out + pu2_pred[2 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 72.7k, False: 987k]
  |  |  |  Branch (40:53): [True: 78.4k, False: 909k]
  |  |  ------------------
  ------------------
  196|  1.06M|        itrans_out =
  197|  1.06M|                        CLIP_S16( ((e[0] - o[0] + add)>>shift ));
  ------------------
  |  |   53|  1.06M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  1.06M|        pu2_dst[3 * 2] = CLIP3( (itrans_out + pu2_pred[3 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|  1.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 81.2k, False: 979k]
  |  |  |  Branch (40:53): [True: 103k, False: 875k]
  |  |  ------------------
  ------------------
  199|       |
  200|  1.06M|        pi2_tmp++;
  201|  1.06M|        pu2_pred += pred_strd;
  202|  1.06M|        pu2_dst += dst_strd;
  203|  1.06M|    }
  204|   265k|}

ihevc_hbd_chroma_itrans_recon_16x16:
  115|   176k|{
  116|   176k|    WORD32 j, k;
  117|   176k|    WORD32 e[8], o[8];
  118|   176k|    WORD32 ee[4], eo[4];
  119|   176k|    WORD32 eee[2], eeo[2];
  120|   176k|    WORD32 add;
  121|   176k|    WORD32 shift;
  122|   176k|    WORD16 *pi2_tmp_orig;
  123|   176k|    WORD32 trans_size;
  124|   176k|    WORD16 clip_limit;
  125|   176k|    WORD32 row_limit_2nd_stage, zero_rows_2nd_stage = zero_cols;
  126|       |
  127|   176k|    clip_limit = (1 << u1_bit_depth) - 1;
  128|   176k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   176k|#define TRANS_SIZE_16 16
  ------------------
  129|   176k|    pi2_tmp_orig = pi2_tmp;
  130|       |
  131|   176k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (131:8): [True: 57.5k, False: 118k]
  ------------------
  132|  57.5k|        row_limit_2nd_stage = 4;
  133|   118k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (133:13): [True: 79.3k, False: 39.5k]
  ------------------
  134|  79.3k|        row_limit_2nd_stage = 8;
  135|  39.5k|    else
  136|  39.5k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  39.5k|#define TRANS_SIZE_16 16
  ------------------
  137|       |
  138|   176k|    if((zero_rows & 0xFFF0) == 0xFFF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (138:8): [True: 105k, False: 71.0k]
  ------------------
  139|   105k|    {
  140|       |        /************************************************************************************************/
  141|       |        /**********************************START - IT_RECON_16x16****************************************/
  142|       |        /************************************************************************************************/
  143|       |
  144|       |        /* Inverse Transform 1st stage */
  145|   105k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   105k|#define IT_SHIFT_STAGE_1 7
  ------------------
  146|   105k|        add = 1 << (shift - 1);
  147|       |
  148|   970k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (148:20): [True: 864k, False: 105k]
  ------------------
  149|   864k|        {
  150|       |            /* Checking for Zero Cols */
  151|   864k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (151:16): [True: 624k, False: 240k]
  ------------------
  152|   624k|            {
  153|   624k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  154|   624k|            }
  155|   240k|            else
  156|   240k|            {
  157|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  158|  2.18M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (158:28): [True: 1.94M, False: 240k]
  ------------------
  159|  1.94M|                {
  160|  1.94M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  161|  1.94M|                                    + g_ai2_ihevc_trans_16[3][k]
  162|  1.94M|                                                    * pi2_src[3 * src_strd];
  163|  1.94M|                }
  164|  1.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (164:28): [True: 973k, False: 240k]
  ------------------
  165|   973k|                {
  166|   973k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  167|   973k|                }
  168|   240k|                eeo[0] = 0;
  169|   240k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  170|   240k|                eeo[1] = 0;
  171|   240k|                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|   727k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (174:28): [True: 486k, False: 240k]
  ------------------
  175|   486k|                {
  176|   486k|                    ee[k] = eee[k] + eeo[k];
  177|   486k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  178|   486k|                }
  179|  1.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (179:28): [True: 974k, False: 240k]
  ------------------
  180|   974k|                {
  181|   974k|                    e[k] = ee[k] + eo[k];
  182|   974k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  183|   974k|                }
  184|  2.18M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (184:28): [True: 1.94M, False: 240k]
  ------------------
  185|  1.94M|                {
  186|  1.94M|                    pi2_tmp[k] =
  187|  1.94M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  1.94M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.94M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 214, False: 1.94M]
  |  |  |  |  |  Branch (40:53): [True: 339, False: 1.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|  1.94M|                    pi2_tmp[k + 8] =
  189|  1.94M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|  1.94M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.94M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 94, False: 1.94M]
  |  |  |  |  |  Branch (40:53): [True: 129, False: 1.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  1.94M|                }
  191|   240k|            }
  192|   864k|            pi2_src++;
  193|   864k|            pi2_tmp += trans_size;
  194|   864k|            zero_cols = zero_cols >> 1;
  195|   864k|        }
  196|       |
  197|   105k|        pi2_tmp = pi2_tmp_orig;
  198|       |
  199|       |        /* Inverse Transform 2nd stage */
  200|   105k|        shift = 20 - u1_bit_depth;
  201|   105k|        add = 1 << (shift - 1);
  202|   105k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (202:12): [True: 36.7k, False: 68.7k]
  ------------------
  203|  36.7k|        {
  204|   623k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (204:24): [True: 586k, False: 36.7k]
  ------------------
  205|   586k|            {
  206|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  207|  5.27M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (207:28): [True: 4.69M, False: 586k]
  ------------------
  208|  4.69M|                {
  209|  4.69M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  210|  4.69M|                                    + g_ai2_ihevc_trans_16[3][k]
  211|  4.69M|                                                    * pi2_tmp[3 * trans_size];
  212|  4.69M|                }
  213|  2.93M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (213:28): [True: 2.34M, False: 586k]
  ------------------
  214|  2.34M|                {
  215|  2.34M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  216|  2.34M|                }
  217|   586k|                eeo[0] = 0;
  218|   586k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  219|   586k|                eeo[1] = 0;
  220|   586k|                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|  1.76M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (223:28): [True: 1.17M, False: 586k]
  ------------------
  224|  1.17M|                {
  225|  1.17M|                    ee[k] = eee[k] + eeo[k];
  226|  1.17M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  227|  1.17M|                }
  228|  2.93M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (228:28): [True: 2.34M, False: 586k]
  ------------------
  229|  2.34M|                {
  230|  2.34M|                    e[k] = ee[k] + eo[k];
  231|  2.34M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  232|  2.34M|                }
  233|  5.27M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (233:28): [True: 4.68M, False: 586k]
  ------------------
  234|  4.68M|                {
  235|  4.68M|                    WORD32 itrans_out;
  236|  4.68M|                    itrans_out =
  237|  4.68M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  4.68M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.68M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.68M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.68M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  4.68M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  4.68M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 167k, False: 4.51M]
  |  |  |  Branch (40:53): [True: 67.7k, False: 4.45M]
  |  |  ------------------
  ------------------
  239|  4.68M|                    itrans_out =
  240|  4.68M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  4.68M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.68M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.68M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.68M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  4.68M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  4.68M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 167k, False: 4.51M]
  |  |  |  Branch (40:53): [True: 75.6k, False: 4.44M]
  |  |  ------------------
  ------------------
  242|  4.68M|                }
  243|   586k|                pi2_tmp++;
  244|   586k|                pu2_pred += pred_strd;
  245|   586k|                pu2_dst += dst_strd;
  246|   586k|            }
  247|  36.7k|        }
  248|  68.7k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (248:17): [True: 47.7k, False: 21.0k]
  ------------------
  249|  47.7k|        {
  250|   796k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (250:24): [True: 748k, False: 47.7k]
  ------------------
  251|   748k|            {
  252|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  253|  6.70M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (253:28): [True: 5.95M, False: 748k]
  ------------------
  254|  5.95M|                {
  255|  5.95M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  256|  5.95M|                                    + g_ai2_ihevc_trans_16[3][k]
  257|  5.95M|                                                    * pi2_tmp[3 * trans_size]
  258|  5.95M|                                    + g_ai2_ihevc_trans_16[5][k]
  259|  5.95M|                                                    * pi2_tmp[5 * trans_size]
  260|  5.95M|                                    + g_ai2_ihevc_trans_16[7][k]
  261|  5.95M|                                                    * pi2_tmp[7 * trans_size];
  262|  5.95M|                }
  263|  3.73M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (263:28): [True: 2.98M, False: 748k]
  ------------------
  264|  2.98M|                {
  265|  2.98M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  266|  2.98M|                                    + g_ai2_ihevc_trans_16[6][k]
  267|  2.98M|                                                    * pi2_tmp[6 * trans_size];
  268|  2.98M|                }
  269|   748k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  270|   748k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  271|   748k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  272|   748k|                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|  2.24M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (275:28): [True: 1.49M, False: 748k]
  ------------------
  276|  1.49M|                {
  277|  1.49M|                    ee[k] = eee[k] + eeo[k];
  278|  1.49M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  279|  1.49M|                }
  280|  3.73M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (280:28): [True: 2.98M, False: 748k]
  ------------------
  281|  2.98M|                {
  282|  2.98M|                    e[k] = ee[k] + eo[k];
  283|  2.98M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  284|  2.98M|                }
  285|  6.68M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (285:28): [True: 5.93M, False: 748k]
  ------------------
  286|  5.93M|                {
  287|  5.93M|                    WORD32 itrans_out;
  288|  5.93M|                    itrans_out =
  289|  5.93M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  5.93M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.93M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.93M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|  5.93M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  5.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.10M, False: 4.83M]
  |  |  |  Branch (40:53): [True: 80.1k, False: 4.75M]
  |  |  ------------------
  ------------------
  291|  5.93M|                    itrans_out =
  292|  5.93M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  5.93M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.93M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.93M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|  5.93M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  5.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.06M, False: 4.87M]
  |  |  |  Branch (40:53): [True: 75.3k, False: 4.80M]
  |  |  ------------------
  ------------------
  294|  5.93M|                }
  295|   748k|                pi2_tmp++;
  296|   748k|                pu2_pred += pred_strd;
  297|   748k|                pu2_dst += dst_strd;
  298|   748k|            }
  299|  47.7k|        }
  300|  21.0k|        else /* All rows of output of 1st stage are non-zero */
  301|  21.0k|        {
  302|   351k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (302:24): [True: 330k, False: 21.0k]
  ------------------
  303|   330k|            {
  304|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  305|  2.97M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (305:28): [True: 2.64M, False: 330k]
  ------------------
  306|  2.64M|                {
  307|  2.64M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  308|  2.64M|                                    + g_ai2_ihevc_trans_16[3][k]
  309|  2.64M|                                                    * pi2_tmp[3 * trans_size]
  310|  2.64M|                                    + g_ai2_ihevc_trans_16[5][k]
  311|  2.64M|                                                    * pi2_tmp[5 * trans_size]
  312|  2.64M|                                    + g_ai2_ihevc_trans_16[7][k]
  313|  2.64M|                                                    * pi2_tmp[7 * trans_size]
  314|  2.64M|                                    + g_ai2_ihevc_trans_16[9][k]
  315|  2.64M|                                                    * pi2_tmp[9 * trans_size]
  316|  2.64M|                                    + g_ai2_ihevc_trans_16[11][k]
  317|  2.64M|                                                    * pi2_tmp[11 * trans_size]
  318|  2.64M|                                    + g_ai2_ihevc_trans_16[13][k]
  319|  2.64M|                                                    * pi2_tmp[13 * trans_size]
  320|  2.64M|                                    + g_ai2_ihevc_trans_16[15][k]
  321|  2.64M|                                                    * pi2_tmp[15 * trans_size];
  322|  2.64M|                }
  323|  1.66M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (323:28): [True: 1.33M, False: 330k]
  ------------------
  324|  1.33M|                {
  325|  1.33M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  326|  1.33M|                                    + g_ai2_ihevc_trans_16[6][k]
  327|  1.33M|                                                    * pi2_tmp[6 * trans_size]
  328|  1.33M|                                    + g_ai2_ihevc_trans_16[10][k]
  329|  1.33M|                                                    * pi2_tmp[10 * trans_size]
  330|  1.33M|                                    + g_ai2_ihevc_trans_16[14][k]
  331|  1.33M|                                                    * pi2_tmp[14 * trans_size];
  332|  1.33M|                }
  333|   330k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  334|   330k|                                    + g_ai2_ihevc_trans_16[12][0]
  335|   330k|                                                    * pi2_tmp[12 * trans_size];
  336|   330k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  337|   330k|                                    + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  338|   330k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  339|   330k|                                    + g_ai2_ihevc_trans_16[12][1]
  340|   330k|                                                    * pi2_tmp[12 * trans_size];
  341|   330k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  342|   330k|                                + 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|   992k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (345:28): [True: 661k, False: 330k]
  ------------------
  346|   661k|                {
  347|   661k|                    ee[k] = eee[k] + eeo[k];
  348|   661k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  349|   661k|                }
  350|  1.65M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (350:28): [True: 1.32M, False: 330k]
  ------------------
  351|  1.32M|                {
  352|  1.32M|                    e[k] = ee[k] + eo[k];
  353|  1.32M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  354|  1.32M|                }
  355|  2.97M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (355:28): [True: 2.63M, False: 330k]
  ------------------
  356|  2.63M|                {
  357|  2.63M|                    WORD32 itrans_out;
  358|  2.63M|                    itrans_out =
  359|  2.63M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  2.63M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.63M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.63M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|  2.63M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  2.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 127k, False: 2.51M]
  |  |  |  Branch (40:53): [True: 23.2k, False: 2.48M]
  |  |  ------------------
  ------------------
  361|  2.63M|                    itrans_out =
  362|  2.63M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  2.63M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.63M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.63M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|  2.63M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  2.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 117k, False: 2.52M]
  |  |  |  Branch (40:53): [True: 23.0k, False: 2.49M]
  |  |  ------------------
  ------------------
  364|  2.63M|                }
  365|   330k|                pi2_tmp++;
  366|   330k|                pu2_pred += pred_strd;
  367|   330k|                pu2_dst += dst_strd;
  368|   330k|            }
  369|  21.0k|        }
  370|       |        /************************************************************************************************/
  371|       |        /************************************END - IT_RECON_16x16****************************************/
  372|       |        /************************************************************************************************/
  373|   105k|    }
  374|  71.0k|    else if((zero_rows & 0xFF00) == 0xFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (374:13): [True: 50.8k, False: 20.1k]
  ------------------
  375|  50.8k|    {
  376|       |        /************************************************************************************************/
  377|       |        /**********************************START - IT_RECON_16x16****************************************/
  378|       |        /************************************************************************************************/
  379|       |
  380|       |        /* Inverse Transform 1st stage */
  381|  50.8k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  50.8k|#define IT_SHIFT_STAGE_1 7
  ------------------
  382|  50.8k|        add = 1 << (shift - 1);
  383|       |
  384|   442k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (384:20): [True: 391k, False: 50.8k]
  ------------------
  385|   391k|        {
  386|       |            /* Checking for Zero Cols */
  387|   391k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (387:16): [True: 259k, False: 132k]
  ------------------
  388|   259k|            {
  389|   259k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  390|   259k|            }
  391|   132k|            else
  392|   132k|            {
  393|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  394|  1.20M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (394:28): [True: 1.07M, False: 132k]
  ------------------
  395|  1.07M|                {
  396|  1.07M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  397|  1.07M|                                    + g_ai2_ihevc_trans_16[3][k]
  398|  1.07M|                                                    * pi2_src[3 * src_strd]
  399|  1.07M|                                    + g_ai2_ihevc_trans_16[5][k]
  400|  1.07M|                                                    * pi2_src[5 * src_strd]
  401|  1.07M|                                    + g_ai2_ihevc_trans_16[7][k]
  402|  1.07M|                                                    * pi2_src[7 * src_strd];
  403|  1.07M|                }
  404|   668k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (404:28): [True: 536k, False: 132k]
  ------------------
  405|   536k|                {
  406|   536k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  407|   536k|                                    + g_ai2_ihevc_trans_16[6][k]
  408|   536k|                                                    * pi2_src[6 * src_strd];
  409|   536k|                }
  410|   132k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  411|   132k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  412|   132k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  413|   132k|                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|   400k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (416:28): [True: 268k, False: 132k]
  ------------------
  417|   268k|                {
  418|   268k|                    ee[k] = eee[k] + eeo[k];
  419|   268k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  420|   268k|                }
  421|   668k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (421:28): [True: 536k, False: 132k]
  ------------------
  422|   536k|                {
  423|   536k|                    e[k] = ee[k] + eo[k];
  424|   536k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  425|   536k|                }
  426|  1.20M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (426:28): [True: 1.07M, False: 132k]
  ------------------
  427|  1.07M|                {
  428|  1.07M|                    pi2_tmp[k] =
  429|  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: 357, False: 1.07M]
  |  |  |  |  |  Branch (40:53): [True: 550, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|  1.07M|                    pi2_tmp[k + 8] =
  431|  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: 769, False: 1.07M]
  |  |  |  |  |  Branch (40:53): [True: 728, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|  1.07M|                }
  433|   132k|            }
  434|   391k|            pi2_src++;
  435|   391k|            pi2_tmp += trans_size;
  436|   391k|            zero_cols = zero_cols >> 1;
  437|   391k|        }
  438|       |
  439|  50.8k|        pi2_tmp = pi2_tmp_orig;
  440|       |
  441|       |        /* Inverse Transform 2nd stage */
  442|  50.8k|        shift = 20 - u1_bit_depth;
  443|  50.8k|        add = 1 << (shift - 1);
  444|  50.8k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (444:12): [True: 16.2k, False: 34.6k]
  ------------------
  445|  16.2k|        {
  446|   272k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (446:24): [True: 256k, False: 16.2k]
  ------------------
  447|   256k|            {
  448|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  449|  2.29M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (449:28): [True: 2.03M, False: 256k]
  ------------------
  450|  2.03M|                {
  451|  2.03M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  452|  2.03M|                                    + g_ai2_ihevc_trans_16[3][k]
  453|  2.03M|                                                    * pi2_tmp[3 * trans_size];
  454|  2.03M|                }
  455|  1.28M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (455:28): [True: 1.02M, False: 256k]
  ------------------
  456|  1.02M|                {
  457|  1.02M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  458|  1.02M|                }
  459|   256k|                eeo[0] = 0;
  460|   256k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  461|   256k|                eeo[1] = 0;
  462|   256k|                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|   767k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (465:28): [True: 511k, False: 256k]
  ------------------
  466|   511k|                {
  467|   511k|                    ee[k] = eee[k] + eeo[k];
  468|   511k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  469|   511k|                }
  470|  1.27M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (470:28): [True: 1.01M, False: 256k]
  ------------------
  471|  1.01M|                {
  472|  1.01M|                    e[k] = ee[k] + eo[k];
  473|  1.01M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  474|  1.01M|                }
  475|  2.28M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (475:28): [True: 2.03M, False: 256k]
  ------------------
  476|  2.03M|                {
  477|  2.03M|                    WORD32 itrans_out;
  478|  2.03M|                    itrans_out =
  479|  2.03M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  2.03M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.03M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.03M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  2.03M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  2.03M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 31.6k, False: 1.99M]
  |  |  |  Branch (40:53): [True: 25.5k, False: 1.97M]
  |  |  ------------------
  ------------------
  481|  2.03M|                    itrans_out =
  482|  2.03M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  2.03M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.03M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.03M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  2.03M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  2.03M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 32.7k, False: 1.99M]
  |  |  |  Branch (40:53): [True: 27.2k, False: 1.97M]
  |  |  ------------------
  ------------------
  484|  2.03M|                }
  485|   256k|                pi2_tmp++;
  486|   256k|                pu2_pred += pred_strd;
  487|   256k|                pu2_dst += dst_strd;
  488|   256k|            }
  489|  16.2k|        }
  490|  34.6k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (490:17): [True: 28.2k, False: 6.41k]
  ------------------
  491|  28.2k|        {
  492|   470k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (492:24): [True: 442k, False: 28.2k]
  ------------------
  493|   442k|            {
  494|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  495|  3.97M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (495:28): [True: 3.53M, False: 442k]
  ------------------
  496|  3.53M|                {
  497|  3.53M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  498|  3.53M|                                    + g_ai2_ihevc_trans_16[3][k]
  499|  3.53M|                                                    * pi2_tmp[3 * trans_size]
  500|  3.53M|                                    + g_ai2_ihevc_trans_16[5][k]
  501|  3.53M|                                                    * pi2_tmp[5 * trans_size]
  502|  3.53M|                                    + g_ai2_ihevc_trans_16[7][k]
  503|  3.53M|                                                    * pi2_tmp[7 * trans_size];
  504|  3.53M|                }
  505|  2.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (505:28): [True: 1.77M, False: 442k]
  ------------------
  506|  1.77M|                {
  507|  1.77M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  508|  1.77M|                                    + g_ai2_ihevc_trans_16[6][k]
  509|  1.77M|                                                    * pi2_tmp[6 * trans_size];
  510|  1.77M|                }
  511|   442k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  512|   442k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  513|   442k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  514|   442k|                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|  1.32M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (517:28): [True: 886k, False: 442k]
  ------------------
  518|   886k|                {
  519|   886k|                    ee[k] = eee[k] + eeo[k];
  520|   886k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  521|   886k|                }
  522|  2.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (522:28): [True: 1.77M, False: 442k]
  ------------------
  523|  1.77M|                {
  524|  1.77M|                    e[k] = ee[k] + eo[k];
  525|  1.77M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  526|  1.77M|                }
  527|  3.95M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (527:28): [True: 3.51M, False: 442k]
  ------------------
  528|  3.51M|                {
  529|  3.51M|                    WORD32 itrans_out;
  530|  3.51M|                    itrans_out =
  531|  3.51M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  3.51M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.51M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  532|  3.51M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  3.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.12M, False: 2.39M]
  |  |  |  Branch (40:53): [True: 44.9k, False: 2.34M]
  |  |  ------------------
  ------------------
  533|  3.51M|                    itrans_out =
  534|  3.51M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  3.51M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.51M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|  3.51M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  3.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.09M, False: 2.41M]
  |  |  |  Branch (40:53): [True: 39.2k, False: 2.37M]
  |  |  ------------------
  ------------------
  536|  3.51M|                }
  537|   442k|                pi2_tmp++;
  538|   442k|                pu2_pred += pred_strd;
  539|   442k|                pu2_dst += dst_strd;
  540|   442k|            }
  541|  28.2k|        }
  542|  6.41k|        else /* All rows of output of 1st stage are non-zero */
  543|  6.41k|        {
  544|   108k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (544:24): [True: 101k, False: 6.41k]
  ------------------
  545|   101k|            {
  546|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  547|   913k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (547:28): [True: 812k, False: 101k]
  ------------------
  548|   812k|                {
  549|   812k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  550|   812k|                                    + g_ai2_ihevc_trans_16[3][k]
  551|   812k|                                                    * pi2_tmp[3 * trans_size]
  552|   812k|                                    + g_ai2_ihevc_trans_16[5][k]
  553|   812k|                                                    * pi2_tmp[5 * trans_size]
  554|   812k|                                    + g_ai2_ihevc_trans_16[7][k]
  555|   812k|                                                    * pi2_tmp[7 * trans_size]
  556|   812k|                                    + g_ai2_ihevc_trans_16[9][k]
  557|   812k|                                                    * pi2_tmp[9 * trans_size]
  558|   812k|                                    + g_ai2_ihevc_trans_16[11][k]
  559|   812k|                                                    * pi2_tmp[11 * trans_size]
  560|   812k|                                    + g_ai2_ihevc_trans_16[13][k]
  561|   812k|                                                    * pi2_tmp[13 * trans_size]
  562|   812k|                                    + g_ai2_ihevc_trans_16[15][k]
  563|   812k|                                                    * pi2_tmp[15 * trans_size];
  564|   812k|                }
  565|   510k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (565:28): [True: 409k, False: 101k]
  ------------------
  566|   409k|                {
  567|   409k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  568|   409k|                                    + g_ai2_ihevc_trans_16[6][k]
  569|   409k|                                                    * pi2_tmp[6 * trans_size]
  570|   409k|                                    + g_ai2_ihevc_trans_16[10][k]
  571|   409k|                                                    * pi2_tmp[10 * trans_size]
  572|   409k|                                    + g_ai2_ihevc_trans_16[14][k]
  573|   409k|                                                    * pi2_tmp[14 * trans_size];
  574|   409k|                }
  575|   101k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  576|   101k|                                    + g_ai2_ihevc_trans_16[12][0]
  577|   101k|                                                    * pi2_tmp[12 * trans_size];
  578|   101k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  579|   101k|                                    + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  580|   101k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  581|   101k|                                    + g_ai2_ihevc_trans_16[12][1]
  582|   101k|                                                    * pi2_tmp[12 * trans_size];
  583|   101k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  584|   101k|                                    + 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|   305k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (587:28): [True: 203k, False: 101k]
  ------------------
  588|   203k|                {
  589|   203k|                    ee[k] = eee[k] + eeo[k];
  590|   203k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  591|   203k|                }
  592|   508k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (592:28): [True: 406k, False: 101k]
  ------------------
  593|   406k|                {
  594|   406k|                    e[k] = ee[k] + eo[k];
  595|   406k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  596|   406k|                }
  597|   912k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (597:28): [True: 810k, False: 101k]
  ------------------
  598|   810k|                {
  599|   810k|                    WORD32 itrans_out;
  600|   810k|                    itrans_out =
  601|   810k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   810k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   810k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 810k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 810k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|   810k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   810k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 36.4k, False: 774k]
  |  |  |  Branch (40:53): [True: 24.4k, False: 749k]
  |  |  ------------------
  ------------------
  603|   810k|                    itrans_out =
  604|   810k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   810k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   810k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 810k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 810k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|   810k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   810k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 34.8k, False: 776k]
  |  |  |  Branch (40:53): [True: 26.5k, False: 749k]
  |  |  ------------------
  ------------------
  606|   810k|                }
  607|   101k|                pi2_tmp++;
  608|   101k|                pu2_pred += pred_strd;
  609|   101k|                pu2_dst += dst_strd;
  610|   101k|            }
  611|  6.41k|        }
  612|       |        /************************************************************************************************/
  613|       |        /************************************END - IT_RECON_16x16****************************************/
  614|       |        /************************************************************************************************/
  615|  50.8k|    }
  616|  20.1k|    else /* All rows of input are non-zero */
  617|  20.1k|    {
  618|       |        /************************************************************************************************/
  619|       |        /**********************************START - IT_RECON_16x16****************************************/
  620|       |        /************************************************************************************************/
  621|       |
  622|       |        /* Inverse Transform 1st stage */
  623|  20.1k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  20.1k|#define IT_SHIFT_STAGE_1 7
  ------------------
  624|  20.1k|        add = 1 << (shift - 1);
  625|       |
  626|   264k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (626:20): [True: 244k, False: 20.1k]
  ------------------
  627|   244k|        {
  628|       |            /* Checking for Zero Cols */
  629|   244k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (629:16): [True: 69.0k, False: 175k]
  ------------------
  630|  69.0k|            {
  631|  69.0k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  632|  69.0k|            }
  633|   175k|            else
  634|   175k|            {
  635|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  636|  1.58M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (636:28): [True: 1.40M, False: 175k]
  ------------------
  637|  1.40M|                {
  638|  1.40M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  639|  1.40M|                                    + g_ai2_ihevc_trans_16[3][k]
  640|  1.40M|                                                    * pi2_src[3 * src_strd]
  641|  1.40M|                                    + g_ai2_ihevc_trans_16[5][k]
  642|  1.40M|                                                    * pi2_src[5 * src_strd]
  643|  1.40M|                                    + g_ai2_ihevc_trans_16[7][k]
  644|  1.40M|                                                    * pi2_src[7 * src_strd]
  645|  1.40M|                                    + g_ai2_ihevc_trans_16[9][k]
  646|  1.40M|                                                    * pi2_src[9 * src_strd]
  647|  1.40M|                                    + g_ai2_ihevc_trans_16[11][k]
  648|  1.40M|                                                    * pi2_src[11 * src_strd]
  649|  1.40M|                                    + g_ai2_ihevc_trans_16[13][k]
  650|  1.40M|                                                    * pi2_src[13 * src_strd]
  651|  1.40M|                                    + g_ai2_ihevc_trans_16[15][k]
  652|  1.40M|                                                    * pi2_src[15 * src_strd];
  653|  1.40M|                }
  654|   878k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (654:28): [True: 703k, False: 175k]
  ------------------
  655|   703k|                {
  656|   703k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  657|   703k|                                    + g_ai2_ihevc_trans_16[6][k]
  658|   703k|                                                    * pi2_src[6 * src_strd]
  659|   703k|                                    + g_ai2_ihevc_trans_16[10][k]
  660|   703k|                                                    * pi2_src[10 * src_strd]
  661|   703k|                                    + g_ai2_ihevc_trans_16[14][k]
  662|   703k|                                                    * pi2_src[14 * src_strd];
  663|   703k|                }
  664|   175k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  665|   175k|                                    + g_ai2_ihevc_trans_16[12][0]
  666|   175k|                                                    * pi2_src[12 * src_strd];
  667|   175k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  668|   175k|                                    + g_ai2_ihevc_trans_16[8][0]
  669|   175k|                                                    * pi2_src[8 * src_strd];
  670|   175k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  671|   175k|                                    + g_ai2_ihevc_trans_16[12][1]
  672|   175k|                                                    * pi2_src[12 * src_strd];
  673|   175k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  674|   175k|                                    + g_ai2_ihevc_trans_16[8][1]
  675|   175k|                                                    * pi2_src[8 * src_strd];
  676|       |
  677|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  678|   527k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (678:28): [True: 351k, False: 175k]
  ------------------
  679|   351k|                {
  680|   351k|                    ee[k] = eee[k] + eeo[k];
  681|   351k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  682|   351k|                }
  683|   878k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (683:28): [True: 702k, False: 175k]
  ------------------
  684|   702k|                {
  685|   702k|                    e[k] = ee[k] + eo[k];
  686|   702k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  687|   702k|                }
  688|  1.58M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (688:28): [True: 1.40M, False: 175k]
  ------------------
  689|  1.40M|                {
  690|  1.40M|                    pi2_tmp[k] =
  691|  1.40M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  1.40M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.40M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.23k, False: 1.40M]
  |  |  |  |  |  Branch (40:53): [True: 1.05k, False: 1.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|  1.40M|                    pi2_tmp[k + 8] =
  693|  1.40M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|  1.40M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.40M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 831, False: 1.40M]
  |  |  |  |  |  Branch (40:53): [True: 599, False: 1.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  694|  1.40M|                }
  695|   175k|            }
  696|   244k|            pi2_src++;
  697|   244k|            pi2_tmp += trans_size;
  698|   244k|            zero_cols = zero_cols >> 1;
  699|   244k|        }
  700|       |
  701|  20.1k|        pi2_tmp = pi2_tmp_orig;
  702|       |
  703|       |        /* Inverse Transform 2nd stage */
  704|  20.1k|        shift = 20 - u1_bit_depth;
  705|  20.1k|        add = 1 << (shift - 1);
  706|  20.1k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (706:12): [True: 4.66k, False: 15.5k]
  ------------------
  707|  4.66k|        {
  708|  78.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (708:24): [True: 74.1k, False: 4.66k]
  ------------------
  709|  74.1k|            {
  710|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  711|   666k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (711:28): [True: 591k, False: 74.1k]
  ------------------
  712|   591k|                {
  713|   591k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  714|   591k|                                    + g_ai2_ihevc_trans_16[3][k]
  715|   591k|                                                    * pi2_tmp[3 * trans_size];
  716|   591k|                }
  717|   370k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (717:28): [True: 296k, False: 74.1k]
  ------------------
  718|   296k|                {
  719|   296k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  720|   296k|                }
  721|  74.1k|                eeo[0] = 0;
  722|  74.1k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  723|  74.1k|                eeo[1] = 0;
  724|  74.1k|                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|   222k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (727:28): [True: 148k, False: 74.1k]
  ------------------
  728|   148k|                {
  729|   148k|                    ee[k] = eee[k] + eeo[k];
  730|   148k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  731|   148k|                }
  732|   370k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (732:28): [True: 296k, False: 74.1k]
  ------------------
  733|   296k|                {
  734|   296k|                    e[k] = ee[k] + eo[k];
  735|   296k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  736|   296k|                }
  737|   665k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (737:28): [True: 590k, False: 74.1k]
  ------------------
  738|   590k|                {
  739|   590k|                    WORD32 itrans_out;
  740|   590k|                    itrans_out =
  741|   590k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   590k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   590k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 590k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  742|   590k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   590k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 17.7k, False: 573k]
  |  |  |  Branch (40:53): [True: 18.0k, False: 555k]
  |  |  ------------------
  ------------------
  743|   590k|                    itrans_out =
  744|   590k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   590k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   590k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 590k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|   590k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   590k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 17.3k, False: 573k]
  |  |  |  Branch (40:53): [True: 19.7k, False: 553k]
  |  |  ------------------
  ------------------
  746|   590k|                }
  747|  74.1k|                pi2_tmp++;
  748|  74.1k|                pu2_pred += pred_strd;
  749|  74.1k|                pu2_dst += dst_strd;
  750|  74.1k|            }
  751|  4.66k|        }
  752|  15.5k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (752:17): [True: 4.00k, False: 11.5k]
  ------------------
  753|  4.00k|        {
  754|  67.1k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (754:24): [True: 63.1k, False: 4.00k]
  ------------------
  755|  63.1k|            {
  756|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  757|   568k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (757:28): [True: 505k, False: 63.1k]
  ------------------
  758|   505k|                {
  759|   505k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  760|   505k|                                    + g_ai2_ihevc_trans_16[3][k]
  761|   505k|                                                    * pi2_tmp[3 * trans_size]
  762|   505k|                                    + g_ai2_ihevc_trans_16[5][k]
  763|   505k|                                                    * pi2_tmp[5 * trans_size]
  764|   505k|                                    + g_ai2_ihevc_trans_16[7][k]
  765|   505k|                                                    * pi2_tmp[7 * trans_size];
  766|   505k|                }
  767|   315k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (767:28): [True: 252k, False: 63.1k]
  ------------------
  768|   252k|                {
  769|   252k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  770|   252k|                                    + g_ai2_ihevc_trans_16[6][k]
  771|   252k|                                                    * pi2_tmp[6 * trans_size];
  772|   252k|                }
  773|  63.1k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  774|  63.1k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  775|  63.1k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  776|  63.1k|                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|   189k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (779:28): [True: 126k, False: 63.1k]
  ------------------
  780|   126k|                {
  781|   126k|                    ee[k] = eee[k] + eeo[k];
  782|   126k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  783|   126k|                }
  784|   315k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (784:28): [True: 252k, False: 63.1k]
  ------------------
  785|   252k|                {
  786|   252k|                    e[k] = ee[k] + eo[k];
  787|   252k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  788|   252k|                }
  789|   567k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (789:28): [True: 504k, False: 63.1k]
  ------------------
  790|   504k|                {
  791|   504k|                    WORD32 itrans_out;
  792|   504k|                    itrans_out =
  793|   504k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   504k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   504k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 504k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 504k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  794|   504k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   504k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 13.8k, False: 490k]
  |  |  |  Branch (40:53): [True: 5.32k, False: 485k]
  |  |  ------------------
  ------------------
  795|   504k|                    itrans_out =
  796|   504k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   504k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   504k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 504k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 504k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  797|   504k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   504k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 14.1k, False: 490k]
  |  |  |  Branch (40:53): [True: 4.58k, False: 485k]
  |  |  ------------------
  ------------------
  798|   504k|                }
  799|  63.1k|                pi2_tmp++;
  800|  63.1k|                pu2_pred += pred_strd;
  801|  63.1k|                pu2_dst += dst_strd;
  802|  63.1k|            }
  803|  4.00k|        }
  804|  11.5k|        else /* All rows of output of 1st stage are non-zero */
  805|  11.5k|        {
  806|   205k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (806:24): [True: 193k, False: 11.5k]
  ------------------
  807|   193k|            {
  808|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  809|  1.74M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (809:28): [True: 1.54M, False: 193k]
  ------------------
  810|  1.54M|                {
  811|  1.54M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  812|  1.54M|                                    + g_ai2_ihevc_trans_16[3][k]
  813|  1.54M|                                                    * pi2_tmp[3 * trans_size]
  814|  1.54M|                                    + g_ai2_ihevc_trans_16[5][k]
  815|  1.54M|                                                    * pi2_tmp[5 * trans_size]
  816|  1.54M|                                    + g_ai2_ihevc_trans_16[7][k]
  817|  1.54M|                                                    * pi2_tmp[7 * trans_size]
  818|  1.54M|                                    + g_ai2_ihevc_trans_16[9][k]
  819|  1.54M|                                                    * pi2_tmp[9 * trans_size]
  820|  1.54M|                                    + g_ai2_ihevc_trans_16[11][k]
  821|  1.54M|                                                    * pi2_tmp[11 * trans_size]
  822|  1.54M|                                    + g_ai2_ihevc_trans_16[13][k]
  823|  1.54M|                                                    * pi2_tmp[13 * trans_size]
  824|  1.54M|                                    + g_ai2_ihevc_trans_16[15][k]
  825|  1.54M|                                                    * pi2_tmp[15 * trans_size];
  826|  1.54M|                }
  827|   969k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (827:28): [True: 775k, False: 193k]
  ------------------
  828|   775k|                {
  829|   775k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  830|   775k|                                    + g_ai2_ihevc_trans_16[6][k]
  831|   775k|                                                    * pi2_tmp[6 * trans_size]
  832|   775k|                                    + g_ai2_ihevc_trans_16[10][k]
  833|   775k|                                                    * pi2_tmp[10 * trans_size]
  834|   775k|                                    + g_ai2_ihevc_trans_16[14][k]
  835|   775k|                                                    * pi2_tmp[14 * trans_size];
  836|   775k|                }
  837|   193k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  838|   193k|                                    + g_ai2_ihevc_trans_16[12][0]
  839|   193k|                                                    * pi2_tmp[12 * trans_size];
  840|   193k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  841|   193k|                                    + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  842|   193k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  843|   193k|                                    + g_ai2_ihevc_trans_16[12][1]
  844|   193k|                                                    * pi2_tmp[12 * trans_size];
  845|   193k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  846|   193k|                                    + 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|   581k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (849:28): [True: 387k, False: 193k]
  ------------------
  850|   387k|                {
  851|   387k|                    ee[k] = eee[k] + eeo[k];
  852|   387k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  853|   387k|                }
  854|   968k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (854:28): [True: 774k, False: 193k]
  ------------------
  855|   774k|                {
  856|   774k|                    e[k] = ee[k] + eo[k];
  857|   774k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  858|   774k|                }
  859|  1.74M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (859:28): [True: 1.54M, False: 193k]
  ------------------
  860|  1.54M|                {
  861|  1.54M|                    WORD32 itrans_out;
  862|  1.54M|                    itrans_out =
  863|  1.54M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.54M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.54M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.54M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  864|  1.54M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.54M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 567k, False: 981k]
  |  |  |  Branch (40:53): [True: 120k, False: 860k]
  |  |  ------------------
  ------------------
  865|  1.54M|                    itrans_out =
  866|  1.54M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.54M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.54M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.54M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  867|  1.54M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.54M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 540k, False: 1.00M]
  |  |  |  Branch (40:53): [True: 100k, False: 908k]
  |  |  ------------------
  ------------------
  868|  1.54M|                }
  869|   193k|                pi2_tmp++;
  870|   193k|                pu2_pred += pred_strd;
  871|   193k|                pu2_dst += dst_strd;
  872|   193k|            }
  873|  11.5k|        }
  874|       |        /************************************************************************************************/
  875|       |        /************************************END - IT_RECON_16x16****************************************/
  876|       |        /************************************************************************************************/
  877|  20.1k|    }
  878|   176k|}

ihevc_hbd_chroma_itrans_recon_8x8:
  114|   104k|{
  115|   104k|    WORD32 j, k;
  116|   104k|    WORD32 e[4], o[4];
  117|   104k|    WORD32 ee[2], eo[2];
  118|   104k|    WORD32 add;
  119|   104k|    WORD32 shift;
  120|   104k|    WORD16 *pi2_tmp_orig;
  121|   104k|    WORD32 trans_size;
  122|   104k|    WORD32 zero_rows_2nd_stage = zero_cols;
  123|   104k|    WORD32 row_limit_2nd_stage;
  124|   104k|    WORD16 clip_limit;
  125|       |
  126|   104k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   104k|#define TRANS_SIZE_8   8
  ------------------
  127|       |
  128|   104k|    clip_limit = (1 << u1_bit_depth) - 1;
  129|   104k|    pi2_tmp_orig = pi2_tmp;
  130|       |
  131|   104k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (131:8): [True: 91.4k, False: 13.0k]
  ------------------
  132|  91.4k|        row_limit_2nd_stage = 4;
  133|  13.0k|    else
  134|  13.0k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  13.0k|#define TRANS_SIZE_8   8
  ------------------
  135|       |
  136|       |    /* Inverse Transform 1st stage */
  137|   104k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   104k|#define IT_SHIFT_STAGE_1 7
  ------------------
  138|   104k|    add = 1 << (shift - 1);
  139|   104k|    {
  140|       |        /************************************************************************************************/
  141|       |        /**********************************START - IT_RECON_8x8******************************************/
  142|       |        /************************************************************************************************/
  143|       |
  144|   574k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (144:20): [True: 469k, False: 104k]
  ------------------
  145|   469k|        {
  146|       |            /* Checking for Zero Cols */
  147|   469k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (147:16): [True: 234k, False: 235k]
  ------------------
  148|   234k|            {
  149|   234k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  150|   234k|            }
  151|   235k|            else
  152|   235k|            {
  153|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  154|  1.17M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (154:28): [True: 942k, False: 235k]
  ------------------
  155|   942k|                {
  156|   942k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  157|   942k|                                    + g_ai2_ihevc_trans_8[3][k]
  158|   942k|                                                    * pi2_src[3 * src_strd]
  159|   942k|                                    + g_ai2_ihevc_trans_8[5][k]
  160|   942k|                                                    * pi2_src[5 * src_strd]
  161|   942k|                                    + g_ai2_ihevc_trans_8[7][k]
  162|   942k|                                                    * pi2_src[7 * src_strd];
  163|   942k|                }
  164|       |
  165|   235k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  166|   235k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  167|   235k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  168|   235k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  169|   235k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  170|   235k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  171|   235k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  172|   235k|                                + 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|   235k|                e[0] = ee[0] + eo[0];
  176|   235k|                e[3] = ee[0] - eo[0];
  177|   235k|                e[1] = ee[1] + eo[1];
  178|   235k|                e[2] = ee[1] - eo[1];
  179|  1.17M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (179:28): [True: 942k, False: 235k]
  ------------------
  180|   942k|                {
  181|   942k|                    pi2_tmp[k] =
  182|   942k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|   942k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   942k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.11k, False: 941k]
  |  |  |  |  |  Branch (40:53): [True: 1.09k, False: 940k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|   942k|                    pi2_tmp[k + 4] =
  184|   942k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift) );
  ------------------
  |  |   53|   942k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   942k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 158, False: 942k]
  |  |  |  |  |  Branch (40:53): [True: 290, False: 942k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|   942k|                }
  186|   235k|            }
  187|   469k|            pi2_src++;
  188|   469k|            pi2_tmp += trans_size;
  189|   469k|            zero_cols = zero_cols >> 1;
  190|   469k|        }
  191|       |
  192|   104k|        pi2_tmp = pi2_tmp_orig;
  193|       |
  194|       |        /* Inverse Transform 2nd stage */
  195|   104k|        shift = 20 - u1_bit_depth;
  196|   104k|        add = 1 << (shift - 1);
  197|       |
  198|   104k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (198:12): [True: 91.5k, False: 12.9k]
  ------------------
  199|  91.5k|        {
  200|   822k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (200:24): [True: 731k, False: 91.5k]
  ------------------
  201|   731k|            {
  202|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  203|  3.65M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (203:28): [True: 2.92M, False: 731k]
  ------------------
  204|  2.92M|                {
  205|  2.92M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  206|  2.92M|                                    + g_ai2_ihevc_trans_8[3][k]
  207|  2.92M|                                                    * pi2_tmp[3 * trans_size];
  208|  2.92M|                }
  209|   731k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  210|   731k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  211|   731k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  212|   731k|                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|   731k|                e[0] = ee[0] + eo[0];
  216|   731k|                e[3] = ee[0] - eo[0];
  217|   731k|                e[1] = ee[1] + eo[1];
  218|   731k|                e[2] = ee[1] - eo[1];
  219|  3.65M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (219:28): [True: 2.92M, False: 731k]
  ------------------
  220|  2.92M|                {
  221|  2.92M|                    WORD32 itrans_out;
  222|  2.92M|                    itrans_out =
  223|  2.92M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  2.92M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.92M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  2.92M|                    pu2_dst[k * 2] = CLIP3((itrans_out + pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  2.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 129k, False: 2.79M]
  |  |  |  Branch (40:53): [True: 56.3k, False: 2.73M]
  |  |  ------------------
  ------------------
  225|  2.92M|                    itrans_out =
  226|  2.92M|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|  2.92M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.92M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  2.92M|                    pu2_dst[(k + 4) * 2] =
  228|  2.92M|                                    CLIP3((itrans_out + pu2_pred[(k + 4) * 2] ), 0, clip_limit);
  ------------------
  |  |   40|  2.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 115k, False: 2.80M]
  |  |  |  Branch (40:53): [True: 54.2k, False: 2.75M]
  |  |  ------------------
  ------------------
  229|  2.92M|                }
  230|   731k|                pi2_tmp++;
  231|   731k|                pu2_pred += pred_strd;
  232|   731k|                pu2_dst += dst_strd;
  233|   731k|            }
  234|  91.5k|        }
  235|  12.9k|        else /* All rows of output of 1st stage are non-zero */
  236|  12.9k|        {
  237|   117k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (237:24): [True: 104k, False: 12.9k]
  ------------------
  238|   104k|            {
  239|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  240|   520k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (240:28): [True: 416k, False: 104k]
  ------------------
  241|   416k|                {
  242|   416k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  243|   416k|                                    + g_ai2_ihevc_trans_8[3][k]
  244|   416k|                                                    * pi2_tmp[3 * trans_size]
  245|   416k|                                    + g_ai2_ihevc_trans_8[5][k]
  246|   416k|                                                    * pi2_tmp[5 * trans_size]
  247|   416k|                                    + g_ai2_ihevc_trans_8[7][k]
  248|   416k|                                                    * pi2_tmp[7 * trans_size];
  249|   416k|                }
  250|       |
  251|   104k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  252|   104k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  253|   104k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  254|   104k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  255|   104k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  256|   104k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  257|   104k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  258|   104k|                                + 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|   104k|                e[0] = ee[0] + eo[0];
  262|   104k|                e[3] = ee[0] - eo[0];
  263|   104k|                e[1] = ee[1] + eo[1];
  264|   104k|                e[2] = ee[1] - eo[1];
  265|   520k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (265:28): [True: 416k, False: 104k]
  ------------------
  266|   416k|                {
  267|   416k|                    WORD32 itrans_out;
  268|   416k|                    itrans_out =
  269|   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: 0, False: 416k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 416k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|   416k|                    pu2_dst[k * 2] = CLIP3((itrans_out + pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   416k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 23.0k, False: 393k]
  |  |  |  Branch (40:53): [True: 17.3k, False: 376k]
  |  |  ------------------
  ------------------
  271|   416k|                    itrans_out =
  272|   416k|                                    CLIP_S16( ((e[3-k] - o[3-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: 0, False: 416k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 416k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|   416k|                    pu2_dst[(k + 4) * 2] =
  274|   416k|                                    CLIP3((itrans_out + pu2_pred[(k + 4) * 2] ), 0, clip_limit);
  ------------------
  |  |   40|   416k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 22.4k, False: 394k]
  |  |  |  Branch (40:53): [True: 18.4k, False: 375k]
  |  |  ------------------
  ------------------
  275|   416k|                }
  276|   104k|                pi2_tmp++;
  277|   104k|                pu2_pred += pred_strd;
  278|   104k|                pu2_dst += dst_strd;
  279|   104k|            }
  280|  12.9k|        }
  281|       |        /************************************************************************************************/
  282|       |        /************************************END - IT_RECON_8x8******************************************/
  283|       |        /************************************************************************************************/
  284|   104k|    }
  285|   104k|}

ihevc_hbd_chroma_recon_4x4:
  109|   542k|{
  110|   542k|    WORD32 i, j;
  111|   542k|    WORD32 trans_size;
  112|   542k|    WORD16 clip_limit;
  113|       |
  114|   542k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   542k|#define TRANS_SIZE_4   4
  ------------------
  115|   542k|    clip_limit = (1 << u1_bit_depth) - 1;
  116|       |    /* Reconstruction */
  117|       |
  118|  2.71M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (118:16): [True: 2.17M, False: 542k]
  ------------------
  119|  2.17M|    {
  120|       |        /* Checking for Zero Cols */
  121|  2.17M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (121:12): [True: 1.40M, False: 762k]
  ------------------
  122|  1.40M|        {
  123|  7.04M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (123:24): [True: 5.63M, False: 1.40M]
  ------------------
  124|  5.63M|            {
  125|  5.63M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  126|  5.63M|            }
  127|  1.40M|        }
  128|   762k|        else
  129|   762k|        {
  130|  3.81M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (130:24): [True: 3.05M, False: 762k]
  ------------------
  131|  3.05M|            {
  132|  3.05M|                pu2_dst[j * dst_strd] =
  133|  3.05M|                    CLIP3((pi2_src[j * src_strd] + pu2_pred[j * pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  3.05M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 184k, False: 2.86M]
  |  |  |  Branch (40:53): [True: 22.4k, False: 2.84M]
  |  |  ------------------
  ------------------
  134|  3.05M|            }
  135|   762k|        }
  136|  2.17M|        pi2_src++;
  137|  2.17M|        pu2_dst += 2;
  138|  2.17M|        pu2_pred += 2;
  139|  2.17M|        zero_cols = zero_cols >> 1;
  140|  2.17M|    }
  141|   542k|}
ihevc_hbd_chroma_recon_8x8:
  192|  41.5k|{
  193|  41.5k|    WORD32 i, j;
  194|  41.5k|    WORD32 trans_size;
  195|  41.5k|    WORD16 clip_limit;
  196|       |
  197|  41.5k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  41.5k|#define TRANS_SIZE_8   8
  ------------------
  198|  41.5k|    clip_limit = (1 << u1_bit_depth) - 1;
  199|       |    /* Reconstruction */
  200|       |
  201|   373k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (201:16): [True: 331k, False: 41.5k]
  ------------------
  202|   331k|    {
  203|       |        /* Checking for Zero Cols */
  204|   331k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (204:12): [True: 275k, False: 56.7k]
  ------------------
  205|   275k|        {
  206|  2.47M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (206:24): [True: 2.20M, False: 275k]
  ------------------
  207|  2.20M|            {
  208|  2.20M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  209|  2.20M|            }
  210|   275k|        }
  211|  56.7k|        else
  212|  56.7k|        {
  213|   511k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (213:24): [True: 454k, False: 56.7k]
  ------------------
  214|   454k|            {
  215|   454k|                pu2_dst[j * dst_strd] =
  216|   454k|                    CLIP3((pi2_src[j * src_strd] + pu2_pred[j * pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|   454k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.62k, False: 450k]
  |  |  |  Branch (40:53): [True: 395, False: 450k]
  |  |  ------------------
  ------------------
  217|   454k|            }
  218|  56.7k|        }
  219|   331k|        pi2_src++;
  220|   331k|        pu2_dst += 2;
  221|   331k|        pu2_pred += 2;
  222|   331k|        zero_cols = zero_cols >> 1;
  223|   331k|    }
  224|  41.5k|}
ihevc_hbd_chroma_recon_16x16:
  275|  50.5k|{
  276|  50.5k|    WORD32 i, j;
  277|  50.5k|    WORD32 trans_size;
  278|  50.5k|    WORD16 clip_limit;
  279|       |
  280|  50.5k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  50.5k|#define TRANS_SIZE_16 16
  ------------------
  281|  50.5k|    clip_limit = (1 << u1_bit_depth) - 1;
  282|       |    /* Reconstruction */
  283|       |
  284|   857k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (284:16): [True: 806k, False: 50.5k]
  ------------------
  285|   806k|    {
  286|       |        /* Checking for Zero Cols */
  287|   806k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (287:12): [True: 729k, False: 77.4k]
  ------------------
  288|   729k|        {
  289|  12.3M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (289:24): [True: 11.6M, False: 729k]
  ------------------
  290|  11.6M|            {
  291|  11.6M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  292|  11.6M|            }
  293|   729k|        }
  294|  77.4k|        else
  295|  77.4k|        {
  296|  1.32M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (296:24): [True: 1.24M, False: 77.4k]
  ------------------
  297|  1.24M|            {
  298|  1.24M|                pu2_dst[j * dst_strd] =
  299|  1.24M|                    CLIP3((pi2_src[j * src_strd] + pu2_pred[j * pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  1.24M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.97k, False: 1.24M]
  |  |  |  Branch (40:53): [True: 1.16k, False: 1.24M]
  |  |  ------------------
  ------------------
  300|  1.24M|            }
  301|  77.4k|        }
  302|   806k|        pi2_src++;
  303|   806k|        pu2_dst += 2;
  304|   806k|        pu2_pred += 2;
  305|   806k|        zero_cols = zero_cols >> 1;
  306|   806k|    }
  307|  50.5k|}
ihevc_hbd_chroma_recon_nxn_ccp:
  452|  24.3k|{
  453|  24.3k|    WORD32 i, j;
  454|  24.3k|    WORD32 clip_limit = (1 << bit_depth) - 1;
  455|       |
  456|   161k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (456:16): [True: 137k, False: 24.3k]
  ------------------
  457|   137k|    {
  458|  1.23M|        for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (458:20): [True: 1.09M, False: 137k]
  ------------------
  459|  1.09M|        {
  460|  1.09M|            WORD32 res = (alpha * pi2_luma_res[j]) >> 3;
  461|  1.09M|            pu2_dst[j * 2] = CLIP3((pu2_pred[j * 2] + pi2_chroma_res[j] + res), 0, clip_limit);
  ------------------
  |  |   40|  1.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 24.9k, False: 1.07M]
  |  |  |  Branch (40:53): [True: 24.4k, False: 1.04M]
  |  |  ------------------
  ------------------
  462|  1.09M|        }
  463|   137k|        pi2_luma_res += luma_res_strd;
  464|   137k|        pi2_chroma_res += chroma_res_strd;
  465|   137k|        pu2_dst += dst_strd;
  466|   137k|        pu2_pred += pred_strd;
  467|   137k|    }
  468|  24.3k|}

ihevc_hbd_deblk_luma_vert:
  114|  58.5M|{
  115|  58.5M|    WORD32 qp_luma, beta_indx, tc_indx;
  116|  58.5M|    WORD32 beta, tc;
  117|  58.5M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  118|  58.5M|    WORD32 d_sam0, d_sam3;
  119|  58.5M|    WORD32 de, dep, deq;
  120|  58.5M|    WORD32 row;
  121|  58.5M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  122|  58.5M|    WORD32 delta, delta_p, delta_q;
  123|       |
  124|  58.5M|    ASSERT((bs > 0) && (bs <= 3));
  ------------------
  |  |   55|  58.5M|#define ASSERT(x) {}
  ------------------
  125|  58.5M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  58.5M|#define ASSERT(x) {}
  ------------------
  126|       |
  127|  58.5M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  128|  58.5M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  58.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.82k, False: 58.5M]
  |  |  |  Branch (40:53): [True: 235k, False: 58.2M]
  |  |  ------------------
  ------------------
  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|  58.5M|    tc_indx = CLIP3(qp_luma + (2 * (bs >> 1)) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  58.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.18k, False: 58.5M]
  |  |  |  Branch (40:53): [True: 227k, False: 58.2M]
  |  |  ------------------
  ------------------
  136|       |
  137|  58.5M|    beta = gai4_ihevc_beta_table[beta_indx] * (1 << (bit_depth - 8));
  138|  58.5M|    tc = gai4_ihevc_tc_table[tc_indx] * (1 << (bit_depth - 8));
  139|  58.5M|    if(0 == tc)
  ------------------
  |  Branch (139:8): [True: 607k, False: 57.9M]
  ------------------
  140|   607k|    {
  141|   607k|        return;
  142|   607k|    }
  143|       |
  144|  57.9M|    dq0 = ABS(pu2_src[2] - 2 * pu2_src[1] + pu2_src[0]);
  ------------------
  |  |   45|  57.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.0M, False: 47.8M]
  |  |  ------------------
  ------------------
  145|  57.9M|    dq3 = ABS(pu2_src[3 * src_strd + 2] - 2 * pu2_src[3 * src_strd + 1]
  ------------------
  |  |   45|  57.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 9.88M, False: 48.0M]
  |  |  ------------------
  ------------------
  146|  57.9M|                    + pu2_src[3 * src_strd + 0]);
  147|  57.9M|    dp0 = ABS(pu2_src[-3] - 2 * pu2_src[-2] + pu2_src[-1]);
  ------------------
  |  |   45|  57.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.0M, False: 47.8M]
  |  |  ------------------
  ------------------
  148|  57.9M|    dp3 = ABS(pu2_src[3 * src_strd - 3] - 2 * pu2_src[3 * src_strd - 2]
  ------------------
  |  |   45|  57.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 9.96M, False: 47.9M]
  |  |  ------------------
  ------------------
  149|  57.9M|                    + pu2_src[3 * src_strd - 1]);
  150|       |
  151|  57.9M|    d0 = dp0 + dq0;
  152|  57.9M|    d3 = dp3 + dq3;
  153|       |
  154|  57.9M|    dp = dp0 + dp3;
  155|  57.9M|    dq = dq0 + dq3;
  156|       |
  157|  57.9M|    d = d0 + d3;
  158|       |
  159|  57.9M|    de = 0;
  160|  57.9M|    dep = 0;
  161|  57.9M|    deq = 0;
  162|       |
  163|  57.9M|    if(d < beta)
  ------------------
  |  Branch (163:8): [True: 55.0M, False: 2.89M]
  ------------------
  164|  55.0M|    {
  165|  55.0M|        d_sam0 = 0;
  166|  55.0M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (166:12): [True: 52.9M, False: 2.07M]
  ------------------
  167|  52.9M|                        && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  52.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 9.31M, False: 43.6M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  52.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.2M, False: 42.6M]
  |  |  ------------------
  ------------------
  |  Branch (167:28): [True: 45.7M, False: 7.14M]
  ------------------
  168|  52.9M|                                        < (beta >> 3))
  169|  45.8M|                        && ABS(pu2_src[0] - pu2_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  45.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.21M, False: 41.5M]
  |  |  ------------------
  ------------------
  |  Branch (169:28): [True: 45.7M, False: 27.5k]
  ------------------
  170|  45.7M|        {
  171|  45.7M|            d_sam0 = 1;
  172|  45.7M|        }
  173|       |
  174|  55.0M|        pu2_src += 3 * src_strd;
  175|  55.0M|        d_sam3 = 0;
  176|  55.0M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (176:12): [True: 53.2M, False: 1.78M]
  ------------------
  177|  53.2M|                        && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  53.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 9.30M, False: 43.9M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  53.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.2M, False: 42.9M]
  |  |  ------------------
  ------------------
  |  Branch (177:28): [True: 46.1M, False: 7.03M]
  ------------------
  178|  53.2M|                                        < (beta >> 3))
  179|  46.2M|                        && ABS(pu2_src[0] - pu2_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  46.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.15M, False: 42.0M]
  |  |  ------------------
  ------------------
  |  Branch (179:28): [True: 46.1M, False: 78.7k]
  ------------------
  180|  46.3M|        {
  181|  46.3M|            d_sam3 = 1;
  182|  46.3M|        }
  183|  55.0M|        pu2_src -= 3 * src_strd;
  184|       |
  185|  55.0M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (185:15): [True: 46.2M, False: 8.74M]
  |  Branch (185:30): [True: 45.3M, False: 927k]
  ------------------
  186|  55.0M|        dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (186:15): [True: 54.4M, False: 537k]
  ------------------
  187|  55.0M|        deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (187:15): [True: 54.2M, False: 760k]
  ------------------
  188|  55.0M|        if(tc <= 1)
  ------------------
  |  Branch (188:12): [True: 0, False: 55.0M]
  ------------------
  189|      0|        {
  190|      0|            dep = 0;
  191|      0|            deq = 0;
  192|      0|        }
  193|  55.0M|    }
  194|       |
  195|  57.9M|    if(de != 0)
  ------------------
  |  Branch (195:8): [True: 56.5M, False: 1.31M]
  ------------------
  196|  56.5M|    {
  197|   269M|        for(row = 0; row < 4; row++)
  ------------------
  |  Branch (197:22): [True: 212M, False: 56.5M]
  ------------------
  198|   212M|        {
  199|   212M|            tmp_p0 = pu2_src[-1];
  200|   212M|            tmp_p1 = pu2_src[-2];
  201|   212M|            tmp_p2 = pu2_src[-3];
  202|       |
  203|   212M|            tmp_q0 = pu2_src[0];
  204|   212M|            tmp_q1 = pu2_src[1];
  205|   212M|            tmp_q2 = pu2_src[2];
  206|       |
  207|   212M|            if(de == 2)
  ------------------
  |  Branch (207:16): [True: 174M, False: 38.5M]
  ------------------
  208|   174M|            {
  209|   174M|                tmp_q0 = CLIP3((pu2_src[2] + 2 * pu2_src[1] +
  ------------------
  |  |   40|   174M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.83k, False: 174M]
  |  |  |  Branch (40:53): [True: 2.74k, False: 174M]
  |  |  ------------------
  ------------------
  210|   174M|                                2 * pu2_src[0] + 2 * pu2_src[-1] +
  211|   174M|                                pu2_src[-2] + 4) >> 3,
  212|   174M|                                pu2_src[0] - 2 * tc,
  213|   174M|                                pu2_src[0] + 2 * tc);
  214|       |
  215|   174M|                tmp_q1 = CLIP3((pu2_src[2] + pu2_src[1] + pu2_src[0] +
  ------------------
  |  |   40|   174M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.54k, False: 174M]
  |  |  |  Branch (40:53): [True: 1.15k, False: 174M]
  |  |  ------------------
  ------------------
  216|   174M|                                pu2_src[-1] + 2) >> 2,
  217|   174M|                                pu2_src[1] - 2 * tc,
  218|   174M|                                pu2_src[1] + 2 * tc);
  219|       |
  220|   174M|                tmp_q2 = CLIP3((2 * pu2_src[3] + 3 * pu2_src[2] +
  ------------------
  |  |   40|   174M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.09k, False: 174M]
  |  |  |  Branch (40:53): [True: 1.62k, False: 174M]
  |  |  ------------------
  ------------------
  221|   174M|                                pu2_src[1] + pu2_src[0] +
  222|   174M|                                pu2_src[-1] + 4) >> 3,
  223|   174M|                                pu2_src[2] - 2 * tc,
  224|   174M|                                pu2_src[2] + 2 * tc);
  225|       |
  226|   174M|                tmp_p0 = CLIP3((pu2_src[1] + 2 * pu2_src[0] +
  ------------------
  |  |   40|   174M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.94k, False: 174M]
  |  |  |  Branch (40:53): [True: 1.65k, False: 174M]
  |  |  ------------------
  ------------------
  227|   174M|                                2 * pu2_src[-1] + 2 * pu2_src[-2] +
  228|   174M|                                pu2_src[-3] + 4) >> 3,
  229|   174M|                                pu2_src[-1] - 2 * tc,
  230|   174M|                                pu2_src[-1] + 2 * tc);
  231|       |
  232|   174M|                tmp_p1 = CLIP3((pu2_src[0] + pu2_src[-1] +
  ------------------
  |  |   40|   174M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.76k, False: 174M]
  |  |  |  Branch (40:53): [True: 2.18k, False: 174M]
  |  |  ------------------
  ------------------
  233|   174M|                                pu2_src[-2] + pu2_src[-3] + 2) >> 2,
  234|   174M|                                pu2_src[-2] - 2 * tc,
  235|   174M|                                pu2_src[-2] + 2 * tc);
  236|       |
  237|   174M|                tmp_p2 = CLIP3((pu2_src[0] + pu2_src[-1] +
  ------------------
  |  |   40|   174M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.74k, False: 174M]
  |  |  |  Branch (40:53): [True: 745, False: 174M]
  |  |  ------------------
  ------------------
  238|   174M|                                pu2_src[-2] + 3 * pu2_src[-3] +
  239|   174M|                                2 * pu2_src[-4] + 4) >> 3,
  240|   174M|                                pu2_src[-3] - 2 * tc,
  241|   174M|                                pu2_src[-3] + 2 * tc);
  242|   174M|            }
  243|  38.5M|            else
  244|  38.5M|            {
  245|  38.5M|                delta = (9 * (pu2_src[0] - pu2_src[-1]) -
  246|  38.5M|                                3 * (pu2_src[1] - pu2_src[-2]) + 8) >> 4;
  247|  38.5M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  38.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.3M, False: 27.1M]
  |  |  ------------------
  ------------------
  |  Branch (247:20): [True: 56.7M, False: 18.4E]
  ------------------
  248|  56.7M|                {
  249|  56.7M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  56.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.24M, False: 55.5M]
  |  |  |  Branch (40:53): [True: 1.06M, False: 54.4M]
  |  |  ------------------
  ------------------
  250|       |
  251|  56.7M|                    tmp_p0 = CLIP3(pu2_src[-1] + delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  56.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 352k, False: 56.4M]
  |  |  |  Branch (40:53): [True: 44.2k, False: 56.3M]
  |  |  ------------------
  ------------------
  252|  56.7M|                    tmp_q0 = CLIP3(pu2_src[0] - delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  56.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 501k, False: 56.2M]
  |  |  |  Branch (40:53): [True: 49.2k, False: 56.2M]
  |  |  ------------------
  ------------------
  253|  56.7M|                    if(dep == 1)
  ------------------
  |  Branch (253:24): [True: 50.9M, False: 5.81M]
  ------------------
  254|  50.9M|                    {
  255|  50.9M|                        delta_p = CLIP3((((pu2_src[-3] + pu2_src[-1] + 1) >> 1)
  ------------------
  |  |   40|  50.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 191k, False: 50.7M]
  |  |  |  Branch (40:53): [True: 198k, False: 50.5M]
  |  |  ------------------
  ------------------
  256|  50.9M|                                        - pu2_src[-2] + delta) >> 1,
  257|  50.9M|                                        -(tc >> 1),
  258|  50.9M|                                        (tc >> 1));
  259|  50.9M|                        tmp_p1 = CLIP3(pu2_src[-2] + delta_p, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  50.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 138k, False: 50.8M]
  |  |  |  Branch (40:53): [True: 31.0k, False: 50.8M]
  |  |  ------------------
  ------------------
  260|  50.9M|                    }
  261|       |
  262|  56.7M|                    if(deq == 1)
  ------------------
  |  Branch (262:24): [True: 48.8M, False: 7.92M]
  ------------------
  263|  48.8M|                    {
  264|  48.8M|                        delta_q = CLIP3((((pu2_src[2] + pu2_src[0] + 1) >> 1)
  ------------------
  |  |   40|  48.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 208k, False: 48.6M]
  |  |  |  Branch (40:53): [True: 255k, False: 48.4M]
  |  |  ------------------
  ------------------
  265|  48.8M|                                        - pu2_src[1] - delta) >> 1,
  266|  48.8M|                                        -(tc >> 1),
  267|  48.8M|                                        (tc >> 1));
  268|  48.8M|                        tmp_q1 = CLIP3(pu2_src[1] + delta_q, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  48.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 204k, False: 48.6M]
  |  |  |  Branch (40:53): [True: 32.4k, False: 48.6M]
  |  |  ------------------
  ------------------
  269|  48.8M|                    }
  270|  56.7M|                }
  271|  38.5M|            }
  272|       |
  273|   212M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (273:16): [True: 211M, False: 1.40M]
  ------------------
  274|   211M|            {
  275|   211M|                pu2_src[-3] = tmp_p2;
  276|   211M|                pu2_src[-2] = tmp_p1;
  277|   211M|                pu2_src[-1] = tmp_p0;
  278|   211M|            }
  279|       |
  280|   212M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (280:16): [True: 211M, False: 1.45M]
  ------------------
  281|   211M|            {
  282|   211M|                pu2_src[0] = tmp_q0;
  283|   211M|                pu2_src[1] = tmp_q1;
  284|   211M|                pu2_src[2] = tmp_q2;
  285|   211M|            }
  286|       |
  287|   212M|            pu2_src += src_strd;
  288|   212M|        }
  289|  56.5M|    }
  290|  57.9M|}
ihevc_hbd_deblk_luma_horz:
  349|  63.8M|{
  350|  63.8M|    WORD32 qp_luma, beta_indx, tc_indx;
  351|  63.8M|    WORD32 beta, tc;
  352|  63.8M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  353|  63.8M|    WORD32 d_sam0, d_sam3;
  354|  63.8M|    WORD32 de, dep, deq;
  355|  63.8M|    WORD32 col;
  356|  63.8M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  357|  63.8M|    WORD32 delta, delta_p, delta_q;
  358|       |
  359|  63.8M|    ASSERT((bs > 0));
  ------------------
  |  |   55|  63.8M|#define ASSERT(x) {}
  ------------------
  360|  63.8M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  63.8M|#define ASSERT(x) {}
  ------------------
  361|       |
  362|  63.8M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  363|  63.8M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  63.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.46k, False: 63.8M]
  |  |  |  Branch (40:53): [True: 233k, False: 63.5M]
  |  |  ------------------
  ------------------
  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|  63.8M|    tc_indx = CLIP3(qp_luma + 2 * (bs >> 1) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  63.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.34k, False: 63.8M]
  |  |  |  Branch (40:53): [True: 227k, False: 63.5M]
  |  |  ------------------
  ------------------
  371|       |
  372|  63.8M|    beta = gai4_ihevc_beta_table[beta_indx] * (1 << (bit_depth - 8));
  373|  63.8M|    tc = gai4_ihevc_tc_table[tc_indx] * (1 << (bit_depth - 8));
  374|  63.8M|    if(0 == tc)
  ------------------
  |  Branch (374:8): [True: 1.02M, False: 62.7M]
  ------------------
  375|  1.02M|    {
  376|  1.02M|        return;
  377|  1.02M|    }
  378|       |
  379|  62.7M|    dq0 = ABS(pu2_src[2 * src_strd] - 2 * pu2_src[1 * src_strd] +
  ------------------
  |  |   45|  62.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.6M, False: 52.1M]
  |  |  ------------------
  ------------------
  380|  62.7M|                    pu2_src[0 * src_strd]);
  381|       |
  382|  62.7M|    dq3 = ABS(pu2_src[3 + 2 * src_strd] - 2 * pu2_src[3 + 1 * src_strd] +
  ------------------
  |  |   45|  62.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.4M, False: 52.2M]
  |  |  ------------------
  ------------------
  383|  62.7M|                    pu2_src[3 + 0 * src_strd]);
  384|       |
  385|  62.7M|    dp0 = ABS(pu2_src[-3 * src_strd] - 2 * pu2_src[-2 * src_strd] +
  ------------------
  |  |   45|  62.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.6M, False: 52.1M]
  |  |  ------------------
  ------------------
  386|  62.7M|                    pu2_src[-1 * src_strd]);
  387|       |
  388|  62.7M|    dp3 = ABS(pu2_src[3 - 3 * src_strd] - 2 * pu2_src[3 - 2 * src_strd] +
  ------------------
  |  |   45|  62.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.6M, False: 52.1M]
  |  |  ------------------
  ------------------
  389|  62.7M|                    pu2_src[3 - 1 * src_strd]);
  390|       |
  391|  62.7M|    d0 = dp0 + dq0;
  392|  62.7M|    d3 = dp3 + dq3;
  393|       |
  394|  62.7M|    dp = dp0 + dp3;
  395|  62.7M|    dq = dq0 + dq3;
  396|       |
  397|  62.7M|    d = d0 + d3;
  398|       |
  399|  62.7M|    de = 0;
  400|  62.7M|    dep = 0;
  401|  62.7M|    deq = 0;
  402|       |
  403|  62.7M|    if(d < beta)
  ------------------
  |  Branch (403:8): [True: 60.4M, False: 2.32M]
  ------------------
  404|  60.4M|    {
  405|  60.4M|        d_sam0 = 0;
  406|  60.4M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (406:12): [True: 58.7M, False: 1.74M]
  ------------------
  407|  58.7M|                        && (ABS(pu2_src[3 * src_strd] - pu2_src[0 * src_strd]) +
  ------------------
  |  |   45|  58.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.1M, False: 48.5M]
  |  |  ------------------
  ------------------
  |  Branch (407:28): [True: 48.9M, False: 9.81M]
  ------------------
  408|  58.7M|                                        ABS(pu2_src[-1 * src_strd] - pu2_src[-4 * src_strd])
  ------------------
  |  |   45|  58.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.1M, False: 47.6M]
  |  |  ------------------
  ------------------
  409|  58.7M|                                        < (beta >> 3))
  410|  49.6M|                        && ABS(pu2_src[0 * src_strd] - pu2_src[-1 * src_strd])
  ------------------
  |  |   45|  49.6M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.96M, False: 45.6M]
  |  |  ------------------
  ------------------
  |  Branch (410:28): [True: 49.3M, False: 245k]
  ------------------
  411|  49.6M|                        < ((5 * tc + 1) >> 1))
  412|  49.3M|        {
  413|  49.3M|            d_sam0 = 1;
  414|  49.3M|        }
  415|       |
  416|  60.4M|        pu2_src += 3;
  417|  60.4M|        d_sam3 = 0;
  418|  60.4M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (418:12): [True: 60.0M, False: 464k]
  ------------------
  419|  60.0M|                        && (ABS(pu2_src[3 * src_strd] - pu2_src[0 * src_strd]) +
  ------------------
  |  |   45|  60.0M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.2M, False: 49.7M]
  |  |  ------------------
  ------------------
  |  Branch (419:28): [True: 49.4M, False: 10.5M]
  ------------------
  420|  60.0M|                                        ABS(pu2_src[-1 * src_strd] - pu2_src[-4 * src_strd])
  ------------------
  |  |   45|  60.0M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.1M, False: 48.8M]
  |  |  ------------------
  ------------------
  421|  60.0M|                                        < (beta >> 3))
  422|  49.2M|                        && ABS(pu2_src[0 * src_strd] - pu2_src[-1 * src_strd])
  ------------------
  |  |   45|  49.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.90M, False: 45.3M]
  |  |  ------------------
  ------------------
  |  Branch (422:28): [True: 48.9M, False: 367k]
  ------------------
  423|  49.2M|                        < ((5 * tc + 1) >> 1))
  424|  48.9M|        {
  425|  48.9M|            d_sam3 = 1;
  426|  48.9M|        }
  427|  60.4M|        pu2_src -= 3;
  428|       |
  429|  60.4M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (429:15): [True: 48.7M, False: 11.7M]
  |  Branch (429:30): [True: 47.5M, False: 1.18M]
  ------------------
  430|  18.4E|        dep = (dp < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (430:15): [True: 60.5M, False: 18.4E]
  ------------------
  431|  60.4M|        deq = (dq < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (431:15): [True: 60.2M, False: 265k]
  ------------------
  432|  60.4M|        if(tc <= 1)
  ------------------
  |  Branch (432:12): [True: 0, False: 60.4M]
  ------------------
  433|      0|        {
  434|      0|            dep = 0;
  435|      0|            deq = 0;
  436|      0|        }
  437|  60.4M|    }
  438|       |
  439|  62.7M|    if(de != 0)
  ------------------
  |  Branch (439:8): [True: 62.0M, False: 695k]
  ------------------
  440|  62.0M|    {
  441|   290M|        for(col = 0; col < 4; col++)
  ------------------
  |  Branch (441:22): [True: 228M, False: 62.0M]
  ------------------
  442|   228M|        {
  443|   228M|            tmp_p0 = pu2_src[-1 * src_strd];
  444|   228M|            tmp_p1 = pu2_src[-2 * src_strd];
  445|   228M|            tmp_p2 = pu2_src[-3 * src_strd];
  446|       |
  447|   228M|            tmp_q0 = pu2_src[0 * src_strd];
  448|   228M|            tmp_q1 = pu2_src[1 * src_strd];
  449|   228M|            tmp_q2 = pu2_src[2 * src_strd];
  450|   228M|            if(de == 2)
  ------------------
  |  Branch (450:16): [True: 179M, False: 49.2M]
  ------------------
  451|   179M|            {
  452|   179M|                tmp_q0 = CLIP3((pu2_src[2 * src_strd] +
  ------------------
  |  |   40|   179M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.17k, False: 179M]
  |  |  |  Branch (40:53): [True: 1.54k, False: 179M]
  |  |  ------------------
  ------------------
  453|   179M|                                2 * pu2_src[1 * src_strd] +
  454|   179M|                                2 * pu2_src[0 * src_strd] +
  455|   179M|                                2 * pu2_src[-1 * src_strd] +
  456|   179M|                                pu2_src[-2 * src_strd] + 4) >> 3,
  457|   179M|                                pu2_src[0 * src_strd] - 2 * tc,
  458|   179M|                                pu2_src[0 * src_strd] + 2 * tc);
  459|       |
  460|   179M|                tmp_q1 = CLIP3((pu2_src[2 * src_strd] +
  ------------------
  |  |   40|   179M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 729, False: 179M]
  |  |  |  Branch (40:53): [True: 1.95k, False: 179M]
  |  |  ------------------
  ------------------
  461|   179M|                                pu2_src[1 * src_strd] +
  462|   179M|                                pu2_src[0 * src_strd] +
  463|   179M|                                pu2_src[-1 * src_strd] + 2) >> 2,
  464|   179M|                                pu2_src[1 * src_strd] - 2 * tc,
  465|   179M|                                pu2_src[1 * src_strd] + 2 * tc);
  466|       |
  467|   179M|                tmp_q2 = CLIP3((2 * pu2_src[3 * src_strd] +
  ------------------
  |  |   40|   179M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.44k, False: 179M]
  |  |  |  Branch (40:53): [True: 1.15k, False: 179M]
  |  |  ------------------
  ------------------
  468|   179M|                                3 * pu2_src[2 * src_strd] +
  469|   179M|                                pu2_src[1 * src_strd] +
  470|   179M|                                pu2_src[0 * src_strd] +
  471|   179M|                                pu2_src[-1 * src_strd] + 4) >> 3,
  472|   179M|                                pu2_src[2 * src_strd] - 2 * tc,
  473|   179M|                                pu2_src[2 * src_strd] + 2 * tc);
  474|       |
  475|   179M|                tmp_p0 = CLIP3((pu2_src[1 * src_strd] +
  ------------------
  |  |   40|   179M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.30k, False: 179M]
  |  |  |  Branch (40:53): [True: 1.86k, False: 179M]
  |  |  ------------------
  ------------------
  476|   179M|                                2 * pu2_src[0 * src_strd] +
  477|   179M|                                2 * pu2_src[-1 * src_strd] +
  478|   179M|                                2 * pu2_src[-2 * src_strd] +
  479|   179M|                                pu2_src[-3 * src_strd] + 4) >> 3,
  480|   179M|                                pu2_src[-1 * src_strd] - 2 * tc,
  481|   179M|                                pu2_src[-1 * src_strd] + 2 * tc);
  482|       |
  483|   179M|                tmp_p1 = CLIP3((pu2_src[0 * src_strd] +
  ------------------
  |  |   40|   179M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.08k, False: 179M]
  |  |  |  Branch (40:53): [True: 1.23k, False: 179M]
  |  |  ------------------
  ------------------
  484|   179M|                                pu2_src[-1 * src_strd] +
  485|   179M|                                pu2_src[-2 * src_strd] +
  486|   179M|                                pu2_src[-3 * src_strd] + 2) >> 2,
  487|   179M|                                pu2_src[-2 * src_strd] - 2 * tc,
  488|   179M|                                pu2_src[-2 * src_strd] + 2 * tc);
  489|       |
  490|   179M|                tmp_p2 = CLIP3((pu2_src[0 * src_strd] +
  ------------------
  |  |   40|   179M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 567, False: 179M]
  |  |  |  Branch (40:53): [True: 1.84k, False: 179M]
  |  |  ------------------
  ------------------
  491|   179M|                                pu2_src[-1 * src_strd] +
  492|   179M|                                pu2_src[-2 * src_strd] +
  493|   179M|                                3 * pu2_src[-3 * src_strd] +
  494|   179M|                                2 * pu2_src[-4 * src_strd] + 4) >> 3,
  495|   179M|                                pu2_src[-3 * src_strd] - 2 * tc,
  496|   179M|                                pu2_src[-3 * src_strd] + 2 * tc);
  497|   179M|            }
  498|  49.2M|            else
  499|  49.2M|            {
  500|  49.2M|                delta = (9 * (pu2_src[0 * src_strd] - pu2_src[-1 * src_strd]) -
  501|  49.2M|                                3 * (pu2_src[1 * src_strd] - pu2_src[-2 * src_strd]) +
  502|  49.2M|                                8) >> 4;
  503|  49.2M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  49.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 13.6M, False: 35.6M]
  |  |  ------------------
  ------------------
  |  Branch (503:20): [True: 67.0M, False: 18.4E]
  ------------------
  504|  67.0M|                {
  505|  67.0M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  67.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.29M, False: 64.7M]
  |  |  |  Branch (40:53): [True: 2.44M, False: 62.3M]
  |  |  ------------------
  ------------------
  506|  67.0M|                    tmp_p0 = CLIP3(pu2_src[-1 * src_strd] + delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  67.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 257k, False: 66.8M]
  |  |  |  Branch (40:53): [True: 34.3k, False: 66.7M]
  |  |  ------------------
  ------------------
  507|  67.0M|                    tmp_q0 = CLIP3(pu2_src[0 * src_strd] - delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  67.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 320k, False: 66.7M]
  |  |  |  Branch (40:53): [True: 44.1k, False: 66.7M]
  |  |  ------------------
  ------------------
  508|  67.0M|                    if(dep == 1)
  ------------------
  |  Branch (508:24): [True: 62.1M, False: 4.90M]
  ------------------
  509|  62.1M|                    {
  510|  62.1M|                        delta_p = CLIP3((((pu2_src[-3 * src_strd] +
  ------------------
  |  |   40|  62.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 259k, False: 61.9M]
  |  |  |  Branch (40:53): [True: 405k, False: 61.5M]
  |  |  ------------------
  ------------------
  511|  62.1M|                                        pu2_src[-1 * src_strd] + 1) >> 1) -
  512|  62.1M|                                        pu2_src[-2 * src_strd] + delta) >> 1,
  513|  62.1M|                                        -(tc >> 1),
  514|  62.1M|                                        (tc >> 1));
  515|  62.1M|                        tmp_p1 = CLIP3(pu2_src[-2 * src_strd] + delta_p, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  62.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 97.6k, False: 62.0M]
  |  |  |  Branch (40:53): [True: 22.5k, False: 62.0M]
  |  |  ------------------
  ------------------
  516|  62.1M|                    }
  517|       |
  518|  67.0M|                    if(deq == 1)
  ------------------
  |  Branch (518:24): [True: 60.4M, False: 6.58M]
  ------------------
  519|  60.4M|                    {
  520|  60.4M|                        delta_q = CLIP3((((pu2_src[2 * src_strd] +
  ------------------
  |  |   40|  60.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 255k, False: 60.2M]
  |  |  |  Branch (40:53): [True: 359k, False: 59.8M]
  |  |  ------------------
  ------------------
  521|  60.4M|                                        pu2_src[0 * src_strd] + 1) >> 1) -
  522|  60.4M|                                        pu2_src[1 * src_strd] - delta) >> 1,
  523|  60.4M|                                        -(tc >> 1),
  524|  60.4M|                                        (tc >> 1));
  525|  60.4M|                        tmp_q1 = CLIP3(pu2_src[1 * src_strd] + delta_q, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  60.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 107k, False: 60.3M]
  |  |  |  Branch (40:53): [True: 30.5k, False: 60.3M]
  |  |  ------------------
  ------------------
  526|  60.4M|                    }
  527|  67.0M|                }
  528|  49.2M|            }
  529|       |
  530|   228M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (530:16): [True: 226M, False: 1.78M]
  ------------------
  531|   226M|            {
  532|   226M|                pu2_src[-3 * src_strd] = tmp_p2;
  533|   226M|                pu2_src[-2 * src_strd] = tmp_p1;
  534|   226M|                pu2_src[-1 * src_strd] = tmp_p0;
  535|   226M|            }
  536|       |
  537|   228M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (537:16): [True: 227M, False: 751k]
  ------------------
  538|   227M|            {
  539|   227M|                pu2_src[0 * src_strd] = tmp_q0;
  540|   227M|                pu2_src[1 * src_strd] = tmp_q1;
  541|   227M|                pu2_src[2 * src_strd] = tmp_q2;
  542|   227M|            }
  543|       |
  544|   228M|            pu2_src += 1;
  545|   228M|        }
  546|  62.0M|    }
  547|  62.7M|}
ihevc_hbd_deblk_chroma_vert:
  606|  40.3M|{
  607|  40.3M|    WORD32 qp_indx_u, qp_chroma_u;
  608|  40.3M|    WORD32 qp_indx_v, qp_chroma_v;
  609|  40.3M|    WORD32 tc_indx_u, tc_u;
  610|  40.3M|    WORD32 tc_indx_v, tc_v;
  611|  40.3M|    WORD32 delta_u, tmp_p0_u, tmp_q0_u;
  612|  40.3M|    WORD32 delta_v, tmp_p0_v, tmp_q0_v;
  613|  40.3M|    WORD32 row;
  614|       |
  615|  40.3M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  40.3M|#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|  40.3M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  620|  40.3M|    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|  40.3M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (623:8): [True: 18.4E, False: 40.3M]
  |  Branch (623:51): [True: 38.9M, False: 1.41M]
  ------------------
  624|  38.9M|    {
  625|  38.9M|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  38.9M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 18.4M, False: 20.4M]
  |  |  ------------------
  ------------------
  626|  38.9M|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  38.9M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 24.7M, False: 14.1M]
  |  |  ------------------
  ------------------
  627|  38.9M|    }
  628|  1.41M|    else
  629|  1.41M|    {
  630|  1.41M|        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: 19.2k, False: 1.39M]
  |  Branch (630:52): [True: 3.57k, False: 1.39M]
  ------------------
  631|  1.41M|        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: 15.5k, False: 1.39M]
  |  Branch (631:52): [True: 9.87k, False: 1.38M]
  ------------------
  632|  1.41M|    }
  633|       |
  634|  40.3M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  40.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.60k, False: 40.3M]
  |  |  |  Branch (40:53): [True: 65.9k, False: 40.2M]
  |  |  ------------------
  ------------------
  635|  40.3M|    tc_u = gai4_ihevc_tc_table[tc_indx_u] * (1 << (bit_depth - 8));
  636|       |
  637|  40.3M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  40.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 9.90k, False: 40.3M]
  |  |  |  Branch (40:53): [True: 85.1k, False: 40.2M]
  |  |  ------------------
  ------------------
  638|  40.3M|    tc_v = gai4_ihevc_tc_table[tc_indx_v] * (1 << (bit_depth - 8));
  639|       |
  640|  40.3M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (640:8): [True: 313k, False: 40.0M]
  |  Branch (640:21): [True: 312k, False: 1.12k]
  ------------------
  641|   312k|    {
  642|   312k|        return;
  643|   312k|    }
  644|       |
  645|   199M|    for(row = 0; row < 4; row++)
  ------------------
  |  Branch (645:18): [True: 159M, False: 40.0M]
  ------------------
  646|   159M|    {
  647|   159M|        delta_u = CLIP3((((pu2_src[0] - pu2_src[-2]) << 2) +
  ------------------
  |  |   40|   159M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.10M, False: 158M]
  |  |  |  Branch (40:53): [True: 1.06M, False: 157M]
  |  |  ------------------
  ------------------
  648|   159M|                        pu2_src[-4] - pu2_src[2] + 4) >> 3,
  649|   159M|                        -tc_u, tc_u);
  650|   159M|        tmp_p0_u = CLIP3(pu2_src[-2] + delta_u, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   159M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 157k, False: 159M]
  |  |  |  Branch (40:53): [True: 15.3k, False: 159M]
  |  |  ------------------
  ------------------
  651|   159M|        tmp_q0_u = CLIP3(pu2_src[0] - delta_u, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   159M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 201k, False: 159M]
  |  |  |  Branch (40:53): [True: 15.2k, False: 159M]
  |  |  ------------------
  ------------------
  652|       |
  653|   159M|        delta_v = CLIP3((((pu2_src[1] - pu2_src[-1]) << 2) +
  ------------------
  |  |   40|   159M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.34M, False: 158M]
  |  |  |  Branch (40:53): [True: 1.11M, False: 157M]
  |  |  ------------------
  ------------------
  654|   159M|                        pu2_src[-3] - pu2_src[3] + 4) >> 3,
  655|   159M|                        -tc_v, tc_v);
  656|   159M|        tmp_p0_v = CLIP3(pu2_src[-1] + delta_v, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   159M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 332k, False: 159M]
  |  |  |  Branch (40:53): [True: 23.0k, False: 159M]
  |  |  ------------------
  ------------------
  657|   159M|        tmp_q0_v = CLIP3(pu2_src[1] - delta_v, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   159M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 415k, False: 159M]
  |  |  |  Branch (40:53): [True: 17.8k, False: 159M]
  |  |  ------------------
  ------------------
  658|   159M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (658:12): [True: 158M, False: 1.40M]
  ------------------
  659|   158M|        {
  660|   158M|            pu2_src[-2] = tmp_p0_u;
  661|   158M|            pu2_src[-1] = tmp_p0_v;
  662|   158M|        }
  663|       |
  664|   159M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (664:12): [True: 158M, False: 1.47M]
  ------------------
  665|   158M|        {
  666|   158M|            pu2_src[0] = tmp_q0_u;
  667|   158M|            pu2_src[1] = tmp_q0_v;
  668|   158M|        }
  669|       |
  670|   159M|        pu2_src += src_strd;
  671|   159M|    }
  672|  40.0M|}
ihevc_deblk_422chroma_vert:
  730|  1.96M|{
  731|  1.96M|    WORD32 qp_indx_u, qp_chroma_u;
  732|  1.96M|    WORD32 qp_indx_v, qp_chroma_v;
  733|  1.96M|    WORD32 tc_indx_u, tc_u;
  734|  1.96M|    WORD32 tc_indx_v, tc_v;
  735|  1.96M|    WORD32 delta_u, tmp_p0_u, tmp_q0_u;
  736|  1.96M|    WORD32 delta_v, tmp_p0_v, tmp_q0_v;
  737|  1.96M|    WORD32 row;
  738|       |
  739|  1.96M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  1.96M|#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.96M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  744|  1.96M|    qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  1.96M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.88M, False: 85.0k]
  |  |  ------------------
  ------------------
  745|       |
  746|  1.96M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  747|  1.96M|    qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  1.96M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.92M, False: 43.0k]
  |  |  ------------------
  ------------------
  748|       |
  749|  1.96M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.32k, False: 1.96M]
  |  |  |  Branch (40:53): [True: 1.00k, False: 1.96M]
  |  |  ------------------
  ------------------
  750|  1.96M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  751|       |
  752|  1.96M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.32k, False: 1.96M]
  |  |  |  Branch (40:53): [True: 966, False: 1.96M]
  |  |  ------------------
  ------------------
  753|  1.96M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  754|       |
  755|  1.96M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (755:8): [True: 196k, False: 1.76M]
  |  Branch (755:21): [True: 195k, False: 854]
  ------------------
  756|   195k|    {
  757|   195k|        return;
  758|   195k|    }
  759|       |
  760|  8.84M|    for(row = 0; row < 4; row++)
  ------------------
  |  Branch (760:18): [True: 7.07M, False: 1.76M]
  ------------------
  761|  7.07M|    {
  762|  7.07M|        delta_u = CLIP3((((pu1_src[0] - pu1_src[-2]) << 2) +
  ------------------
  |  |   40|  7.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 77.2k, False: 6.99M]
  |  |  |  Branch (40:53): [True: 84.8k, False: 6.91M]
  |  |  ------------------
  ------------------
  763|  7.07M|                        pu1_src[-4] - pu1_src[2] + 4) >> 3,
  764|  7.07M|                        -tc_u, tc_u);
  765|       |
  766|  7.07M|        tmp_p0_u = CLIP_U8(pu1_src[-2] + delta_u);
  ------------------
  |  |   40|  7.07M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.36k, False: 7.07M]
  |  |  |  |  |  Branch (40:53): [True: 588, False: 7.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|  7.07M|        tmp_q0_u = CLIP_U8(pu1_src[0] - delta_u);
  ------------------
  |  |   40|  7.07M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 871, False: 7.07M]
  |  |  |  |  |  Branch (40:53): [True: 1.53k, False: 7.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  768|       |
  769|  7.07M|        delta_v = CLIP3((((pu1_src[1] - pu1_src[-1]) << 2) +
  ------------------
  |  |   40|  7.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 83.3k, False: 6.99M]
  |  |  |  Branch (40:53): [True: 73.3k, False: 6.91M]
  |  |  ------------------
  ------------------
  770|  7.07M|                        pu1_src[-3] - pu1_src[3] + 4) >> 3,
  771|  7.07M|                        -tc_v, tc_v);
  772|       |
  773|  7.07M|        tmp_p0_v = CLIP_U8(pu1_src[-1] + delta_v);
  ------------------
  |  |   40|  7.07M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 464, False: 7.07M]
  |  |  |  |  |  Branch (40:53): [True: 748, False: 7.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  774|  7.07M|        tmp_q0_v = CLIP_U8(pu1_src[1] - delta_v);
  ------------------
  |  |   40|  7.07M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.04k, False: 7.07M]
  |  |  |  |  |  Branch (40:53): [True: 786, False: 7.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  775|       |
  776|  7.07M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (776:12): [True: 7.06M, False: 11.9k]
  ------------------
  777|  7.06M|        {
  778|  7.06M|            pu1_src[-2] = tmp_p0_u;
  779|  7.06M|            pu1_src[-1] = tmp_p0_v;
  780|  7.06M|        }
  781|       |
  782|  7.07M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (782:12): [True: 7.05M, False: 13.7k]
  ------------------
  783|  7.05M|        {
  784|  7.05M|            pu1_src[0] = tmp_q0_u;
  785|  7.05M|            pu1_src[1] = tmp_q0_v;
  786|  7.05M|        }
  787|       |
  788|  7.07M|        pu1_src += src_strd;
  789|  7.07M|    }
  790|  1.76M|}
ihevc_deblk_422chroma_horz:
  968|  1.70M|{
  969|  1.70M|    WORD32 qp_indx_u, qp_chroma_u;
  970|  1.70M|    WORD32 qp_indx_v, qp_chroma_v;
  971|  1.70M|    WORD32 tc_indx_u, tc_u;
  972|  1.70M|    WORD32 tc_indx_v, tc_v;
  973|  1.70M|    WORD32 tc;
  974|       |
  975|  1.70M|    WORD32 delta, tmp_p0, tmp_q0;
  976|  1.70M|    WORD32 col;
  977|       |
  978|  1.70M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  1.70M|#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.70M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  983|  1.70M|    qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  1.70M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.63M, False: 69.4k]
  |  |  ------------------
  ------------------
  984|       |
  985|  1.70M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  986|  1.70M|    qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  1.70M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.66M, False: 32.9k]
  |  |  ------------------
  ------------------
  987|       |
  988|  1.70M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.70M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.43k, False: 1.69M]
  |  |  |  Branch (40:53): [True: 960, False: 1.69M]
  |  |  ------------------
  ------------------
  989|  1.70M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  990|       |
  991|  1.70M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.70M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.43k, False: 1.69M]
  |  |  |  Branch (40:53): [True: 920, False: 1.69M]
  |  |  ------------------
  ------------------
  992|  1.70M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  993|       |
  994|  1.70M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (994:8): [True: 116k, False: 1.58M]
  |  Branch (994:21): [True: 115k, False: 933]
  ------------------
  995|   115k|    {
  996|   115k|        return;
  997|   115k|    }
  998|       |
  999|  14.0M|    for(col = 0; col < 8; col++)
  ------------------
  |  Branch (999:18): [True: 12.4M, False: 1.58M]
  ------------------
 1000|  12.4M|    {
 1001|  12.4M|        tc = (col & 1) ? tc_v : tc_u;
  ------------------
  |  Branch (1001:14): [True: 6.22M, False: 6.20M]
  ------------------
 1002|  12.4M|        delta = CLIP3((((pu1_src[0 * src_strd] -
  ------------------
  |  |   40|  12.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 134k, False: 12.2M]
  |  |  |  Branch (40:53): [True: 145k, False: 12.1M]
  |  |  ------------------
  ------------------
 1003|  12.4M|                      pu1_src[-1 * src_strd]) << 2) +
 1004|  12.4M|                      pu1_src[-2 * src_strd] -
 1005|  12.4M|                      pu1_src[1 * src_strd] + 4) >> 3,
 1006|  12.4M|                      -tc, tc);
 1007|       |
 1008|  12.4M|        tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|  12.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  12.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.09k, False: 12.4M]
  |  |  |  |  |  Branch (40:53): [True: 843, False: 12.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1009|  12.4M|        tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|  12.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  12.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.42k, False: 12.4M]
  |  |  |  |  |  Branch (40:53): [True: 4.24k, False: 12.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1010|       |
 1011|  12.4M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (1011:12): [True: 12.4M, False: 19.0k]
  ------------------
 1012|  12.4M|        {
 1013|  12.4M|            pu1_src[-1 * src_strd] = tmp_p0;
 1014|  12.4M|        }
 1015|       |
 1016|  12.4M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (1016:12): [True: 12.4M, False: 10.2k]
  ------------------
 1017|  12.4M|        {
 1018|  12.4M|            pu1_src[0 * src_strd] = tmp_q0;
 1019|  12.4M|        }
 1020|       |
 1021|  12.4M|        pu1_src += 1;
 1022|  12.4M|    }
 1023|  1.58M|}
ihevc_hbd_deblk_chroma_horz:
 1083|  36.1M|{
 1084|  36.1M|    WORD32 qp_indx_u, qp_chroma_u;
 1085|  36.1M|    WORD32 qp_indx_v, qp_chroma_v;
 1086|  36.1M|    WORD32 tc_indx_u, tc_u;
 1087|  36.1M|    WORD32 tc_indx_v, tc_v;
 1088|  36.1M|    WORD32 tc;
 1089|       |
 1090|  36.1M|    WORD32 delta, tmp_p0, tmp_q0;
 1091|  36.1M|    WORD32 col;
 1092|       |
 1093|  36.1M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  36.1M|#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|  36.1M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
 1098|  36.1M|    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|  36.1M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1101:8): [True: 18.4E, False: 36.1M]
  |  Branch (1101:51): [True: 34.6M, False: 1.50M]
  ------------------
 1102|  34.6M|    {
 1103|  34.6M|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  34.6M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 17.2M, False: 17.4M]
  |  |  ------------------
  ------------------
 1104|  34.6M|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  34.6M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 23.0M, False: 11.6M]
  |  |  ------------------
  ------------------
 1105|  34.6M|    }
 1106|  1.45M|    else
 1107|  1.45M|    {
 1108|  1.45M|        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: 24.1k, False: 1.43M]
  |  Branch (1108:52): [True: 4.94k, False: 1.42M]
  ------------------
 1109|  1.45M|        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: 19.4k, False: 1.43M]
  |  Branch (1109:52): [True: 10.4k, False: 1.42M]
  ------------------
 1110|  1.45M|    }
 1111|       |
 1112|  36.1M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  36.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.95k, False: 36.0M]
  |  |  |  Branch (40:53): [True: 46.5k, False: 36.0M]
  |  |  ------------------
  ------------------
 1113|  36.1M|    tc_u = gai4_ihevc_tc_table[tc_indx_u] * (1 << (bit_depth - 8));
 1114|       |
 1115|  36.1M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  36.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 10.4k, False: 36.0M]
  |  |  |  Branch (40:53): [True: 53.0k, False: 36.0M]
  |  |  ------------------
  ------------------
 1116|  36.1M|    tc_v = gai4_ihevc_tc_table[tc_indx_v] * (1 << (bit_depth - 8));
 1117|       |
 1118|  36.1M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (1118:8): [True: 423k, False: 35.6M]
  |  Branch (1118:21): [True: 420k, False: 2.86k]
  ------------------
 1119|   420k|    {
 1120|   420k|        return;
 1121|   420k|    }
 1122|       |
 1123|   316M|    for(col = 0; col < 8; col++)
  ------------------
  |  Branch (1123:18): [True: 281M, False: 35.6M]
  ------------------
 1124|   281M|    {
 1125|   281M|        tc = (col & 1) ? tc_v : tc_u;
  ------------------
  |  Branch (1125:14): [True: 140M, False: 140M]
  ------------------
 1126|   281M|        delta = CLIP3((((pu2_src[0 * src_strd] -
  ------------------
  |  |   40|   281M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.71M, False: 278M]
  |  |  |  Branch (40:53): [True: 2.21M, False: 276M]
  |  |  ------------------
  ------------------
 1127|   281M|                      pu2_src[-1 * src_strd]) << 2) +
 1128|   281M|                      pu2_src[-2 * src_strd] -
 1129|   281M|                      pu2_src[1 * src_strd] + 4) >> 3,
 1130|   281M|                      -tc, tc);
 1131|   281M|        tmp_p0 = CLIP3(pu2_src[-1 * src_strd] + delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   281M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 453k, False: 280M]
  |  |  |  Branch (40:53): [True: 17.6k, False: 280M]
  |  |  ------------------
  ------------------
 1132|   281M|        tmp_q0 = CLIP3(pu2_src[0 * src_strd] - delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   281M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 488k, False: 280M]
  |  |  |  Branch (40:53): [True: 30.5k, False: 280M]
  |  |  ------------------
  ------------------
 1133|       |
 1134|   281M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (1134:12): [True: 279M, False: 2.24M]
  ------------------
 1135|   279M|        {
 1136|   279M|            pu2_src[-1 * src_strd] = tmp_p0;
 1137|   279M|        }
 1138|       |
 1139|   281M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (1139:12): [True: 280M, False: 1.10M]
  ------------------
 1140|   280M|        {
 1141|   280M|            pu2_src[0 * src_strd] = tmp_q0;
 1142|   280M|        }
 1143|       |
 1144|   281M|        pu2_src += 1;
 1145|   281M|    }
 1146|  35.6M|}

ihevc_hbd_inter_pred_luma_copy:
  115|   168k|{
  116|   168k|    WORD32 row, col;
  117|       |
  118|  1.50M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (118:18): [True: 1.33M, False: 168k]
  ------------------
  119|  1.33M|    {
  120|  13.8M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (120:22): [True: 12.5M, False: 1.33M]
  ------------------
  121|  12.5M|        {
  122|  12.5M|            pu2_dst[col] = pu2_src[col];
  123|  12.5M|        }
  124|       |
  125|  1.33M|        pu2_src += src_strd;
  126|  1.33M|        pu2_dst += dst_strd;
  127|  1.33M|    }
  128|   168k|}
ihevc_hbd_inter_pred_luma_horz:
  178|  18.9k|{
  179|  18.9k|    WORD32 row, col, i;
  180|  18.9k|    WORD32 tmp;
  181|       |
  182|   172k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (182:18): [True: 153k, False: 18.9k]
  ------------------
  183|   153k|    {
  184|  1.60M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (184:22): [True: 1.45M, False: 153k]
  ------------------
  185|  1.45M|        {
  186|  1.45M|            tmp = 0;
  187|  13.0M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  13.0M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (187:24): [True: 11.5M, False: 1.45M]
  ------------------
  188|  11.5M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3)];
  189|       |
  190|  1.45M|            tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.45M|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.45M|#define FILTER_PREC 6
  ------------------
  191|  1.45M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.45M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 14.8k, False: 1.43M]
  |  |  |  Branch (40:53): [True: 29.9k, False: 1.40M]
  |  |  ------------------
  ------------------
  192|  1.45M|            pu2_dst[col] = (UWORD16)tmp;
  193|  1.45M|        }
  194|       |
  195|   153k|        pu2_src += src_strd;
  196|   153k|        pu2_dst += dst_strd;
  197|   153k|    }
  198|  18.9k|}
ihevc_hbd_inter_pred_luma_vert:
  250|  29.8k|{
  251|  29.8k|    WORD32 row, col, i;
  252|  29.8k|    WORD32 tmp;
  253|       |
  254|   268k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (254:18): [True: 238k, False: 29.8k]
  ------------------
  255|   238k|    {
  256|  2.43M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (256:22): [True: 2.20M, False: 238k]
  ------------------
  257|  2.20M|        {
  258|  2.20M|            tmp = 0;
  259|  19.7M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  19.7M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (259:24): [True: 17.5M, False: 2.20M]
  ------------------
  260|  17.5M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3) * src_strd];
  261|       |
  262|  2.20M|            tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  2.20M|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  2.20M|#define FILTER_PREC 6
  ------------------
  263|  2.20M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  2.20M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 41.7k, False: 2.15M]
  |  |  |  Branch (40:53): [True: 515k, False: 1.64M]
  |  |  ------------------
  ------------------
  264|  2.20M|            pu2_dst[col] = (UWORD16)tmp;
  265|  2.20M|        }
  266|       |
  267|   238k|        pu2_src += src_strd;
  268|   238k|        pu2_dst += dst_strd;
  269|   238k|    }
  270|  29.8k|}
ihevc_hbd_inter_pred_luma_copy_w16out:
  322|   585k|{
  323|   585k|    WORD32 row, col;
  324|       |
  325|  5.28M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (325:18): [True: 4.70M, False: 585k]
  ------------------
  326|  4.70M|    {
  327|  48.4M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (327:22): [True: 43.7M, False: 4.70M]
  ------------------
  328|  43.7M|        {
  329|  43.7M|            pi2_dst[col] = (pu2_src[col] << (14-bit_depth));
  330|  43.7M|        }
  331|       |
  332|  4.70M|        pu2_src += src_strd;
  333|  4.70M|        pi2_dst += dst_strd;
  334|  4.70M|    }
  335|   585k|}
ihevc_hbd_inter_pred_luma_horz_w16out:
  388|   126k|{
  389|   126k|    WORD32 row, col, i;
  390|   126k|    WORD32 tmp;
  391|       |
  392|  1.74M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (392:18): [True: 1.61M, False: 126k]
  ------------------
  393|  1.61M|    {
  394|  16.7M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (394:22): [True: 15.1M, False: 1.61M]
  ------------------
  395|  15.1M|        {
  396|  15.1M|            tmp = 0;
  397|   135M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   135M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (397:24): [True: 120M, False: 15.1M]
  ------------------
  398|   120M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3)];
  399|  15.1M|            pi2_dst[col] = tmp >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  15.1M|#define FILTER_PREC 6
  ------------------
  400|  15.1M|        }
  401|       |
  402|  1.61M|        pu2_src += src_strd;
  403|  1.61M|        pi2_dst += dst_strd;
  404|  1.61M|    }
  405|   126k|}
ihevc_hbd_inter_pred_luma_vert_w16out:
  458|  44.0k|{
  459|  44.0k|    WORD32 row, col, i;
  460|  44.0k|    WORD32 tmp;
  461|       |
  462|   410k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (462:18): [True: 366k, False: 44.0k]
  ------------------
  463|   366k|    {
  464|  4.16M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (464:22): [True: 3.79M, False: 366k]
  ------------------
  465|  3.79M|        {
  466|  3.79M|            tmp = 0;
  467|  34.1M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  34.1M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (467:24): [True: 30.3M, False: 3.79M]
  ------------------
  468|  30.3M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3) * src_strd];
  469|       |
  470|  3.79M|            pi2_dst[col] = tmp >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  3.79M|#define FILTER_PREC 6
  ------------------
  471|  3.79M|        }
  472|       |
  473|   366k|        pu2_src += src_strd;
  474|   366k|        pi2_dst += dst_strd;
  475|   366k|    }
  476|  44.0k|}
ihevc_hbd_inter_pred_luma_vert_w16inp:
  528|  32.5k|{
  529|  32.5k|    WORD32 row, col, i;
  530|  32.5k|    WORD32 tmp;
  531|   274k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (531:18): [True: 241k, False: 32.5k]
  ------------------
  532|   241k|    {
  533|  2.33M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (533:22): [True: 2.09M, False: 241k]
  ------------------
  534|  2.09M|        {
  535|  2.09M|            tmp = 0;
  536|  18.6M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  18.6M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (536:24): [True: 16.5M, False: 2.09M]
  ------------------
  537|  16.5M|                tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  538|       |
  539|  2.09M|            tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  2.09M|#define FILTER_PREC 6
  ------------------
                          tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  2.09M|#define FILTER_PREC 6
  ------------------
  540|       |
  541|  2.09M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  2.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.71k, False: 2.08M]
  |  |  |  Branch (40:53): [True: 50.3k, False: 2.03M]
  |  |  ------------------
  ------------------
  542|  2.09M|            pu2_dst[col] = tmp;
  543|  2.09M|        }
  544|       |
  545|   241k|        pi2_src += src_strd;
  546|   241k|        pu2_dst += dst_strd;
  547|   241k|    }
  548|  32.5k|}
ihevc_hbd_inter_pred_luma_vert_w16inp_w16out:
  602|  65.4k|{
  603|  65.4k|    WORD32 row, col, i;
  604|  65.4k|    WORD32 tmp;
  605|       |
  606|   622k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (606:18): [True: 557k, False: 65.4k]
  ------------------
  607|   557k|    {
  608|  6.35M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (608:22): [True: 5.79M, False: 557k]
  ------------------
  609|  5.79M|        {
  610|  5.79M|            tmp = 0;
  611|  52.0M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  52.0M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (611:24): [True: 46.2M, False: 5.79M]
  ------------------
  612|  46.2M|                tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  613|  5.79M|            tmp = (tmp >> FILTER_PREC) - OFFSET14;
  ------------------
  |  |   44|  5.79M|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp >> FILTER_PREC) - OFFSET14;
  ------------------
  |  |   43|  5.79M|#define OFFSET14 (1 << (14 - 1))
  ------------------
  614|       |
  615|  5.79M|            pi2_dst[col] = tmp;
  616|  5.79M|        }
  617|       |
  618|   557k|        pi2_src += src_strd;
  619|   557k|        pi2_dst += dst_strd;
  620|   557k|    }
  621|  65.4k|}
ihevc_hbd_inter_pred_chroma_copy:
  673|   168k|{
  674|   168k|    WORD32 row, col;
  675|       |
  676|  1.32M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (676:18): [True: 1.15M, False: 168k]
  ------------------
  677|  1.15M|    {
  678|  12.1M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (678:22): [True: 11.0M, False: 1.15M]
  ------------------
  679|  11.0M|        {
  680|  11.0M|            pu2_dst[col] = pu2_src[col];
  681|  11.0M|        }
  682|       |
  683|  1.15M|        pu2_src += src_strd;
  684|  1.15M|        pu2_dst += dst_strd;
  685|  1.15M|    }
  686|   168k|}
ihevc_hbd_inter_pred_chroma_horz:
  739|  15.3k|{
  740|  15.3k|    WORD32 row, col, i;
  741|  15.3k|    WORD32 tmp_u, tmp_v;
  742|       |
  743|  88.5k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (743:18): [True: 73.2k, False: 15.3k]
  ------------------
  744|  73.2k|    {
  745|   442k|        for(col = 0; col < 2*wd; col+=2)
  ------------------
  |  Branch (745:22): [True: 369k, False: 73.2k]
  ------------------
  746|   369k|        {
  747|   369k|            tmp_u = 0;
  748|   369k|            tmp_v = 0;
  749|  1.84M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  1.84M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (749:24): [True: 1.47M, False: 369k]
  ------------------
  750|  1.47M|            {
  751|  1.47M|                tmp_u += pi1_coeff[i] * pu2_src[col + (i-1)*2];
  752|  1.47M|                tmp_v += pi1_coeff[i] * pu2_src[col + 1 + (i-1)*2];
  753|  1.47M|            }
  754|       |
  755|   369k|            tmp_u = (tmp_u + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   369k|#define FILTER_PREC 6
  ------------------
                          tmp_u = (tmp_u + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   369k|#define FILTER_PREC 6
  ------------------
  756|   369k|            tmp_v = (tmp_v + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   369k|#define FILTER_PREC 6
  ------------------
                          tmp_v = (tmp_v + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   369k|#define FILTER_PREC 6
  ------------------
  757|       |
  758|   369k|            tmp_u = CLIP3(tmp_u,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|   369k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.41k, False: 367k]
  |  |  |  Branch (40:53): [True: 3.26k, False: 363k]
  |  |  ------------------
  ------------------
  759|   369k|            tmp_v = CLIP3(tmp_v,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|   369k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.57k, False: 366k]
  |  |  |  Branch (40:53): [True: 3.36k, False: 363k]
  |  |  ------------------
  ------------------
  760|       |
  761|   369k|            pu2_dst[col] = (UWORD16)tmp_u;
  762|   369k|            pu2_dst[col + 1] = (UWORD16)tmp_v;
  763|   369k|        }
  764|       |
  765|  73.2k|        pu2_src += src_strd;
  766|  73.2k|        pu2_dst += dst_strd;
  767|  73.2k|    }
  768|  15.3k|}
ihevc_hbd_inter_pred_chroma_vert:
  822|  27.6k|{
  823|  27.6k|    WORD32 row, col, i;
  824|  27.6k|    WORD32 tmp;
  825|       |
  826|   147k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (826:18): [True: 120k, False: 27.6k]
  ------------------
  827|   120k|    {
  828|  1.27M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (828:22): [True: 1.15M, False: 120k]
  ------------------
  829|  1.15M|        {
  830|  1.15M|            tmp = 0;
  831|  5.76M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  5.76M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (831:24): [True: 4.61M, False: 1.15M]
  ------------------
  832|  4.61M|            {
  833|  4.61M|                tmp += pi1_coeff[i] * pu2_src[col + (i-1) * src_strd];
  834|  4.61M|            }
  835|       |
  836|  1.15M|            tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.15M|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.15M|#define FILTER_PREC 6
  ------------------
  837|       |
  838|  1.15M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.40k, False: 1.14M]
  |  |  |  Branch (40:53): [True: 53.5k, False: 1.09M]
  |  |  ------------------
  ------------------
  839|  1.15M|            pu2_dst[col] = (UWORD16)tmp;
  840|  1.15M|        }
  841|       |
  842|   120k|        pu2_src += src_strd;
  843|   120k|        pu2_dst += dst_strd;
  844|   120k|    }
  845|  27.6k|}
ihevc_hbd_inter_pred_chroma_copy_w16out:
  898|   565k|{
  899|   565k|    WORD32 row, col;
  900|       |
  901|  3.74M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (901:18): [True: 3.18M, False: 565k]
  ------------------
  902|  3.18M|    {
  903|  32.7M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (903:22): [True: 29.6M, False: 3.18M]
  ------------------
  904|  29.6M|        {
  905|  29.6M|            pi2_dst[col] = (pu2_src[col] << (14 - bit_depth));
  906|  29.6M|        }
  907|       |
  908|  3.18M|        pu2_src += src_strd;
  909|  3.18M|        pi2_dst += dst_strd;
  910|  3.18M|    }
  911|   565k|}
ihevc_hbd_inter_pred_chroma_horz_w16out:
  965|   139k|{
  966|   139k|    WORD32 row, col, i;
  967|   139k|    WORD32 tmp_u, tmp_v;
  968|       |
  969|  1.20M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (969:18): [True: 1.06M, False: 139k]
  ------------------
  970|  1.06M|    {
  971|  6.23M|        for(col = 0; col < 2*wd; col+=2)
  ------------------
  |  Branch (971:22): [True: 5.16M, False: 1.06M]
  ------------------
  972|  5.16M|        {
  973|  5.16M|            tmp_u = 0;
  974|  5.16M|            tmp_v = 0;
  975|  25.7M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  25.7M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (975:24): [True: 20.6M, False: 5.16M]
  ------------------
  976|  20.6M|            {
  977|  20.6M|                tmp_u += pi1_coeff[i] * pu2_src[col + (i-1)*2];
  978|  20.6M|                tmp_v += pi1_coeff[i] * pu2_src[col + 1 + (i-1)*2];
  979|  20.6M|            }
  980|       |
  981|  5.16M|            pi2_dst[col] = tmp_u >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  5.16M|#define FILTER_PREC 6
  ------------------
  982|  5.16M|            pi2_dst[col + 1] = tmp_v >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  5.16M|#define FILTER_PREC 6
  ------------------
  983|  5.16M|        }
  984|       |
  985|  1.06M|        pu2_src += src_strd;
  986|  1.06M|        pi2_dst += dst_strd;
  987|  1.06M|    }
  988|   139k|}
ihevc_hbd_inter_pred_chroma_vert_w16out:
 1042|  39.4k|{
 1043|  39.4k|    WORD32 row, col, i;
 1044|  39.4k|    WORD32 tmp;
 1045|       |
 1046|   284k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1046:18): [True: 244k, False: 39.4k]
  ------------------
 1047|   244k|    {
 1048|  2.92M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1048:22): [True: 2.67M, False: 244k]
  ------------------
 1049|  2.67M|        {
 1050|  2.67M|            tmp = 0;
 1051|  13.3M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  13.3M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1051:24): [True: 10.6M, False: 2.67M]
  ------------------
 1052|  10.6M|            {
 1053|  10.6M|                tmp += pi1_coeff[i] * pu2_src[col + (i-1) * src_strd];
 1054|  10.6M|            }
 1055|       |
 1056|  2.67M|            pi2_dst[col] = tmp >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  2.67M|#define FILTER_PREC 6
  ------------------
 1057|  2.67M|        }
 1058|       |
 1059|   244k|        pu2_src += src_strd;
 1060|   244k|        pi2_dst += dst_strd;
 1061|   244k|    }
 1062|  39.4k|}
ihevc_hbd_inter_pred_chroma_vert_w16inp:
 1114|  38.6k|{
 1115|  38.6k|    WORD32 row, col, i;
 1116|  38.6k|    WORD32 tmp;
 1117|       |
 1118|   207k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1118:18): [True: 168k, False: 38.6k]
  ------------------
 1119|   168k|    {
 1120|  1.68M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1120:22): [True: 1.51M, False: 168k]
  ------------------
 1121|  1.51M|        {
 1122|  1.51M|            tmp = 0;
 1123|  7.59M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  7.59M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1123:24): [True: 6.07M, False: 1.51M]
  ------------------
 1124|  6.07M|            {
 1125|  6.07M|                tmp += pi1_coeff[i] * pi2_src[col + (i-1) * src_strd];
 1126|  6.07M|            }
 1127|       |
 1128|  1.51M|            tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.51M|#define FILTER_PREC 6
  ------------------
                          tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.51M|#define FILTER_PREC 6
  ------------------
 1129|       |
 1130|  1.51M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 865, False: 1.51M]
  |  |  |  Branch (40:53): [True: 24.6k, False: 1.49M]
  |  |  ------------------
  ------------------
 1131|  1.51M|            pu2_dst[col] = tmp;
 1132|  1.51M|        }
 1133|       |
 1134|   168k|        pi2_src += src_strd;
 1135|   168k|        pu2_dst += dst_strd;
 1136|   168k|    }
 1137|  38.6k|}
ihevc_hbd_inter_pred_chroma_vert_w16inp_w16out:
 1191|  75.9k|{
 1192|  75.9k|    WORD32 row, col, i;
 1193|  75.9k|    WORD32 tmp;
 1194|       |
 1195|   494k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1195:18): [True: 418k, False: 75.9k]
  ------------------
 1196|   418k|    {
 1197|  4.76M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1197:22): [True: 4.35M, False: 418k]
  ------------------
 1198|  4.35M|        {
 1199|  4.35M|            tmp = 0;
 1200|  21.7M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  21.7M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1200:24): [True: 17.3M, False: 4.35M]
  ------------------
 1201|  17.3M|            {
 1202|  17.3M|                tmp += pi1_coeff[i] * pi2_src[col + (i-1) * src_strd];
 1203|  17.3M|            }
 1204|       |
 1205|  4.35M|            tmp = (tmp >> FILTER_PREC);
  ------------------
  |  |   44|  4.35M|#define FILTER_PREC 6
  ------------------
 1206|       |
 1207|  4.35M|            pi2_dst[col] = tmp;
 1208|  4.35M|        }
 1209|       |
 1210|   418k|        pi2_src += src_strd;
 1211|   418k|        pi2_dst += dst_strd;
 1212|   418k|    }
 1213|  75.9k|}

ihevc_hbd_intra_pred_luma_ref_substitution:
  137|  3.19M|{
  138|  3.19M|    UWORD16 pu2_ref;
  139|  3.19M|    WORD32 dc_val, i;
  140|  3.19M|    WORD32 total_samples = (4 * nt) + 1;
  141|  3.19M|    WORD32 two_nt = 2 * nt;
  142|       |
  143|  3.19M|    WORD32 three_nt = 3 * nt;
  144|  3.19M|    WORD32 get_bits;
  145|  3.19M|    WORD32 next;
  146|  3.19M|    WORD32 bot_left, left, top, tp_right, tp_left;
  147|       |
  148|  3.19M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  149|       |
  150|  3.19M|    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|  3.19M|    if(nbr_flags == 0)
  ------------------
  |  Branch (158:8): [True: 26.4k, False: 3.16M]
  ------------------
  159|  26.4k|    {
  160|  2.38M|        for(i = 0; i < total_samples; i++)
  ------------------
  |  Branch (160:20): [True: 2.35M, False: 26.4k]
  ------------------
  161|  2.35M|        {
  162|  2.35M|            pu2_dst[i] = dc_val;
  163|  2.35M|        }
  164|  26.4k|    }
  165|  3.16M|    else
  166|  3.16M|    {
  167|  3.16M|        if(nt <= 8)
  ------------------
  |  Branch (167:12): [True: 2.14M, False: 1.01M]
  ------------------
  168|  2.14M|        {
  169|       |            /* 1 bit extraction for all the neighboring blocks */
  170|  2.14M|            tp_left = (nbr_flags & 0x10000) >> 16;
  171|  2.14M|            bot_left = (nbr_flags & 0x8)>>3;
  172|  2.14M|            left = (nbr_flags & 0x80) >> 7;
  173|  2.14M|            top = (nbr_flags & 0x100) >> 8;
  174|  2.14M|            tp_right = (nbr_flags & 0x1000) >> 12;
  175|       |
  176|       |            /* Else fill the corresponding samples */
  177|  2.14M|            if(tp_left)
  ------------------
  |  Branch (177:16): [True: 1.97M, False: 176k]
  ------------------
  178|  1.97M|                pu2_dst[two_nt] = *pu2_top_left;
  179|   176k|            else
  180|   176k|                pu2_dst[two_nt] = 0;
  181|       |
  182|       |
  183|  2.14M|            if(left)
  ------------------
  |  Branch (183:16): [True: 2.06M, False: 78.2k]
  ------------------
  184|  2.06M|            {
  185|  12.9M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (185:28): [True: 10.8M, False: 2.06M]
  ------------------
  186|  10.8M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  187|  2.06M|            }
  188|  78.2k|            else
  189|  78.2k|            {
  190|   489k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (190:28): [True: 411k, False: 78.2k]
  ------------------
  191|   411k|                    pu2_dst[two_nt - 1 - i] = 0;
  192|  78.2k|            }
  193|       |
  194|  2.14M|            if(bot_left)
  ------------------
  |  Branch (194:16): [True: 652k, False: 1.49M]
  ------------------
  195|   652k|            {
  196|  4.08M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (196:29): [True: 3.43M, False: 652k]
  ------------------
  197|  3.43M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  198|   652k|            }
  199|  1.49M|            else
  200|  1.49M|            {
  201|  9.35M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (201:29): [True: 7.85M, False: 1.49M]
  ------------------
  202|  7.85M|                    pu2_dst[two_nt - 1 - i] = 0;
  203|  1.49M|            }
  204|       |
  205|  2.14M|            if(top)
  ------------------
  |  Branch (205:16): [True: 2.04M, False: 100k]
  ------------------
  206|  2.04M|            {
  207|  12.7M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (207:28): [True: 10.7M, False: 2.04M]
  ------------------
  208|  10.7M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  209|  2.04M|            }
  210|   100k|            else
  211|   100k|            {
  212|   666k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (212:28): [True: 566k, False: 100k]
  ------------------
  213|   566k|                    pu2_dst[two_nt + 1 + i] = 0;
  214|   100k|            }
  215|       |
  216|  2.14M|            if(tp_right)
  ------------------
  |  Branch (216:16): [True: 1.30M, False: 844k]
  ------------------
  217|  1.30M|            {
  218|  8.04M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (218:29): [True: 6.74M, False: 1.30M]
  ------------------
  219|  6.74M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  220|  1.30M|            }
  221|   844k|            else
  222|   844k|            {
  223|  5.39M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (223:29): [True: 4.55M, False: 844k]
  ------------------
  224|  4.55M|                    pu2_dst[two_nt + 1 + i] = 0;
  225|   844k|            }
  226|  2.14M|            next = 1;
  227|       |
  228|       |            /* If bottom -left is not available, reverse substitution process */
  229|  2.14M|            if(bot_left == 0)
  ------------------
  |  Branch (229:16): [True: 1.50M, False: 647k]
  ------------------
  230|  1.50M|            {
  231|  1.50M|                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.65M|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (234:23): [True: 157k, False: 1.50M]
  ------------------
  235|   157k|                    next++;
  236|       |
  237|       |                /* If Left, top-left are available */
  238|  1.50M|                if(next <= 2)
  ------------------
  |  Branch (238:20): [True: 1.42M, False: 77.2k]
  ------------------
  239|  1.42M|                {
  240|  1.42M|                    idx = nt * next;
  241|  1.42M|                    pu2_ref = pu2_dst[idx];
  242|  8.88M|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (242:32): [True: 7.46M, False: 1.42M]
  ------------------
  243|  7.46M|                        pu2_dst[i] = pu2_ref;
  244|  1.42M|                }
  245|  77.2k|                else /* If top, top-right are available */
  246|  77.2k|                {
  247|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available */
  248|  77.2k|                    idx = (nt * (next - 1)) + 1;
  249|  77.2k|                    pu2_ref = pu2_dst[idx];
  250|   970k|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (250:32): [True: 893k, False: 77.2k]
  ------------------
  251|   893k|                        pu2_dst[i] = pu2_ref;
  252|  77.2k|                }
  253|  1.50M|            }
  254|       |
  255|       |            /* Forward Substitution Process */
  256|       |            /* If left is Unavailable, copy the last bottom-left value */
  257|  2.14M|            if(left == 0)
  ------------------
  |  Branch (257:16): [True: 79.0k, False: 2.06M]
  ------------------
  258|  79.0k|            {
  259|   490k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (259:28): [True: 411k, False: 79.0k]
  ------------------
  260|   411k|                    pu2_dst[nt + i] = pu2_dst[nt - 1];
  261|  79.0k|            }
  262|       |            /* If top-left is Unavailable, copy the last left value */
  263|  2.14M|            if(tp_left == 0)
  ------------------
  |  Branch (263:16): [True: 178k, False: 1.96M]
  ------------------
  264|   178k|                pu2_dst[two_nt] = pu2_dst[two_nt - 1];
  265|       |            /* If top is Unavailable, copy the last top-left value */
  266|  2.14M|            if(top == 0)
  ------------------
  |  Branch (266:16): [True: 99.5k, False: 2.04M]
  ------------------
  267|  99.5k|            {
  268|   665k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (268:28): [True: 566k, False: 99.5k]
  ------------------
  269|   566k|                    pu2_dst[two_nt + 1 + i] = pu2_dst[two_nt];
  270|  99.5k|            }
  271|       |            /* If to right is Unavailable, copy the last top value */
  272|  2.14M|            if(tp_right == 0)
  ------------------
  |  Branch (272:16): [True: 848k, False: 1.29M]
  ------------------
  273|   848k|            {
  274|  5.40M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (274:28): [True: 4.55M, False: 848k]
  ------------------
  275|  4.55M|                    pu2_dst[three_nt + 1 + i] = pu2_dst[three_nt];
  276|   848k|            }
  277|  2.14M|        }
  278|       |
  279|  3.16M|        if(nt == 16)
  ------------------
  |  Branch (279:12): [True: 453k, False: 2.71M]
  ------------------
  280|   453k|        {
  281|   453k|            WORD32 nbr_flags_temp = 0;
  282|   453k|            nbr_flags_temp = ((nbr_flags & 0xC)>>2) + ((nbr_flags & 0xC0) >> 4)
  283|   453k|                            + ((nbr_flags & 0x300) >> 4)
  284|   453k|                            + ((nbr_flags & 0x3000) >> 6)
  285|   453k|                            + ((nbr_flags & 0x10000) >> 8);
  286|       |
  287|       |            /* Else fill the corresponding samples */
  288|   453k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (288:16): [True: 361k, False: 91.4k]
  ------------------
  289|   361k|                pu2_dst[two_nt] = *pu2_top_left;
  290|  91.4k|            else
  291|  91.4k|                pu2_dst[two_nt] = 0;
  292|       |
  293|   453k|            if(nbr_flags & 0xC0)
  ------------------
  |  Branch (293:16): [True: 420k, False: 32.9k]
  ------------------
  294|   420k|            {
  295|  7.14M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (295:28): [True: 6.72M, False: 420k]
  ------------------
  296|  6.72M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  297|   420k|            }
  298|  32.9k|            else
  299|  32.9k|            {
  300|   561k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (300:28): [True: 528k, False: 32.9k]
  ------------------
  301|   528k|                    pu2_dst[two_nt - 1 - i] = 0;
  302|  32.9k|            }
  303|       |
  304|   453k|            if(nbr_flags & 0xC)
  ------------------
  |  Branch (304:16): [True: 117k, False: 336k]
  ------------------
  305|   117k|            {
  306|  1.98M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (306:29): [True: 1.87M, False: 117k]
  ------------------
  307|  1.87M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  308|   117k|            }
  309|   336k|            else
  310|   336k|            {
  311|  5.72M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (311:29): [True: 5.38M, False: 336k]
  ------------------
  312|  5.38M|                    pu2_dst[two_nt - 1 - i] = 0;
  313|   336k|            }
  314|       |
  315|       |
  316|   453k|            if(nbr_flags & 0x300)
  ------------------
  |  Branch (316:16): [True: 394k, False: 59.2k]
  ------------------
  317|   394k|            {
  318|  6.69M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (318:28): [True: 6.29M, False: 394k]
  ------------------
  319|  6.29M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  320|   394k|            }
  321|  59.2k|            else
  322|  59.2k|            {
  323|  1.02M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (323:28): [True: 960k, False: 59.2k]
  ------------------
  324|   960k|                    pu2_dst[two_nt + 1 + i] = 0;
  325|  59.2k|            }
  326|       |
  327|   453k|            if(nbr_flags & 0x3000)
  ------------------
  |  Branch (327:16): [True: 253k, False: 200k]
  ------------------
  328|   253k|            {
  329|  4.30M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (329:29): [True: 4.05M, False: 253k]
  ------------------
  330|  4.05M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  331|   253k|            }
  332|   200k|            else
  333|   200k|            {
  334|  3.42M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (334:29): [True: 3.22M, False: 200k]
  ------------------
  335|  3.22M|                    pu2_dst[two_nt + 1 + i] = 0;
  336|   200k|            }
  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|   453k|            {
  340|   453k|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 8; /* for below left and left */
  ------------------
  |  |   43|   453k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 32.9k, False: 420k]
  |  |  ------------------
  ------------------
  341|       |
  342|   453k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (342:20): [True: 32.9k, False: 420k]
  ------------------
  343|  32.9k|                    nbr_id_from_bl = 32;
  344|       |
  345|   453k|                if(nbr_id_from_bl == 32)
  ------------------
  |  Branch (345:20): [True: 32.9k, False: 420k]
  ------------------
  346|  32.9k|                {
  347|       |                    /* for top left : 1 pel per nbr bit */
  348|  32.9k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (348:24): [True: 32.3k, False: 659]
  ------------------
  349|  32.3k|                    {
  350|  32.3k|                        nbr_id_from_bl++;
  351|  32.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|  32.3k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 32.3k]
  |  |  ------------------
  ------------------
  352|  32.3k|                    }
  353|  32.9k|                }
  354|       |                /* Reverse Substitution Process */
  355|   453k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (355:20): [True: 343k, False: 110k]
  ------------------
  356|   343k|                {
  357|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  358|   343k|                    pu2_ref = pu2_dst[nbr_id_from_bl];
  359|  6.34M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (359:51): [True: 6.00M, False: 343k]
  ------------------
  360|  6.00M|                    {
  361|  6.00M|                        pu2_dst[i] = pu2_ref;
  362|  6.00M|                    }
  363|   343k|                }
  364|   453k|            }
  365|       |
  366|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  367|  3.75M|            while(nbr_id_from_bl < ((T16_4NT) + 1))
  ------------------
  |  |   66|  3.75M|#define T16_4NT 64
  ------------------
  |  Branch (367:19): [True: 3.30M, False: 453k]
  ------------------
  368|  3.30M|            {
  369|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  370|       |                /* Devide by 8 to obtain the original index */
  371|  3.30M|                frwd_nbr_flag = (nbr_id_from_bl >> 3);
  372|       |
  373|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  374|  3.30M|                if(nbr_id_from_bl == (T16_4NT / 2))
  ------------------
  |  |   66|  3.30M|#define T16_4NT 64
  ------------------
  |  Branch (374:20): [True: 421k, False: 2.88M]
  ------------------
  375|   421k|                {
  376|   421k|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|   421k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  377|       |
  378|       |                    /* only pel substitution for TL */
  379|   421k|                    if(!get_bits)
  ------------------
  |  Branch (379:24): [True: 59.4k, False: 361k]
  ------------------
  380|  59.4k|                        pu2_dst[nbr_id_from_bl] = pu2_dst[nbr_id_from_bl - 1];
  381|   421k|                }
  382|  2.88M|                else
  383|  2.88M|                {
  384|  2.88M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  2.88M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  385|  2.88M|                    if(!get_bits)
  ------------------
  |  Branch (385:24): [True: 523k, False: 2.35M]
  ------------------
  386|   523k|                    {
  387|       |                        /* 8 pel substitution (other than TL) */
  388|   523k|                        pu2_ref = pu2_dst[nbr_id_from_bl - 1];
  389|  4.70M|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (389:36): [True: 4.18M, False: 523k]
  ------------------
  390|  4.18M|                            pu2_dst[nbr_id_from_bl + i] = pu2_ref;
  391|   523k|                    }
  392|  2.88M|                }
  393|  3.30M|                nbr_id_from_bl += (nbr_id_from_bl == (T16_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   66|  3.30M|#define T16_4NT 64
  ------------------
  |  Branch (393:35): [True: 421k, False: 2.88M]
  ------------------
  394|  3.30M|            }
  395|   453k|        }
  396|       |
  397|  3.16M|        if(nt == 32)
  ------------------
  |  Branch (397:12): [True: 567k, False: 2.59M]
  ------------------
  398|   567k|        {
  399|       |            /* Else fill the corresponding samples */
  400|   567k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (400:16): [True: 376k, False: 190k]
  ------------------
  401|   376k|                pu2_dst[two_nt] = *pu2_top_left;
  402|   190k|            else
  403|   190k|                pu2_dst[two_nt] = 0;
  404|       |
  405|   567k|            if(nbr_flags & 0xF0)
  ------------------
  |  Branch (405:16): [True: 543k, False: 23.7k]
  ------------------
  406|   543k|            {
  407|  17.8M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (407:28): [True: 17.3M, False: 543k]
  ------------------
  408|  17.3M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  409|   543k|            }
  410|  23.7k|            else
  411|  23.7k|            {
  412|   787k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (412:28): [True: 763k, False: 23.7k]
  ------------------
  413|   763k|                    pu2_dst[two_nt - 1 - i] = 0;
  414|  23.7k|            }
  415|       |
  416|   567k|            if(nbr_flags & 0xF)
  ------------------
  |  Branch (416:16): [True: 131k, False: 436k]
  ------------------
  417|   131k|            {
  418|  4.32M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (418:29): [True: 4.19M, False: 131k]
  ------------------
  419|  4.19M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  420|   131k|            }
  421|   436k|            else
  422|   436k|            {
  423|  14.4M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (423:29): [True: 13.9M, False: 436k]
  ------------------
  424|  13.9M|                    pu2_dst[two_nt - 1 - i] = 0;
  425|   436k|            }
  426|       |
  427|   567k|            if(nbr_flags & 0xF00)
  ------------------
  |  Branch (427:16): [True: 400k, False: 167k]
  ------------------
  428|   400k|            {
  429|  13.1M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (429:28): [True: 12.7M, False: 400k]
  ------------------
  430|  12.7M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  431|   400k|            }
  432|   167k|            else
  433|   167k|            {
  434|  5.54M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (434:28): [True: 5.37M, False: 167k]
  ------------------
  435|  5.37M|                    pu2_dst[two_nt + 1 + i] = 0;
  436|   167k|            }
  437|       |
  438|   567k|            if(nbr_flags & 0xF000)
  ------------------
  |  Branch (438:16): [True: 259k, False: 307k]
  ------------------
  439|   259k|            {
  440|  8.56M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (440:29): [True: 8.30M, False: 259k]
  ------------------
  441|  8.30M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  442|   259k|            }
  443|   307k|            else
  444|   307k|            {
  445|  10.1M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (445:29): [True: 9.86M, False: 307k]
  ------------------
  446|  9.86M|                    pu2_dst[two_nt + 1 + i] = 0;
  447|   307k|            }
  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|   567k|            {
  451|   567k|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 8; /* for below left and left */
  ------------------
  |  |   43|   567k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 23.7k, False: 543k]
  |  |  ------------------
  ------------------
  452|       |
  453|   567k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (453:20): [True: 23.7k, False: 543k]
  ------------------
  454|  23.7k|                {
  455|       |                    /* for top left : 1 pel per nbr bit */
  456|  23.7k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (456:24): [True: 23.5k, False: 192]
  ------------------
  457|  23.5k|                    {
  458|       |                        /* top left not available */
  459|  23.5k|                        nbr_id_from_bl++;
  460|       |                        /* top and top right;  8 pels per nbr bit */
  461|  23.5k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 8;
  ------------------
  |  |   43|  23.5k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 23.5k]
  |  |  ------------------
  ------------------
  462|  23.5k|                    }
  463|  23.7k|                }
  464|       |                /* Reverse Substitution Process */
  465|   567k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (465:20): [True: 437k, False: 130k]
  ------------------
  466|   437k|                {
  467|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  468|   437k|                    pu2_ref = pu2_dst[nbr_id_from_bl];
  469|  15.1M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (469:51): [True: 14.7M, False: 437k]
  ------------------
  470|  14.7M|                        pu2_dst[i] = pu2_ref;
  471|   437k|                }
  472|   567k|            }
  473|       |
  474|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  475|  8.34M|            while(nbr_id_from_bl < ((T32_4NT) + 1))
  ------------------
  |  |   65|  8.34M|#define T32_4NT 128
  ------------------
  |  Branch (475:19): [True: 7.78M, False: 567k]
  ------------------
  476|  7.78M|            {
  477|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  478|       |                /* Devide by 8 to obtain the original index */
  479|  7.78M|                frwd_nbr_flag = (nbr_id_from_bl >> 3);
  480|       |
  481|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  482|  7.78M|                if(nbr_id_from_bl == (T32_4NT / 2))
  ------------------
  |  |   65|  7.78M|#define T32_4NT 128
  ------------------
  |  Branch (482:20): [True: 544k, False: 7.23M]
  ------------------
  483|   544k|                {
  484|   544k|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|   544k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  485|       |                    /* only pel substitution for TL */
  486|   544k|                    if(!get_bits)
  ------------------
  |  Branch (486:24): [True: 167k, False: 376k]
  ------------------
  487|   167k|                        pu2_dst[nbr_id_from_bl] = pu2_dst[nbr_id_from_bl - 1];
  488|   544k|                }
  489|  7.23M|                else
  490|  7.23M|                {
  491|  7.23M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  7.23M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  492|  7.23M|                    if(!get_bits)
  ------------------
  |  Branch (492:24): [True: 1.91M, False: 5.32M]
  ------------------
  493|  1.91M|                    {
  494|       |                        /* 8 pel substitution (other than TL) */
  495|  1.91M|                        pu2_ref = pu2_dst[nbr_id_from_bl - 1];
  496|  17.2M|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (496:36): [True: 15.3M, False: 1.91M]
  ------------------
  497|  15.3M|                            pu2_dst[nbr_id_from_bl + i] = pu2_ref;
  498|  1.91M|                    }
  499|  7.23M|                }
  500|  7.78M|                nbr_id_from_bl += (nbr_id_from_bl == (T32_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   65|  7.78M|#define T32_4NT 128
  ------------------
  |  Branch (500:35): [True: 543k, False: 7.23M]
  ------------------
  501|  7.78M|            }
  502|   567k|        }
  503|  3.16M|    }
  504|  3.19M|}
ihevc_hbd_intra_pred_ref_filtering:
  547|  3.19M|{
  548|  3.19M|    WORD32 filter_flag;
  549|  3.19M|    WORD32 i; /* Generic indexing variable */
  550|  3.19M|    WORD32 four_nt = 4 * nt;
  551|  3.19M|    UWORD16 au2_flt[(4 * MAX_CU_SIZE) + 1];
  552|  3.19M|    WORD32 bi_linear_int_flag = 0;
  553|  3.19M|    WORD32 abs_cond_left_flag = 0;
  554|  3.19M|    WORD32 abs_cond_top_flag = 0;
  555|  3.19M|    WORD32 dc_val = 1 << (bit_depth - 5);
  556|  3.19M|    WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3);
  557|  3.19M|    WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1;
  558|       |
  559|  3.19M|    filter_flag = intra_smoothing_disabled ?
  ------------------
  |  Branch (559:19): [True: 22.9k, False: 3.17M]
  ------------------
  560|  3.17M|                    0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)));
  561|  3.19M|    if(0 == filter_flag)
  ------------------
  |  Branch (561:8): [True: 2.30M, False: 887k]
  ------------------
  562|  2.30M|    {
  563|  2.30M|        if(pu2_src == pu2_dst)
  ------------------
  |  Branch (563:12): [True: 2.30M, False: 18.4E]
  ------------------
  564|  2.30M|        {
  565|  2.30M|            return;
  566|  2.30M|        }
  567|  18.4E|        else
  568|  18.4E|        {
  569|  18.4E|            for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (569:24): [True: 0, False: 18.4E]
  ------------------
  570|      0|                pu2_dst[i] = pu2_src[i];
  571|  18.4E|        }
  572|  2.30M|    }
  573|   887k|    else
  574|   887k|    {
  575|       |        /* If strong intra smoothin is enabled and transform size is 32 */
  576|   887k|        if((1 == strong_intra_smoothing_enable_flag) && (32 == nt))
  ------------------
  |  Branch (576:12): [True: 66.2k, False: 821k]
  |  Branch (576:57): [True: 6.92k, False: 59.3k]
  ------------------
  577|  6.92k|        {
  578|       |            /* Strong Intra Filtering */
  579|  6.92k|            abs_cond_top_flag = (ABS(pu2_src[2 * nt] + pu2_src[4 * nt]
  ------------------
  |  |   45|  6.92k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.62k, False: 4.29k]
  |  |  ------------------
  ------------------
  580|  6.92k|                                            - (2 * pu2_src[3 * nt]))) < dc_val;
  581|  6.92k|            abs_cond_left_flag = (ABS(pu2_src[2 * nt] + pu2_src[0]
  ------------------
  |  |   45|  6.92k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.28k, False: 5.63k]
  |  |  ------------------
  ------------------
  582|  6.92k|                                            - (2 * pu2_src[nt]))) < dc_val;
  583|       |
  584|  6.92k|            bi_linear_int_flag = ((1 == abs_cond_left_flag)
  ------------------
  |  Branch (584:35): [True: 5.23k, False: 1.69k]
  ------------------
  585|  5.23k|                                    && (1 == abs_cond_top_flag));
  ------------------
  |  Branch (585:40): [True: 3.06k, False: 2.16k]
  ------------------
  586|  6.92k|        }
  587|       |        /* Extremities Untouched */
  588|   887k|        au2_flt[0] = pu2_src[0];
  589|   887k|        au2_flt[4 * nt] = pu2_src[4 * nt];
  590|       |
  591|       |        /* Strong filtering of reference samples */
  592|   887k|        if(1 == bi_linear_int_flag)
  ------------------
  |  Branch (592:12): [True: 3.06k, False: 884k]
  ------------------
  593|  3.06k|        {
  594|  3.06k|            au2_flt[2 * nt] = pu2_src[2 * nt];
  595|       |
  596|   196k|            for(i = 1; i < (2 * nt) ; i++ )
  ------------------
  |  Branch (596:24): [True: 193k, False: 3.06k]
  ------------------
  597|   193k|                au2_flt[i] = (((2 * nt) - i) * pu2_src[0] + i * pu2_src[2 * nt] + 32) >> 6;
  598|       |
  599|   196k|            for(i = 1; i < (2 * nt) ; i++ )
  ------------------
  |  Branch (599:24): [True: 193k, False: 3.06k]
  ------------------
  600|   193k|                au2_flt[i + (2 * nt)] = (((2 * nt) - i) * pu2_src[2 * nt] + i * pu2_src[4 * nt] + 32) >> 6;
  601|  3.06k|        }
  602|   884k|        else
  603|   884k|        {
  604|       |            /* Perform bilinear filtering of Reference Samples */
  605|  74.3M|            for(i = 0; i < (four_nt - 1); i++)
  ------------------
  |  Branch (605:24): [True: 73.4M, False: 884k]
  ------------------
  606|  73.4M|            {
  607|  73.4M|                au2_flt[i + 1] = (pu2_src[i] + 2 * pu2_src[i + 1]
  608|  73.4M|                                + pu2_src[i + 2] + 2) >> 2;
  609|  73.4M|            }
  610|   884k|        }
  611|       |
  612|  76.4M|        for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (612:20): [True: 75.5M, False: 887k]
  ------------------
  613|  75.5M|            pu2_dst[i] = au2_flt[i];
  614|   887k|    }
  615|  3.19M|}
ihevc_hbd_intra_pred_luma_planar:
  665|   935k|{
  666|   935k|    WORD32 row, col;
  667|   935k|    WORD32 log2nt = 5;
  668|   935k|    WORD32 two_nt, three_nt;
  669|       |
  670|   935k|    switch(nt)
  671|   935k|    {
  672|   207k|        case 32:
  ------------------
  |  Branch (672:9): [True: 207k, False: 728k]
  ------------------
  673|   207k|            log2nt = 5;
  674|   207k|            break;
  675|   142k|        case 16:
  ------------------
  |  Branch (675:9): [True: 142k, False: 793k]
  ------------------
  676|   142k|            log2nt = 4;
  677|   142k|            break;
  678|   186k|        case 8:
  ------------------
  |  Branch (678:9): [True: 186k, False: 748k]
  ------------------
  679|   186k|            log2nt = 3;
  680|   186k|            break;
  681|   399k|        case 4:
  ------------------
  |  Branch (681:9): [True: 399k, False: 536k]
  ------------------
  682|   399k|            log2nt = 2;
  683|   399k|            break;
  684|      0|        default:
  ------------------
  |  Branch (684:9): [True: 0, False: 935k]
  ------------------
  685|      0|            break;
  686|   935k|    }
  687|   935k|    two_nt = 2 * nt;
  688|   935k|    three_nt = 3 * nt;
  689|       |
  690|       |    /* Planar filtering */
  691|  12.6M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (691:18): [True: 11.7M, False: 935k]
  ------------------
  692|  11.7M|    {
  693|   269M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (693:22): [True: 258M, False: 11.7M]
  ------------------
  694|   258M|        {
  695|   258M|            pu2_dst[row * dst_strd + col] = ((nt - 1 - col)
  696|   258M|                            * pu2_ref[two_nt - 1 - row]
  697|   258M|                            + (col + 1) * pu2_ref[three_nt + 1]
  698|   258M|                            + (nt - 1 - row) * pu2_ref[two_nt + 1 + col]
  699|   258M|                            + (row + 1) * pu2_ref[nt - 1] + nt) >> (log2nt + 1);
  700|   258M|        }
  701|  11.7M|    }
  702|   935k|}
ihevc_hbd_intra_pred_luma_dc:
  752|   499k|{
  753|   499k|    WORD32 acc_dc;
  754|   499k|    WORD32 dc_val, two_dc_val, three_dc_val;
  755|   499k|    WORD32 i;
  756|   499k|    WORD32 row, col;
  757|   499k|    WORD32 log2nt = 5;
  758|   499k|    WORD32 two_nt, three_nt;
  759|       |
  760|   499k|    switch(nt)
  761|   499k|    {
  762|  91.6k|        case 32:
  ------------------
  |  Branch (762:9): [True: 91.6k, False: 408k]
  ------------------
  763|  91.6k|            log2nt = 5;
  764|  91.6k|            break;
  765|  85.5k|        case 16:
  ------------------
  |  Branch (765:9): [True: 85.5k, False: 414k]
  ------------------
  766|  85.5k|            log2nt = 4;
  767|  85.5k|            break;
  768|   111k|        case 8:
  ------------------
  |  Branch (768:9): [True: 111k, False: 388k]
  ------------------
  769|   111k|            log2nt = 3;
  770|   111k|            break;
  771|   211k|        case 4:
  ------------------
  |  Branch (771:9): [True: 211k, False: 288k]
  ------------------
  772|   211k|            log2nt = 2;
  773|   211k|            break;
  774|      0|        default:
  ------------------
  |  Branch (774:9): [True: 0, False: 499k]
  ------------------
  775|      0|            break;
  776|   499k|    }
  777|   499k|    two_nt = 2 * nt;
  778|   499k|    three_nt = 3 * nt;
  779|       |
  780|   499k|    acc_dc = 0;
  781|       |    /* Calculate DC value for the transform block */
  782|  6.53M|    for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (782:17): [True: 6.03M, False: 499k]
  ------------------
  783|  6.03M|        acc_dc += pu2_ref[i];
  784|       |
  785|  6.53M|    for(i = (two_nt + 1); i <= three_nt; i++)
  ------------------
  |  Branch (785:27): [True: 6.03M, False: 499k]
  ------------------
  786|  6.03M|        acc_dc += pu2_ref[i];
  787|       |
  788|   499k|    dc_val = (acc_dc + nt) >> (log2nt + 1);
  789|       |
  790|   499k|    two_dc_val = 2 * dc_val;
  791|   499k|    three_dc_val = 3 * dc_val;
  792|       |
  793|       |
  794|   499k|    if(nt == 32)
  ------------------
  |  Branch (794:8): [True: 91.7k, False: 408k]
  ------------------
  795|  91.7k|    {
  796|  3.00M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (796:22): [True: 2.91M, False: 91.7k]
  ------------------
  797|  95.9M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (797:26): [True: 93.0M, False: 2.91M]
  ------------------
  798|  93.0M|                pu2_dst[(row * dst_strd) + col] = dc_val;
  799|  91.7k|    }
  800|   408k|    else
  801|   408k|    {
  802|       |        /* DC filtering for the first top row and first left column */
  803|   408k|        pu2_dst[0] = ((pu2_ref[two_nt - 1] + two_dc_val + pu2_ref[two_nt + 1] + 2)
  804|   408k|                        >> 2);
  805|       |
  806|  3.10M|        for(col = 1; col < nt; col++)
  ------------------
  |  Branch (806:22): [True: 2.69M, False: 408k]
  ------------------
  807|  2.69M|            pu2_dst[col] = (pu2_ref[two_nt + 1 + col] + three_dc_val + 2) >> 2;
  808|       |
  809|  3.10M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (809:22): [True: 2.69M, False: 408k]
  ------------------
  810|  2.69M|            pu2_dst[row * dst_strd] = (pu2_ref[two_nt - 1 - row] + three_dc_val + 2)
  811|  2.69M|                            >> 2;
  812|       |
  813|       |        /* Fill the remaining rows with DC value */
  814|  3.09M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (814:22): [True: 2.69M, False: 408k]
  ------------------
  815|  29.2M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (815:26): [True: 26.5M, False: 2.69M]
  ------------------
  816|  26.5M|                pu2_dst[(row * dst_strd) + col] = dc_val;
  817|   408k|    }
  818|   499k|}
ihevc_hbd_intra_pred_luma_horz:
  869|  36.7k|{
  870|       |
  871|  36.7k|    WORD32 row, col;
  872|  36.7k|    WORD32 two_nt;
  873|  36.7k|    WORD16 s2_predpixel;
  874|       |
  875|  36.7k|    two_nt = 2 * nt;
  876|       |
  877|  36.7k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (877:8): [True: 5.80k, False: 30.9k]
  |  Branch (877:20): [True: 776, False: 30.2k]
  ------------------
  878|  6.58k|    {
  879|   195k|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (879:22): [True: 188k, False: 6.58k]
  ------------------
  880|  6.14M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (880:26): [True: 5.95M, False: 188k]
  ------------------
  881|  5.95M|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt - 1 - row];
  882|  6.58k|    }
  883|  30.2k|    else
  884|  30.2k|    {
  885|       |        /* Filtering done for the 1st row */
  886|   234k|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (886:22): [True: 204k, False: 30.2k]
  ------------------
  887|   204k|        {
  888|   204k|            s2_predpixel = pu2_ref[two_nt - 1]
  889|   204k|                            + ((pu2_ref[two_nt + 1 + col] - pu2_ref[two_nt]) >> 1);
  890|       |
  891|   204k|            pu2_dst[col] = CLIP3(s2_predpixel,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|   204k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.55k, False: 201k]
  |  |  |  Branch (40:53): [True: 1.00k, False: 200k]
  |  |  ------------------
  ------------------
  892|       |
  893|   204k|        }
  894|       |
  895|       |        /* Replication to next rows */
  896|   204k|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (896:22): [True: 174k, False: 30.2k]
  ------------------
  897|  1.83M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (897:26): [True: 1.66M, False: 174k]
  ------------------
  898|  1.66M|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt - 1 - row];
  899|  30.2k|    }
  900|  36.7k|}
ihevc_hbd_intra_pred_luma_ver:
  948|   410k|{
  949|   410k|    WORD32 row, col;
  950|   410k|    WORD16 s2_predpixel;
  951|   410k|    WORD32 two_nt = 2 * nt;
  952|       |
  953|   410k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (953:8): [True: 90.5k, False: 319k]
  |  Branch (953:20): [True: 2.83k, False: 317k]
  ------------------
  954|  93.5k|    {
  955|       |        /* Replication to next columns */
  956|  2.95M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (956:22): [True: 2.86M, False: 93.5k]
  ------------------
  957|  93.8M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (957:26): [True: 90.9M, False: 2.86M]
  ------------------
  958|  90.9M|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt + 1 + col];
  959|  93.5k|    }
  960|   317k|    else
  961|   317k|    {
  962|       |        /* Filtering done for the 1st column */
  963|  2.91M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (963:22): [True: 2.59M, False: 317k]
  ------------------
  964|  2.59M|        {
  965|  2.59M|            s2_predpixel = pu2_ref[two_nt + 1]
  966|  2.59M|                            + ((pu2_ref[two_nt - 1 - row] - pu2_ref[two_nt]) >> 1);
  967|       |
  968|  2.59M|            pu2_dst[row * dst_strd] = CLIP3(s2_predpixel,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  2.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 57.7k, False: 2.53M]
  |  |  |  Branch (40:53): [True: 18.1k, False: 2.52M]
  |  |  ------------------
  ------------------
  969|  2.59M|        }
  970|       |
  971|       |        /* Replication to next columns */
  972|  2.90M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (972:22): [True: 2.58M, False: 317k]
  ------------------
  973|  28.5M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (973:26): [True: 25.9M, False: 2.58M]
  ------------------
  974|  25.9M|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt + 1 + col];
  975|   317k|    }
  976|   410k|}
ihevc_hbd_intra_pred_luma_mode2:
 1024|   240k|{
 1025|   240k|    WORD32 row, col;
 1026|   240k|    WORD32 two_nt = 2 * nt;
 1027|   240k|    WORD32 intra_pred_ang = 32;
 1028|   240k|    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|  2.13M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1032:18): [True: 1.89M, False: 240k]
  ------------------
 1033|  1.89M|    {
 1034|  1.89M|        idx = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
 1035|       |
 1036|  34.7M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1036:22): [True: 32.8M, False: 1.89M]
  ------------------
 1037|  32.8M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[two_nt - row - idx - 1];
 1038|  1.89M|    }
 1039|   240k|}
ihevc_hbd_intra_pred_luma_mode_18_34:
 1087|  74.8k|{
 1088|  74.8k|    WORD32 row, col;
 1089|  74.8k|    WORD32 intra_pred_ang;
 1090|  74.8k|    WORD32 idx = 0;
 1091|  74.8k|    WORD32 two_nt = 2 * nt;
 1092|       |
 1093|  74.8k|    intra_pred_ang = 32;    /* Default value */
 1094|       |
 1095|       |    /* For mode 18, angle is -45degree */
 1096|  74.8k|    if(mode == 18)
  ------------------
  |  Branch (1096:8): [True: 39.1k, False: 35.6k]
  ------------------
 1097|  39.1k|        intra_pred_ang = -32;
 1098|       |    /* For mode 34, angle is 45degree */
 1099|  35.6k|    else if(mode == 34)
  ------------------
  |  Branch (1099:13): [True: 35.6k, False: 18.4E]
  ------------------
 1100|  35.6k|        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|   892k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1103:18): [True: 817k, False: 74.8k]
  ------------------
 1104|   817k|    {
 1105|   817k|        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|  17.4M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1112:22): [True: 16.6M, False: 817k]
  ------------------
 1113|  16.6M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[two_nt + col + idx + 1];
 1114|   817k|    }
 1115|  74.8k|}
ihevc_hbd_intra_pred_luma_mode_3_to_9:
 1165|   285k|{
 1166|   285k|    WORD32 row, col;
 1167|   285k|    WORD32 two_nt = 2 * nt;
 1168|   285k|    WORD32 intra_pred_ang;
 1169|   285k|    WORD32 idx, ref_main_idx;
 1170|   285k|    WORD32 pos, fract;
 1171|       |
 1172|       |    /* Intra Pred Angle according to the mode */
 1173|   285k|    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|  3.22M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1178:18): [True: 2.94M, False: 285k]
  ------------------
 1179|  2.94M|    {
 1180|  2.94M|        pos = ((col + 1) * intra_pred_ang);
 1181|  2.94M|        idx = pos >> 5;
 1182|  2.94M|        fract = pos & (31);
 1183|       |
 1184|       |        // Do linear filtering
 1185|  61.6M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1185:22): [True: 58.7M, False: 2.94M]
  ------------------
 1186|  58.7M|        {
 1187|  58.7M|            ref_main_idx = two_nt - row - idx - 1;
 1188|  58.7M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract)
 1189|  58.7M|                            * pu2_ref[ref_main_idx]
 1190|  58.7M|                            + fract * pu2_ref[ref_main_idx - 1] + 16) >> 5 );
 1191|  58.7M|        }
 1192|  2.94M|    }
 1193|   285k|}
ihevc_hbd_intra_pred_luma_mode_11_to_17:
 1242|   233k|{
 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|   233k|    WORD32 row, col, k;
 1248|   233k|    WORD32 two_nt;
 1249|   233k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1250|   233k|    WORD32 idx, ref_main_idx, ref_idx;
 1251|   233k|    WORD32 pos, fract;
 1252|       |
 1253|   233k|    UWORD16 ref_temp[2 * MAX_CU_SIZE + 1];
 1254|   233k|    UWORD16 *ref_main;
 1255|       |
 1256|   233k|    inv_ang_sum = 128;
 1257|   233k|    two_nt    = 2 * nt;
 1258|       |
 1259|   233k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1260|       |
 1261|   233k|    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|   233k|    ref_main = ref_temp + nt - 1;
 1267|  2.96M|    for(k = 0; k < nt + 1; k++)
  ------------------
  |  Branch (1267:16): [True: 2.73M, False: 233k]
  ------------------
 1268|  2.73M|        ref_temp[k + nt - 1] = pu2_ref[two_nt - k];
 1269|       |
 1270|   233k|    ref_main = ref_temp + nt - 1 ;
 1271|   233k|    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|  1.19M|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1276:17): [True: 959k, False: 233k]
  ------------------
 1277|   959k|    {
 1278|   959k|        inv_ang_sum += inv_ang;
 1279|   959k|        ref_main[k] = pu2_ref[two_nt + (inv_ang_sum >> 8)];
 1280|   959k|    }
 1281|       |
 1282|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1283|       |    /* samples dependent on distance to obtain destination sample */
 1284|  2.72M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1284:18): [True: 2.49M, False: 233k]
  ------------------
 1285|  2.49M|    {
 1286|  2.49M|        pos = ((col + 1) * intra_pred_ang);
 1287|  2.49M|        idx = pos >> 5;
 1288|  2.49M|        fract = pos & (31);
 1289|       |
 1290|       |        // Do linear filtering
 1291|  49.8M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1291:22): [True: 47.3M, False: 2.49M]
  ------------------
 1292|  47.3M|        {
 1293|  47.3M|            ref_main_idx = row + idx + 1;
 1294|  47.3M|            pu2_dst[col + (dst_strd * row)] = (UWORD16)(((32 - fract)
 1295|  47.3M|                            * ref_main[ref_main_idx]
 1296|  47.3M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5 );
 1297|  47.3M|        }
 1298|  2.49M|    }
 1299|   233k|}
ihevc_hbd_intra_pred_luma_mode_19_to_25:
 1350|   250k|{
 1351|   250k|    WORD32 row, col, k;
 1352|   250k|    WORD32 two_nt, intra_pred_ang, idx;
 1353|   250k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1354|   250k|    WORD32 ref_main_idx, ref_idx;
 1355|   250k|    UWORD16 ref_temp[(2 * MAX_CU_SIZE) + 1];
 1356|   250k|    UWORD16 *ref_main;
 1357|       |
 1358|   250k|    two_nt = 2 * nt;
 1359|   250k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1360|   250k|    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|   250k|    ref_main = ref_temp + nt - 1;
 1366|  3.22M|    for(k = 0; k < (nt + 1); k++)
  ------------------
  |  Branch (1366:16): [True: 2.97M, False: 250k]
  ------------------
 1367|  2.97M|        ref_temp[k + nt - 1] = pu2_ref[two_nt + k];
 1368|       |
 1369|   250k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1370|   250k|    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|  1.24M|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1375:17): [True: 992k, False: 250k]
  ------------------
 1376|   992k|    {
 1377|   992k|        inv_ang_sum += inv_ang;
 1378|   992k|        ref_main[k] = pu2_ref[two_nt - (inv_ang_sum >> 8)];
 1379|   992k|    }
 1380|       |
 1381|  2.96M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1381:18): [True: 2.71M, False: 250k]
  ------------------
 1382|  2.71M|    {
 1383|  2.71M|        pos = ((row + 1) * intra_pred_ang);
 1384|  2.71M|        idx = pos >> 5;
 1385|  2.71M|        fract = pos & (31);
 1386|       |
 1387|       |        // Do linear filtering
 1388|  56.9M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1388:22): [True: 54.2M, False: 2.71M]
  ------------------
 1389|  54.2M|        {
 1390|  54.2M|            ref_main_idx = col + idx + 1;
 1391|  54.2M|            pu2_dst[(row * dst_strd) + col] = (UWORD16)(((32 - fract)
 1392|  54.2M|                            * ref_main[ref_main_idx]
 1393|  54.2M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5 );
 1394|  54.2M|        }
 1395|  2.71M|    }
 1396|   250k|}
ihevc_hbd_intra_pred_luma_mode_27_to_33:
 1445|   237k|{
 1446|   237k|    WORD32 row, col;
 1447|   237k|    WORD32 two_nt, pos, fract;
 1448|   237k|    WORD32 intra_pred_ang;
 1449|   237k|    WORD32 idx, ref_main_idx;
 1450|       |
 1451|   237k|    two_nt = 2 * nt;
 1452|   237k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1453|       |
 1454|  2.73M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1454:18): [True: 2.49M, False: 237k]
  ------------------
 1455|  2.49M|    {
 1456|  2.49M|        pos = ((row + 1) * intra_pred_ang);
 1457|  2.49M|        idx = pos >> 5;
 1458|  2.49M|        fract = pos & (31);
 1459|       |
 1460|       |        // Do linear filtering
 1461|  49.4M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1461:22): [True: 47.0M, False: 2.49M]
  ------------------
 1462|  47.0M|        {
 1463|  47.0M|            ref_main_idx = two_nt + col + idx + 1;
 1464|  47.0M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract)
 1465|  47.0M|                            * pu2_ref[ref_main_idx]
 1466|  47.0M|                            + fract * pu2_ref[ref_main_idx + 1] + 16) >> 5 );
 1467|  47.0M|        }
 1468|  2.49M|    }
 1469|   237k|}

ihevc_hbd_itrans_recon_4x4_ttype1:
  110|   572k|{
  111|   572k|    WORD32 i, c[4];
  112|   572k|    WORD32 add;
  113|   572k|    WORD32 shift;
  114|   572k|    WORD16 *pi2_tmp_orig;
  115|   572k|    WORD32 trans_size;
  116|   572k|    WORD16 clip_limit;
  117|       |
  118|   572k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   572k|#define TRANS_SIZE_4   4
  ------------------
  119|       |
  120|   572k|    pi2_tmp_orig = pi2_tmp;
  121|       |
  122|       |    /* Inverse Transform 1st stage */
  123|   572k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   572k|#define IT_SHIFT_STAGE_1 7
  ------------------
  124|   572k|    add = 1 << (shift - 1);
  125|       |
  126|  2.86M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (126:16): [True: 2.28M, False: 572k]
  ------------------
  127|  2.28M|    {
  128|       |        /* Checking for Zero Cols */
  129|  2.28M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (129:12): [True: 780k, False: 1.50M]
  ------------------
  130|   780k|        {
  131|   780k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  132|   780k|        }
  133|  1.50M|        else
  134|  1.50M|        {
  135|       |            // Intermediate Variables
  136|  1.50M|            c[0] = pi2_src[0] + pi2_src[2 * src_strd];
  137|  1.50M|            c[1] = pi2_src[2 * src_strd] + pi2_src[3 * src_strd];
  138|  1.50M|            c[2] = pi2_src[0] - pi2_src[3 * src_strd];
  139|  1.50M|            c[3] = 74 * pi2_src[src_strd];
  140|       |
  141|  1.50M|            pi2_tmp[0] =
  142|  1.50M|                            CLIP_S16(( 29 * c[0] + 55 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.50M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.50M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.62k, False: 1.49M]
  |  |  |  |  |  Branch (40:53): [True: 846, False: 1.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|  1.50M|            pi2_tmp[1] =
  144|  1.50M|                            CLIP_S16(( 55 * c[2] - 29 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.50M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.50M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.54k, False: 1.50M]
  |  |  |  |  |  Branch (40:53): [True: 385, False: 1.50M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  1.50M|            pi2_tmp[2] =
  146|  1.50M|                            CLIP_S16(( 74 * (pi2_src[0] - pi2_src[2 * src_strd ] + pi2_src[3 * src_strd ]) + add ) >> shift );
  ------------------
  |  |   53|  1.50M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.50M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 714, False: 1.50M]
  |  |  |  |  |  Branch (40:53): [True: 715, False: 1.50M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|  1.50M|            pi2_tmp[3] =
  148|  1.50M|                            CLIP_S16(( 55 * c[0] + 29 * c[2] - c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.50M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.50M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 873, False: 1.50M]
  |  |  |  |  |  Branch (40:53): [True: 968, False: 1.50M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|  1.50M|        }
  150|  2.28M|        pi2_src++;
  151|  2.28M|        pi2_tmp += trans_size;
  152|  2.28M|        zero_cols = zero_cols >> 1;
  153|  2.28M|    }
  154|       |
  155|   572k|    pi2_tmp = pi2_tmp_orig;
  156|       |
  157|       |    /* Inverse Transform 2nd stage */
  158|   572k|    shift = 20 - u1_bit_depth;
  159|   572k|    add = 1 << (shift - 1);
  160|   572k|    clip_limit = (1 << u1_bit_depth) - 1;
  161|       |
  162|  2.86M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (162:16): [True: 2.28M, False: 572k]
  ------------------
  163|  2.28M|    {
  164|  2.28M|        WORD32 itrans_out;
  165|       |        // Intermediate Variables
  166|  2.28M|        c[0] = pi2_tmp[0] + pi2_tmp[2 * trans_size];
  167|  2.28M|        c[1] = pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size];
  168|  2.28M|        c[2] = pi2_tmp[0] - pi2_tmp[3 * trans_size];
  169|  2.28M|        c[3] = 74 * pi2_tmp[trans_size];
  170|       |
  171|  2.28M|        itrans_out =
  172|  2.28M|                        CLIP_S16(( 29 * c[0] + 55 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  2.28M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.28M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  2.28M|        pu2_dst[0] = CLIP3( (itrans_out + pu2_pred[0] ), 0, clip_limit );
  ------------------
  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 303k, False: 1.98M]
  |  |  |  Branch (40:53): [True: 63.5k, False: 1.92M]
  |  |  ------------------
  ------------------
  174|  2.28M|        itrans_out =
  175|  2.28M|                        CLIP_S16(( 55 * c[2] - 29 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  2.28M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.28M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|  2.28M|        pu2_dst[1] = CLIP3( (itrans_out + pu2_pred[1] ), 0, clip_limit );
  ------------------
  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 240k, False: 2.04M]
  |  |  |  Branch (40:53): [True: 122k, False: 1.92M]
  |  |  ------------------
  ------------------
  177|  2.28M|        itrans_out =
  178|  2.28M|                        CLIP_S16(( 74 * (pi2_tmp[0] - pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size]) + add ) >> shift );
  ------------------
  |  |   53|  2.28M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.28M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|  2.28M|        pu2_dst[2] = CLIP3( (itrans_out+ pu2_pred[2] ), 0, clip_limit );
  ------------------
  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 279k, False: 2.00M]
  |  |  |  Branch (40:53): [True: 140k, False: 1.86M]
  |  |  ------------------
  ------------------
  180|  2.28M|        itrans_out =
  181|  2.28M|                        CLIP_S16(( 55 * c[0] + 29 * c[2] - c[3] + add ) >> shift );
  ------------------
  |  |   53|  2.28M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.28M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  2.28M|        pu2_dst[3] = CLIP3( (itrans_out+ pu2_pred[3] ), 0, clip_limit );
  ------------------
  |  |   40|  2.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 309k, False: 1.97M]
  |  |  |  Branch (40:53): [True: 163k, False: 1.81M]
  |  |  ------------------
  ------------------
  183|  2.28M|        pi2_tmp++;
  184|  2.28M|        pu2_pred += pred_strd;
  185|  2.28M|        pu2_dst += dst_strd;
  186|  2.28M|    }
  187|   572k|}
ihevc_hbd_itrans_recon_4x4:
  247|  7.82k|{
  248|  7.82k|    WORD32 j;
  249|  7.82k|    WORD32 e[2], o[2];
  250|  7.82k|    WORD32 add;
  251|  7.82k|    WORD32 shift;
  252|  7.82k|    WORD16 *pi2_tmp_orig;
  253|  7.82k|    WORD32 trans_size;
  254|  7.82k|    WORD16 clip_limit;
  255|       |
  256|  7.82k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  7.82k|#define TRANS_SIZE_4   4
  ------------------
  257|       |
  258|  7.82k|    pi2_tmp_orig = pi2_tmp;
  259|       |
  260|       |    /* Inverse Transform 1st stage */
  261|  7.82k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  7.82k|#define IT_SHIFT_STAGE_1 7
  ------------------
  262|  7.82k|    add = 1 << (shift - 1);
  263|       |
  264|  39.1k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (264:16): [True: 31.2k, False: 7.82k]
  ------------------
  265|  31.2k|    {
  266|       |        /* Checking for Zero Cols */
  267|  31.2k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (267:12): [True: 8.39k, False: 22.9k]
  ------------------
  268|  8.39k|        {
  269|  8.39k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  270|  8.39k|        }
  271|  22.9k|        else
  272|  22.9k|        {
  273|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  274|  22.9k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  275|  22.9k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  276|  22.9k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  277|  22.9k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  278|  22.9k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  279|  22.9k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  280|  22.9k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  281|  22.9k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  282|       |
  283|  22.9k|            pi2_tmp[0] =
  284|  22.9k|                            CLIP_S16( ((e[0] + o[0] + add)>>shift) );
  ------------------
  |  |   53|  22.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  22.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 516, False: 22.3k]
  |  |  |  |  |  Branch (40:53): [True: 510, False: 21.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|  22.9k|            pi2_tmp[1] =
  286|  22.9k|                            CLIP_S16( ((e[1] + o[1] + add)>>shift) );
  ------------------
  |  |   53|  22.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  22.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 378, False: 22.5k]
  |  |  |  |  |  Branch (40:53): [True: 383, False: 22.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|  22.9k|            pi2_tmp[2] =
  288|  22.9k|                            CLIP_S16( ((e[1] - o[1] + add)>>shift) );
  ------------------
  |  |   53|  22.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  22.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 301, False: 22.6k]
  |  |  |  |  |  Branch (40:53): [True: 522, False: 22.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|  22.9k|            pi2_tmp[3] =
  290|  22.9k|                            CLIP_S16( ((e[0] - o[0] + add)>>shift) );
  ------------------
  |  |   53|  22.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  22.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 371, False: 22.5k]
  |  |  |  |  |  Branch (40:53): [True: 643, False: 21.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|  22.9k|        }
  292|  31.2k|        pi2_src++;
  293|  31.2k|        pi2_tmp += trans_size;
  294|  31.2k|        zero_cols = zero_cols >> 1;
  295|  31.2k|    }
  296|       |
  297|  7.82k|    pi2_tmp = pi2_tmp_orig;
  298|       |
  299|       |    /* Inverse Transform 2nd stage */
  300|  7.82k|    shift = 20 - u1_bit_depth;
  301|  7.82k|    add = 1 << (shift - 1);
  302|  7.82k|    clip_limit = (1 << u1_bit_depth) - 1;
  303|       |
  304|  39.1k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (304:16): [True: 31.3k, False: 7.82k]
  ------------------
  305|  31.3k|    {
  306|  31.3k|        WORD32 itrans_out;
  307|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  308|  31.3k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  309|  31.3k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  310|  31.3k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  311|  31.3k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  312|  31.3k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  313|  31.3k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  314|  31.3k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  315|  31.3k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  316|       |
  317|  31.3k|        itrans_out =
  318|  31.3k|                        CLIP_S16( ((e[0] + o[0] + add)>>shift ) );
  ------------------
  |  |   53|  31.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 31.3k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|  31.3k|        pu2_dst[0] = CLIP3( (itrans_out + pu2_pred[0] ), 0, clip_limit);
  ------------------
  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.57k, False: 24.7k]
  |  |  |  Branch (40:53): [True: 8.12k, False: 16.6k]
  |  |  ------------------
  ------------------
  320|  31.3k|        itrans_out =
  321|  31.3k|                        CLIP_S16( ((e[1] + o[1] + add)>>shift ) );
  ------------------
  |  |   53|  31.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 31.3k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|  31.3k|        pu2_dst[1] = CLIP3( (itrans_out + pu2_pred[1] ), 0, clip_limit );
  ------------------
  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.81k, False: 25.5k]
  |  |  |  Branch (40:53): [True: 12.5k, False: 12.9k]
  |  |  ------------------
  ------------------
  323|  31.3k|        itrans_out =
  324|  31.3k|                        CLIP_S16( ((e[1] - o[1] + add)>>shift ) );
  ------------------
  |  |   53|  31.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 31.3k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  325|  31.3k|        pu2_dst[2] = CLIP3( (itrans_out + pu2_pred[2] ), 0, clip_limit );
  ------------------
  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.81k, False: 27.5k]
  |  |  |  Branch (40:53): [True: 12.1k, False: 15.3k]
  |  |  ------------------
  ------------------
  326|  31.3k|        itrans_out =
  327|  31.3k|                        CLIP_S16( ((e[0] - o[0] + add)>>shift ));
  ------------------
  |  |   53|  31.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 31.3k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  328|  31.3k|        pu2_dst[3] = CLIP3( (itrans_out + pu2_pred[3] ), 0, clip_limit );
  ------------------
  |  |   40|  31.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.03k, False: 27.3k]
  |  |  |  Branch (40:53): [True: 10.6k, False: 16.6k]
  |  |  ------------------
  ------------------
  329|       |
  330|  31.3k|        pi2_tmp++;
  331|  31.3k|        pu2_pred += pred_strd;
  332|  31.3k|        pu2_dst += dst_strd;
  333|  31.3k|    }
  334|  7.82k|}

ihevc_hbd_itrans_recon_16x16:
  106|   170k|{
  107|   170k|    WORD32 j, k;
  108|   170k|    WORD32 e[8], o[8];
  109|   170k|    WORD32 ee[4], eo[4];
  110|   170k|    WORD32 eee[2], eeo[2];
  111|   170k|    WORD32 add;
  112|   170k|    WORD32 shift;
  113|   170k|    WORD16 *pi2_tmp_orig;
  114|   170k|    WORD32 trans_size;
  115|   170k|    WORD32 zero_rows_2nd_stage = zero_cols;
  116|   170k|    WORD32 row_limit_2nd_stage;
  117|   170k|    WORD16 clip_limit;
  118|       |
  119|   170k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (119:8): [True: 85.2k, False: 85.4k]
  ------------------
  120|  85.2k|        row_limit_2nd_stage = 4;
  121|  85.4k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (121:13): [True: 26.7k, False: 58.7k]
  ------------------
  122|  26.7k|        row_limit_2nd_stage = 8;
  123|  58.7k|    else
  124|  58.7k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  58.7k|#define TRANS_SIZE_16 16
  ------------------
  125|       |
  126|   170k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   170k|#define TRANS_SIZE_16 16
  ------------------
  127|   170k|    pi2_tmp_orig = pi2_tmp;
  128|   170k|    clip_limit = (1 << u1_bit_depth) - 1;
  129|       |
  130|   170k|    if((zero_rows & 0xFFF0) == 0xFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (130:8): [True: 101k, False: 69.6k]
  ------------------
  131|   101k|    {
  132|       |        /* Inverse Transform 1st stage */
  133|       |        /************************************************************************************************/
  134|       |        /**********************************START - IT_RECON_16x16****************************************/
  135|       |        /************************************************************************************************/
  136|       |
  137|   101k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   101k|#define IT_SHIFT_STAGE_1 7
  ------------------
  138|   101k|        add = 1 << (shift - 1);
  139|       |
  140|   852k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (140:20): [True: 750k, False: 101k]
  ------------------
  141|   750k|        {
  142|       |            /* Checking for Zero Cols */
  143|   750k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (143:16): [True: 437k, False: 313k]
  ------------------
  144|   437k|            {
  145|   437k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  146|   437k|            }
  147|   313k|            else
  148|   313k|            {
  149|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  150|  2.86M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (150:28): [True: 2.54M, False: 313k]
  ------------------
  151|  2.54M|                {
  152|  2.54M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  153|  2.54M|                                    + g_ai2_ihevc_trans_16[3][k]
  154|  2.54M|                                                    * pi2_src[3 * src_strd];
  155|  2.54M|                }
  156|  1.58M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (156:28): [True: 1.27M, False: 313k]
  ------------------
  157|  1.27M|                {
  158|  1.27M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  159|  1.27M|                }
  160|   313k|                eeo[0] = 0;
  161|   313k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  162|   313k|                eeo[1] = 0;
  163|   313k|                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|   950k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (166:28): [True: 636k, False: 313k]
  ------------------
  167|   636k|                {
  168|   636k|                    ee[k] = eee[k] + eeo[k];
  169|   636k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  170|   636k|                }
  171|  1.58M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (171:28): [True: 1.27M, False: 313k]
  ------------------
  172|  1.27M|                {
  173|  1.27M|                    e[k] = ee[k] + eo[k];
  174|  1.27M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  175|  1.27M|                }
  176|  2.86M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (176:28): [True: 2.54M, False: 313k]
  ------------------
  177|  2.54M|                {
  178|  2.54M|                    pi2_tmp[k] =
  179|  2.54M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  2.54M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.54M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 233, False: 2.54M]
  |  |  |  |  |  Branch (40:53): [True: 287, False: 2.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  2.54M|                    pi2_tmp[k + 8] =
  181|  2.54M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|  2.54M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.54M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 138, False: 2.54M]
  |  |  |  |  |  Branch (40:53): [True: 271, False: 2.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  2.54M|                }
  183|   313k|            }
  184|   750k|            pi2_src++;
  185|   750k|            pi2_tmp += trans_size;
  186|   750k|            zero_cols = zero_cols >> 1;
  187|   750k|        }
  188|       |
  189|   101k|        pi2_tmp = pi2_tmp_orig;
  190|       |
  191|       |        /* Inverse Transform 2nd stage */
  192|   101k|        shift = 20 - u1_bit_depth;
  193|   101k|        add = 1 << (shift - 1);
  194|       |
  195|   101k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (195:12): [True: 60.8k, False: 40.1k]
  ------------------
  196|  60.8k|        {
  197|  1.02M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (197:24): [True: 962k, False: 60.8k]
  ------------------
  198|   962k|            {
  199|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  200|  8.64M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (200:28): [True: 7.68M, False: 962k]
  ------------------
  201|  7.68M|                {
  202|  7.68M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  203|  7.68M|                                    + g_ai2_ihevc_trans_16[3][k]
  204|  7.68M|                                                    * pi2_tmp[3 * trans_size];
  205|  7.68M|                }
  206|  4.81M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (206:28): [True: 3.84M, False: 962k]
  ------------------
  207|  3.84M|                {
  208|  3.84M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  209|  3.84M|                }
  210|   962k|                eeo[0] = 0;
  211|   962k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  212|   962k|                eeo[1] = 0;
  213|   962k|                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.88M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (216:28): [True: 1.92M, False: 962k]
  ------------------
  217|  1.92M|                {
  218|  1.92M|                    ee[k] = eee[k] + eeo[k];
  219|  1.92M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  220|  1.92M|                }
  221|  4.81M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (221:28): [True: 3.84M, False: 962k]
  ------------------
  222|  3.84M|                {
  223|  3.84M|                    e[k] = ee[k] + eo[k];
  224|  3.84M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  225|  3.84M|                }
  226|  8.61M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (226:28): [True: 7.65M, False: 962k]
  ------------------
  227|  7.65M|                {
  228|  7.65M|                    WORD32 itrans_out;
  229|  7.65M|                    itrans_out =
  230|  7.65M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  7.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.65M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|  7.65M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  7.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 255k, False: 7.40M]
  |  |  |  Branch (40:53): [True: 81.5k, False: 7.31M]
  |  |  ------------------
  ------------------
  232|  7.65M|                    itrans_out =
  233|  7.65M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  7.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.65M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  7.65M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  7.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 265k, False: 7.38M]
  |  |  |  Branch (40:53): [True: 78.3k, False: 7.31M]
  |  |  ------------------
  ------------------
  235|  7.65M|                }
  236|   962k|                pi2_tmp++;
  237|   962k|                pu2_pred += pred_strd;
  238|   962k|                pu2_dst += dst_strd;
  239|   962k|            }
  240|  60.8k|        }
  241|  40.1k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (241:17): [True: 15.9k, False: 24.2k]
  ------------------
  242|  15.9k|        {
  243|   265k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (243:24): [True: 249k, False: 15.9k]
  ------------------
  244|   249k|            {
  245|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  246|  2.23M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (246:28): [True: 1.99M, False: 249k]
  ------------------
  247|  1.99M|                {
  248|  1.99M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  249|  1.99M|                                    + g_ai2_ihevc_trans_16[3][k]
  250|  1.99M|                                                    * pi2_tmp[3 * trans_size]
  251|  1.99M|                                    + g_ai2_ihevc_trans_16[5][k]
  252|  1.99M|                                                    * pi2_tmp[5 * trans_size]
  253|  1.99M|                                    + g_ai2_ihevc_trans_16[7][k]
  254|  1.99M|                                                    * pi2_tmp[7 * trans_size];
  255|  1.99M|                }
  256|  1.24M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (256:28): [True: 997k, False: 249k]
  ------------------
  257|   997k|                {
  258|   997k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  259|   997k|                                    + g_ai2_ihevc_trans_16[6][k]
  260|   997k|                                                    * pi2_tmp[6 * trans_size];
  261|   997k|                }
  262|   249k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  263|   249k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  264|   249k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  265|   249k|                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|   748k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (268:28): [True: 499k, False: 249k]
  ------------------
  269|   499k|                {
  270|   499k|                    ee[k] = eee[k] + eeo[k];
  271|   499k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  272|   499k|                }
  273|  1.24M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (273:28): [True: 998k, False: 249k]
  ------------------
  274|   998k|                {
  275|   998k|                    e[k] = ee[k] + eo[k];
  276|   998k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  277|   998k|                }
  278|  2.23M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (278:28): [True: 1.98M, False: 249k]
  ------------------
  279|  1.98M|                {
  280|  1.98M|                    WORD32 itrans_out;
  281|  1.98M|                    itrans_out =
  282|  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  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: 257k, False: 1.72M]
  |  |  |  Branch (40:53): [True: 36.8k, False: 1.68M]
  |  |  ------------------
  ------------------
  284|  1.98M|                    itrans_out =
  285|  1.98M|                                    CLIP_S16( ((e[7-k] - o[7-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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|  1.98M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  1.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 378k, False: 1.60M]
  |  |  |  Branch (40:53): [True: 29.6k, False: 1.57M]
  |  |  ------------------
  ------------------
  287|  1.98M|                }
  288|   249k|                pi2_tmp++;
  289|   249k|                pu2_pred += pred_strd;
  290|   249k|                pu2_dst += dst_strd;
  291|   249k|            }
  292|  15.9k|        }
  293|  24.2k|        else /* All rows of output of 1st stage are non-zero */
  294|  24.2k|        {
  295|   386k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (295:24): [True: 361k, False: 24.2k]
  ------------------
  296|   361k|            {
  297|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  298|  3.24M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (298:28): [True: 2.88M, False: 361k]
  ------------------
  299|  2.88M|                {
  300|  2.88M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  301|  2.88M|                                    + g_ai2_ihevc_trans_16[3][k]
  302|  2.88M|                                                    * pi2_tmp[3 * trans_size]
  303|  2.88M|                                    + g_ai2_ihevc_trans_16[5][k]
  304|  2.88M|                                                    * pi2_tmp[5 * trans_size]
  305|  2.88M|                                    + g_ai2_ihevc_trans_16[7][k]
  306|  2.88M|                                                    * pi2_tmp[7 * trans_size]
  307|  2.88M|                                    + g_ai2_ihevc_trans_16[9][k]
  308|  2.88M|                                                    * pi2_tmp[9 * trans_size]
  309|  2.88M|                                    + g_ai2_ihevc_trans_16[11][k]
  310|  2.88M|                                                    * pi2_tmp[11 * trans_size]
  311|  2.88M|                                    + g_ai2_ihevc_trans_16[13][k]
  312|  2.88M|                                                    * pi2_tmp[13 * trans_size]
  313|  2.88M|                                    + g_ai2_ihevc_trans_16[15][k]
  314|  2.88M|                                                    * pi2_tmp[15 * trans_size];
  315|  2.88M|                }
  316|  1.81M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (316:28): [True: 1.45M, False: 361k]
  ------------------
  317|  1.45M|                {
  318|  1.45M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  319|  1.45M|                                    + g_ai2_ihevc_trans_16[6][k]
  320|  1.45M|                                                    * pi2_tmp[6 * trans_size]
  321|  1.45M|                                    + g_ai2_ihevc_trans_16[10][k]
  322|  1.45M|                                                    * pi2_tmp[10 * trans_size]
  323|  1.45M|                                    + g_ai2_ihevc_trans_16[14][k]
  324|  1.45M|                                                    * pi2_tmp[14 * trans_size];
  325|  1.45M|                }
  326|   361k|                eeo[0] =
  327|   361k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  328|   361k|                                                + g_ai2_ihevc_trans_16[12][0]
  329|   361k|                                                                * pi2_tmp[12
  330|   361k|                                                                                * trans_size];
  331|   361k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  332|   361k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  333|   361k|                eeo[1] =
  334|   361k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  335|   361k|                                                + g_ai2_ihevc_trans_16[12][1]
  336|   361k|                                                                * pi2_tmp[12
  337|   361k|                                                                                * trans_size];
  338|   361k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  339|   361k|                                + 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|  1.08M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (342:28): [True: 727k, False: 361k]
  ------------------
  343|   727k|                {
  344|   727k|                    ee[k] = eee[k] + eeo[k];
  345|   727k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  346|   727k|                }
  347|  1.81M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (347:28): [True: 1.45M, False: 361k]
  ------------------
  348|  1.45M|                {
  349|  1.45M|                    e[k] = ee[k] + eo[k];
  350|  1.45M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  351|  1.45M|                }
  352|  3.20M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (352:28): [True: 2.84M, False: 361k]
  ------------------
  353|  2.84M|                {
  354|  2.84M|                    WORD32 itrans_out;
  355|  2.84M|                    itrans_out =
  356|  2.84M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  2.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|  2.84M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  2.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 346k, False: 2.50M]
  |  |  |  Branch (40:53): [True: 94.8k, False: 2.40M]
  |  |  ------------------
  ------------------
  358|  2.84M|                    itrans_out =
  359|  2.84M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  2.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|  2.84M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  2.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 606k, False: 2.24M]
  |  |  |  Branch (40:53): [True: 51.1k, False: 2.18M]
  |  |  ------------------
  ------------------
  361|  2.84M|                }
  362|   361k|                pi2_tmp++;
  363|   361k|                pu2_pred += pred_strd;
  364|   361k|                pu2_dst += dst_strd;
  365|   361k|            }
  366|  24.2k|        }
  367|       |        /************************************************************************************************/
  368|       |        /************************************END - IT_RECON_16x16****************************************/
  369|       |        /************************************************************************************************/
  370|   101k|    }
  371|  69.6k|    else if((zero_rows & 0xFF00) == 0xFF00)  /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (371:13): [True: 31.6k, False: 38.0k]
  ------------------
  372|  31.6k|    {
  373|       |        /* Inverse Transform 1st stage */
  374|       |        /************************************************************************************************/
  375|       |        /**********************************START - IT_RECON_16x16****************************************/
  376|       |        /************************************************************************************************/
  377|       |
  378|  31.6k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  31.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  379|  31.6k|        add = 1 << (shift - 1);
  380|       |
  381|   303k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (381:20): [True: 271k, False: 31.6k]
  ------------------
  382|   271k|        {
  383|       |            /* Checking for Zero Cols */
  384|   271k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (384:16): [True: 90.1k, False: 181k]
  ------------------
  385|  90.1k|            {
  386|  90.1k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  387|  90.1k|            }
  388|   181k|            else
  389|   181k|            {
  390|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  391|  1.64M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (391:28): [True: 1.46M, False: 181k]
  ------------------
  392|  1.46M|                {
  393|  1.46M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  394|  1.46M|                                    + g_ai2_ihevc_trans_16[3][k]
  395|  1.46M|                                                    * pi2_src[3 * src_strd]
  396|  1.46M|                                    + g_ai2_ihevc_trans_16[5][k]
  397|  1.46M|                                                    * pi2_src[5 * src_strd]
  398|  1.46M|                                    + g_ai2_ihevc_trans_16[7][k]
  399|  1.46M|                                                    * pi2_src[7 * src_strd];
  400|  1.46M|                }
  401|   913k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (401:28): [True: 732k, False: 181k]
  ------------------
  402|   732k|                {
  403|   732k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  404|   732k|                                    + g_ai2_ihevc_trans_16[6][k]
  405|   732k|                                                    * pi2_src[6 * src_strd];
  406|   732k|                }
  407|   181k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  408|   181k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  409|   181k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  410|   181k|                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|   547k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (413:28): [True: 366k, False: 181k]
  ------------------
  414|   366k|                {
  415|   366k|                    ee[k] = eee[k] + eeo[k];
  416|   366k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  417|   366k|                }
  418|   913k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (418:28): [True: 731k, False: 181k]
  ------------------
  419|   731k|                {
  420|   731k|                    e[k] = ee[k] + eo[k];
  421|   731k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  422|   731k|                }
  423|  1.64M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (423:28): [True: 1.46M, False: 181k]
  ------------------
  424|  1.46M|                {
  425|  1.46M|                    pi2_tmp[k] =
  426|  1.46M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  1.46M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.46M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.11k, False: 1.46M]
  |  |  |  |  |  Branch (40:53): [True: 1.25k, False: 1.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|  1.46M|                    pi2_tmp[k + 8] =
  428|  1.46M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|  1.46M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.46M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.11k, False: 1.46M]
  |  |  |  |  |  Branch (40:53): [True: 956, False: 1.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|  1.46M|                }
  430|   181k|            }
  431|   271k|            pi2_src++;
  432|   271k|            pi2_tmp += trans_size;
  433|   271k|            zero_cols = zero_cols >> 1;
  434|   271k|        }
  435|       |
  436|  31.6k|        pi2_tmp = pi2_tmp_orig;
  437|       |
  438|       |        /* Inverse Transform 2nd stage */
  439|  31.6k|        shift = 20 - u1_bit_depth;
  440|  31.6k|        add = 1 << (shift - 1);
  441|       |
  442|  31.6k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (442:12): [True: 15.6k, False: 16.0k]
  ------------------
  443|  15.6k|        {
  444|   254k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (444:24): [True: 238k, False: 15.6k]
  ------------------
  445|   238k|            {
  446|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  447|  2.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (447:28): [True: 1.90M, False: 238k]
  ------------------
  448|  1.90M|                {
  449|  1.90M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  450|  1.90M|                                    + g_ai2_ihevc_trans_16[3][k]
  451|  1.90M|                                                    * pi2_tmp[3 * trans_size];
  452|  1.90M|                }
  453|  1.19M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (453:28): [True: 954k, False: 238k]
  ------------------
  454|   954k|                {
  455|   954k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  456|   954k|                }
  457|   238k|                eeo[0] = 0;
  458|   238k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  459|   238k|                eeo[1] = 0;
  460|   238k|                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|   718k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (463:28): [True: 480k, False: 238k]
  ------------------
  464|   480k|                {
  465|   480k|                    ee[k] = eee[k] + eeo[k];
  466|   480k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  467|   480k|                }
  468|  1.20M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (468:28): [True: 963k, False: 238k]
  ------------------
  469|   963k|                {
  470|   963k|                    e[k] = ee[k] + eo[k];
  471|   963k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  472|   963k|                }
  473|  2.11M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (473:28): [True: 1.88M, False: 238k]
  ------------------
  474|  1.88M|                {
  475|  1.88M|                    WORD32 itrans_out;
  476|  1.88M|                    itrans_out =
  477|  1.88M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.88M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.88M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.88M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  1.88M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.88M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 329k, False: 1.55M]
  |  |  |  Branch (40:53): [True: 48.3k, False: 1.50M]
  |  |  ------------------
  ------------------
  479|  1.88M|                    itrans_out =
  480|  1.88M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.88M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.88M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.88M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|  1.88M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  1.88M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 322k, False: 1.55M]
  |  |  |  Branch (40:53): [True: 47.5k, False: 1.51M]
  |  |  ------------------
  ------------------
  482|  1.88M|                }
  483|   238k|                pi2_tmp++;
  484|   238k|                pu2_pred += pred_strd;
  485|   238k|                pu2_dst += dst_strd;
  486|   238k|            }
  487|  15.6k|        }
  488|  16.0k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (488:17): [True: 5.53k, False: 10.4k]
  ------------------
  489|  5.53k|        {
  490|  93.9k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (490:24): [True: 88.4k, False: 5.53k]
  ------------------
  491|  88.4k|            {
  492|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  493|   795k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (493:28): [True: 707k, False: 88.4k]
  ------------------
  494|   707k|                {
  495|   707k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  496|   707k|                                    + g_ai2_ihevc_trans_16[3][k]
  497|   707k|                                                    * pi2_tmp[3 * trans_size]
  498|   707k|                                    + g_ai2_ihevc_trans_16[5][k]
  499|   707k|                                                    * pi2_tmp[5 * trans_size]
  500|   707k|                                    + g_ai2_ihevc_trans_16[7][k]
  501|   707k|                                                    * pi2_tmp[7 * trans_size];
  502|   707k|                }
  503|   442k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (503:28): [True: 353k, False: 88.4k]
  ------------------
  504|   353k|                {
  505|   353k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  506|   353k|                                    + g_ai2_ihevc_trans_16[6][k]
  507|   353k|                                                    * pi2_tmp[6 * trans_size];
  508|   353k|                }
  509|  88.4k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  510|  88.4k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  511|  88.4k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  512|  88.4k|                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|   265k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (515:28): [True: 176k, False: 88.4k]
  ------------------
  516|   176k|                {
  517|   176k|                    ee[k] = eee[k] + eeo[k];
  518|   176k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  519|   176k|                }
  520|   442k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (520:28): [True: 353k, False: 88.4k]
  ------------------
  521|   353k|                {
  522|   353k|                    e[k] = ee[k] + eo[k];
  523|   353k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  524|   353k|                }
  525|   795k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (525:28): [True: 706k, False: 88.4k]
  ------------------
  526|   706k|                {
  527|   706k|                    WORD32 itrans_out;
  528|   706k|                    itrans_out =
  529|   706k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   706k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   706k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 706k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 706k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  530|   706k|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   706k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 157k, False: 549k]
  |  |  |  Branch (40:53): [True: 28.6k, False: 520k]
  |  |  ------------------
  ------------------
  531|   706k|                    itrans_out =
  532|   706k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   706k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   706k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 706k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 706k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  533|   706k|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|   706k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 116k, False: 590k]
  |  |  |  Branch (40:53): [True: 46.7k, False: 543k]
  |  |  ------------------
  ------------------
  534|   706k|                }
  535|  88.4k|                pi2_tmp++;
  536|  88.4k|                pu2_pred += pred_strd;
  537|  88.4k|                pu2_dst += dst_strd;
  538|  88.4k|            }
  539|  5.53k|        }
  540|  10.4k|        else /* All rows of output of 1st stage are non-zero */
  541|  10.4k|        {
  542|   170k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (542:24): [True: 159k, False: 10.4k]
  ------------------
  543|   159k|            {
  544|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  545|  1.43M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (545:28): [True: 1.27M, False: 159k]
  ------------------
  546|  1.27M|                {
  547|  1.27M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  548|  1.27M|                                    + g_ai2_ihevc_trans_16[3][k]
  549|  1.27M|                                                    * pi2_tmp[3 * trans_size]
  550|  1.27M|                                    + g_ai2_ihevc_trans_16[5][k]
  551|  1.27M|                                                    * pi2_tmp[5 * trans_size]
  552|  1.27M|                                    + g_ai2_ihevc_trans_16[7][k]
  553|  1.27M|                                                    * pi2_tmp[7 * trans_size]
  554|  1.27M|                                    + g_ai2_ihevc_trans_16[9][k]
  555|  1.27M|                                                    * pi2_tmp[9 * trans_size]
  556|  1.27M|                                    + g_ai2_ihevc_trans_16[11][k]
  557|  1.27M|                                                    * pi2_tmp[11 * trans_size]
  558|  1.27M|                                    + g_ai2_ihevc_trans_16[13][k]
  559|  1.27M|                                                    * pi2_tmp[13 * trans_size]
  560|  1.27M|                                    + g_ai2_ihevc_trans_16[15][k]
  561|  1.27M|                                                    * pi2_tmp[15 * trans_size];
  562|  1.27M|                }
  563|   798k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (563:28): [True: 638k, False: 159k]
  ------------------
  564|   638k|                {
  565|   638k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  566|   638k|                                    + g_ai2_ihevc_trans_16[6][k]
  567|   638k|                                                    * pi2_tmp[6 * trans_size]
  568|   638k|                                    + g_ai2_ihevc_trans_16[10][k]
  569|   638k|                                                    * pi2_tmp[10 * trans_size]
  570|   638k|                                    + g_ai2_ihevc_trans_16[14][k]
  571|   638k|                                                    * pi2_tmp[14 * trans_size];
  572|   638k|                }
  573|   159k|                eeo[0] =
  574|   159k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  575|   159k|                                                + g_ai2_ihevc_trans_16[12][0]
  576|   159k|                                                                * pi2_tmp[12
  577|   159k|                                                                                * trans_size];
  578|   159k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  579|   159k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  580|   159k|                eeo[1] =
  581|   159k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  582|   159k|                                                + g_ai2_ihevc_trans_16[12][1]
  583|   159k|                                                                * pi2_tmp[12
  584|   159k|                                                                                * trans_size];
  585|   159k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  586|   159k|                                + 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|   480k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (589:28): [True: 320k, False: 159k]
  ------------------
  590|   320k|                {
  591|   320k|                    ee[k] = eee[k] + eeo[k];
  592|   320k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  593|   320k|                }
  594|   801k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (594:28): [True: 641k, False: 159k]
  ------------------
  595|   641k|                {
  596|   641k|                    e[k] = ee[k] + eo[k];
  597|   641k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  598|   641k|                }
  599|  1.41M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (599:28): [True: 1.25M, False: 159k]
  ------------------
  600|  1.25M|                {
  601|  1.25M|                    WORD32 itrans_out;
  602|  1.25M|                    itrans_out =
  603|  1.25M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.25M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.25M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|  1.25M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 278k, False: 979k]
  |  |  |  Branch (40:53): [True: 219k, False: 760k]
  |  |  ------------------
  ------------------
  605|  1.25M|                    itrans_out =
  606|  1.25M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.25M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.25M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.25M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  1.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 267k, False: 991k]
  |  |  |  Branch (40:53): [True: 196k, False: 794k]
  |  |  ------------------
  ------------------
  608|  1.25M|                }
  609|   159k|                pi2_tmp++;
  610|   159k|                pu2_pred += pred_strd;
  611|   159k|                pu2_dst += dst_strd;
  612|   159k|            }
  613|  10.4k|        }
  614|       |        /************************************************************************************************/
  615|       |        /************************************END - IT_RECON_16x16****************************************/
  616|       |        /************************************************************************************************/
  617|  31.6k|    }
  618|  38.0k|    else  /* All rows of input are non-zero */
  619|  38.0k|    {
  620|       |        /* Inverse Transform 1st stage */
  621|       |        /************************************************************************************************/
  622|       |        /**********************************START - IT_RECON_16x16****************************************/
  623|       |        /************************************************************************************************/
  624|       |
  625|  38.0k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  38.0k|#define IT_SHIFT_STAGE_1 7
  ------------------
  626|  38.0k|        add = 1 << (shift - 1);
  627|       |
  628|   500k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (628:20): [True: 462k, False: 38.0k]
  ------------------
  629|   462k|        {
  630|       |            /* Checking for Zero Cols */
  631|   462k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (631:16): [True: 173k, False: 288k]
  ------------------
  632|   173k|            {
  633|   173k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  634|   173k|            }
  635|   288k|            else
  636|   288k|            {
  637|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  638|  2.60M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (638:28): [True: 2.31M, False: 288k]
  ------------------
  639|  2.31M|                {
  640|  2.31M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  641|  2.31M|                                    + g_ai2_ihevc_trans_16[3][k]
  642|  2.31M|                                                    * pi2_src[3 * src_strd]
  643|  2.31M|                                    + g_ai2_ihevc_trans_16[5][k]
  644|  2.31M|                                                    * pi2_src[5 * src_strd]
  645|  2.31M|                                    + g_ai2_ihevc_trans_16[7][k]
  646|  2.31M|                                                    * pi2_src[7 * src_strd]
  647|  2.31M|                                    + g_ai2_ihevc_trans_16[9][k]
  648|  2.31M|                                                    * pi2_src[9 * src_strd]
  649|  2.31M|                                    + g_ai2_ihevc_trans_16[11][k]
  650|  2.31M|                                                    * pi2_src[11 * src_strd]
  651|  2.31M|                                    + g_ai2_ihevc_trans_16[13][k]
  652|  2.31M|                                                    * pi2_src[13 * src_strd]
  653|  2.31M|                                    + g_ai2_ihevc_trans_16[15][k]
  654|  2.31M|                                                    * pi2_src[15 * src_strd];
  655|  2.31M|                }
  656|  1.44M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (656:28): [True: 1.15M, False: 288k]
  ------------------
  657|  1.15M|                {
  658|  1.15M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  659|  1.15M|                                    + g_ai2_ihevc_trans_16[6][k]
  660|  1.15M|                                                    * pi2_src[6 * src_strd]
  661|  1.15M|                                    + g_ai2_ihevc_trans_16[10][k]
  662|  1.15M|                                                    * pi2_src[10 * src_strd]
  663|  1.15M|                                    + g_ai2_ihevc_trans_16[14][k]
  664|  1.15M|                                                    * pi2_src[14 * src_strd];
  665|  1.15M|                }
  666|   288k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  667|   288k|                                + g_ai2_ihevc_trans_16[12][0]
  668|   288k|                                                * pi2_src[12 * src_strd];
  669|   288k|                eee[0] =
  670|   288k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  671|   288k|                                                + g_ai2_ihevc_trans_16[8][0]
  672|   288k|                                                                * pi2_src[8
  673|   288k|                                                                                * src_strd];
  674|   288k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  675|   288k|                                + g_ai2_ihevc_trans_16[12][1]
  676|   288k|                                                * pi2_src[12 * src_strd];
  677|   288k|                eee[1] =
  678|   288k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  679|   288k|                                                + g_ai2_ihevc_trans_16[8][1]
  680|   288k|                                                                * pi2_src[8
  681|   288k|                                                                                * src_strd];
  682|       |
  683|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  684|   867k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (684:28): [True: 578k, False: 288k]
  ------------------
  685|   578k|                {
  686|   578k|                    ee[k] = eee[k] + eeo[k];
  687|   578k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  688|   578k|                }
  689|  1.44M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (689:28): [True: 1.15M, False: 288k]
  ------------------
  690|  1.15M|                {
  691|  1.15M|                    e[k] = ee[k] + eo[k];
  692|  1.15M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  693|  1.15M|                }
  694|  2.60M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (694:28): [True: 2.31M, False: 288k]
  ------------------
  695|  2.31M|                {
  696|  2.31M|                    pi2_tmp[k] =
  697|  2.31M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  2.31M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.31M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.46k, False: 2.31M]
  |  |  |  |  |  Branch (40:53): [True: 847, False: 2.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  2.31M|                    pi2_tmp[k + 8] =
  699|  2.31M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|  2.31M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.31M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 587, False: 2.31M]
  |  |  |  |  |  Branch (40:53): [True: 585, False: 2.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|  2.31M|                }
  701|   288k|            }
  702|   462k|            pi2_src++;
  703|   462k|            pi2_tmp += trans_size;
  704|   462k|            zero_cols = zero_cols >> 1;
  705|   462k|        }
  706|       |
  707|  38.0k|        pi2_tmp = pi2_tmp_orig;
  708|       |
  709|       |        /* Inverse Transform 2nd stage */
  710|  38.0k|        shift = 20 - u1_bit_depth;
  711|  38.0k|        add = 1 << (shift - 1);
  712|       |
  713|  38.0k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (713:12): [True: 8.75k, False: 29.2k]
  ------------------
  714|  8.75k|        {
  715|   146k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (715:24): [True: 137k, False: 8.75k]
  ------------------
  716|   137k|            {
  717|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  718|  1.23M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (718:28): [True: 1.09M, False: 137k]
  ------------------
  719|  1.09M|                {
  720|  1.09M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  721|  1.09M|                                    + g_ai2_ihevc_trans_16[3][k]
  722|  1.09M|                                                    * pi2_tmp[3 * trans_size];
  723|  1.09M|                }
  724|   686k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (724:28): [True: 548k, False: 137k]
  ------------------
  725|   548k|                {
  726|   548k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  727|   548k|                }
  728|   137k|                eeo[0] = 0;
  729|   137k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  730|   137k|                eeo[1] = 0;
  731|   137k|                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|   412k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (734:28): [True: 274k, False: 137k]
  ------------------
  735|   274k|                {
  736|   274k|                    ee[k] = eee[k] + eeo[k];
  737|   274k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  738|   274k|                }
  739|   687k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (739:28): [True: 549k, False: 137k]
  ------------------
  740|   549k|                {
  741|   549k|                    e[k] = ee[k] + eo[k];
  742|   549k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  743|   549k|                }
  744|  1.22M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (744:28): [True: 1.08M, False: 137k]
  ------------------
  745|  1.08M|                {
  746|  1.08M|                    WORD32 itrans_out;
  747|  1.08M|                    itrans_out =
  748|  1.08M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.08M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|  1.08M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 78.1k, False: 1.01M]
  |  |  |  Branch (40:53): [True: 69.9k, False: 941k]
  |  |  ------------------
  ------------------
  750|  1.08M|                    itrans_out =
  751|  1.08M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.08M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|  1.08M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 72.5k, False: 1.01M]
  |  |  |  Branch (40:53): [True: 100k, False: 917k]
  |  |  ------------------
  ------------------
  753|  1.08M|                }
  754|   137k|                pi2_tmp++;
  755|   137k|                pu2_pred += pred_strd;
  756|   137k|                pu2_dst += dst_strd;
  757|   137k|            }
  758|  8.75k|        }
  759|  29.2k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (759:17): [True: 5.29k, False: 23.9k]
  ------------------
  760|  5.29k|        {
  761|  89.6k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (761:24): [True: 84.3k, False: 5.29k]
  ------------------
  762|  84.3k|            {
  763|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  764|   758k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (764:28): [True: 674k, False: 84.3k]
  ------------------
  765|   674k|                {
  766|   674k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  767|   674k|                                    + g_ai2_ihevc_trans_16[3][k]
  768|   674k|                                                    * pi2_tmp[3 * trans_size]
  769|   674k|                                    + g_ai2_ihevc_trans_16[5][k]
  770|   674k|                                                    * pi2_tmp[5 * trans_size]
  771|   674k|                                    + g_ai2_ihevc_trans_16[7][k]
  772|   674k|                                                    * pi2_tmp[7 * trans_size];
  773|   674k|                }
  774|   421k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (774:28): [True: 337k, False: 84.3k]
  ------------------
  775|   337k|                {
  776|   337k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  777|   337k|                                    + g_ai2_ihevc_trans_16[6][k]
  778|   337k|                                                    * pi2_tmp[6 * trans_size];
  779|   337k|                }
  780|  84.3k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  781|  84.3k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  782|  84.3k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  783|  84.3k|                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|   253k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (786:28): [True: 168k, False: 84.3k]
  ------------------
  787|   168k|                {
  788|   168k|                    ee[k] = eee[k] + eeo[k];
  789|   168k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  790|   168k|                }
  791|   421k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (791:28): [True: 337k, False: 84.3k]
  ------------------
  792|   337k|                {
  793|   337k|                    e[k] = ee[k] + eo[k];
  794|   337k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  795|   337k|                }
  796|   757k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (796:28): [True: 673k, False: 84.3k]
  ------------------
  797|   673k|                {
  798|   673k|                    WORD32 itrans_out;
  799|   673k|                    itrans_out =
  800|   673k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   673k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   673k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 673k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 673k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  801|   673k|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   673k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 17.8k, False: 655k]
  |  |  |  Branch (40:53): [True: 21.4k, False: 634k]
  |  |  ------------------
  ------------------
  802|   673k|                    itrans_out =
  803|   673k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   673k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   673k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 673k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 673k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  804|   673k|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|   673k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 17.7k, False: 655k]
  |  |  |  Branch (40:53): [True: 22.9k, False: 632k]
  |  |  ------------------
  ------------------
  805|   673k|                }
  806|  84.3k|                pi2_tmp++;
  807|  84.3k|                pu2_pred += pred_strd;
  808|  84.3k|                pu2_dst += dst_strd;
  809|  84.3k|            }
  810|  5.29k|        }
  811|  23.9k|        else /* All rows of output of 1st stage are non-zero */
  812|  23.9k|        {
  813|   408k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (813:24): [True: 384k, False: 23.9k]
  ------------------
  814|   384k|            {
  815|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  816|  3.46M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (816:28): [True: 3.07M, False: 384k]
  ------------------
  817|  3.07M|                {
  818|  3.07M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  819|  3.07M|                                    + g_ai2_ihevc_trans_16[3][k]
  820|  3.07M|                                                    * pi2_tmp[3 * trans_size]
  821|  3.07M|                                    + g_ai2_ihevc_trans_16[5][k]
  822|  3.07M|                                                    * pi2_tmp[5 * trans_size]
  823|  3.07M|                                    + g_ai2_ihevc_trans_16[7][k]
  824|  3.07M|                                                    * pi2_tmp[7 * trans_size]
  825|  3.07M|                                    + g_ai2_ihevc_trans_16[9][k]
  826|  3.07M|                                                    * pi2_tmp[9 * trans_size]
  827|  3.07M|                                    + g_ai2_ihevc_trans_16[11][k]
  828|  3.07M|                                                    * pi2_tmp[11 * trans_size]
  829|  3.07M|                                    + g_ai2_ihevc_trans_16[13][k]
  830|  3.07M|                                                    * pi2_tmp[13 * trans_size]
  831|  3.07M|                                    + g_ai2_ihevc_trans_16[15][k]
  832|  3.07M|                                                    * pi2_tmp[15 * trans_size];
  833|  3.07M|                }
  834|  1.92M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (834:28): [True: 1.53M, False: 384k]
  ------------------
  835|  1.53M|                {
  836|  1.53M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  837|  1.53M|                                    + g_ai2_ihevc_trans_16[6][k]
  838|  1.53M|                                                    * pi2_tmp[6 * trans_size]
  839|  1.53M|                                    + g_ai2_ihevc_trans_16[10][k]
  840|  1.53M|                                                    * pi2_tmp[10 * trans_size]
  841|  1.53M|                                    + g_ai2_ihevc_trans_16[14][k]
  842|  1.53M|                                                    * pi2_tmp[14 * trans_size];
  843|  1.53M|                }
  844|   384k|                eeo[0] =
  845|   384k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  846|   384k|                                                + g_ai2_ihevc_trans_16[12][0]
  847|   384k|                                                                * pi2_tmp[12
  848|   384k|                                                                                * trans_size];
  849|   384k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  850|   384k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  851|   384k|                eeo[1] =
  852|   384k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  853|   384k|                                                + g_ai2_ihevc_trans_16[12][1]
  854|   384k|                                                                * pi2_tmp[12
  855|   384k|                                                                                * trans_size];
  856|   384k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  857|   384k|                                + 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.15M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (860:28): [True: 769k, False: 384k]
  ------------------
  861|   769k|                {
  862|   769k|                    ee[k] = eee[k] + eeo[k];
  863|   769k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  864|   769k|                }
  865|  1.92M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (865:28): [True: 1.53M, False: 384k]
  ------------------
  866|  1.53M|                {
  867|  1.53M|                    e[k] = ee[k] + eo[k];
  868|  1.53M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  869|  1.53M|                }
  870|  3.46M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (870:28): [True: 3.07M, False: 384k]
  ------------------
  871|  3.07M|                {
  872|  3.07M|                    WORD32 itrans_out;
  873|  3.07M|                    itrans_out =
  874|  3.07M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  3.07M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.07M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|  3.07M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  3.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 110k, False: 2.96M]
  |  |  |  Branch (40:53): [True: 87.2k, False: 2.87M]
  |  |  ------------------
  ------------------
  876|  3.07M|                    itrans_out =
  877|  3.07M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  3.07M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.07M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  878|  3.07M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  3.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 96.7k, False: 2.98M]
  |  |  |  Branch (40:53): [True: 75.0k, False: 2.90M]
  |  |  ------------------
  ------------------
  879|  3.07M|                }
  880|   384k|                pi2_tmp++;
  881|   384k|                pu2_pred += pred_strd;
  882|   384k|                pu2_dst += dst_strd;
  883|   384k|            }
  884|  23.9k|        }
  885|       |        /************************************************************************************************/
  886|       |        /************************************END - IT_RECON_16x16****************************************/
  887|       |        /************************************************************************************************/
  888|  38.0k|    }
  889|   170k|}

ihevc_hbd_itrans_recon_32x32:
  107|   225k|{
  108|   225k|    WORD32 j, k;
  109|   225k|    WORD32 e[16], o[16];
  110|   225k|    WORD32 ee[8], eo[8];
  111|   225k|    WORD32 eee[4], eeo[4];
  112|   225k|    WORD32 eeee[2], eeeo[2];
  113|   225k|    WORD32 add;
  114|   225k|    WORD32 shift;
  115|   225k|    WORD16 *pi2_tmp_orig;
  116|   225k|    WORD32 trans_size;
  117|   225k|    WORD32 zero_rows_2nd_stage = zero_cols;
  118|   225k|    WORD32 row_limit_2nd_stage;
  119|   225k|    WORD16 clip_limit;
  120|       |
  121|   225k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|   225k|#define TRANS_SIZE_32 32
  ------------------
  122|   225k|    pi2_tmp_orig = pi2_tmp;
  123|   225k|    clip_limit = (1 << u1_bit_depth) - 1;
  124|       |
  125|   225k|    if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0)
  ------------------
  |  Branch (125:8): [True: 120k, False: 104k]
  ------------------
  126|   120k|        row_limit_2nd_stage = 4;
  127|   104k|    else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00)
  ------------------
  |  Branch (127:13): [True: 23.8k, False: 80.9k]
  ------------------
  128|  23.8k|        row_limit_2nd_stage = 8;
  129|  80.9k|    else
  130|  80.9k|        row_limit_2nd_stage = TRANS_SIZE_32;
  ------------------
  |  |  432|  80.9k|#define TRANS_SIZE_32 32
  ------------------
  131|       |
  132|   225k|    if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (132:8): [True: 131k, False: 93.9k]
  ------------------
  133|   131k|    {
  134|       |        /************************************************************************************************/
  135|       |        /**********************************START - IT_RECON_32x32****************************************/
  136|       |        /************************************************************************************************/
  137|       |        /* Inverse Transform 1st stage */
  138|   131k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   131k|#define IT_SHIFT_STAGE_1 7
  ------------------
  139|   131k|        add = 1 << (shift - 1);
  140|       |
  141|  2.13M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (141:20): [True: 2.00M, False: 131k]
  ------------------
  142|  2.00M|        {
  143|       |            /* Checking for Zero Cols */
  144|  2.00M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (144:16): [True: 1.48M, False: 510k]
  ------------------
  145|  1.48M|            {
  146|  1.48M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  147|  1.48M|            }
  148|   510k|            else
  149|   510k|            {
  150|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  151|  8.80M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (151:28): [True: 8.29M, False: 510k]
  ------------------
  152|  8.29M|                {
  153|  8.29M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  154|  8.29M|                                    + g_ai2_ihevc_trans_32[3][k]
  155|  8.29M|                                                    * pi2_src[3 * src_strd];
  156|  8.29M|                }
  157|  4.66M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (157:28): [True: 4.15M, False: 510k]
  ------------------
  158|  4.15M|                {
  159|  4.15M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd];
  160|  4.15M|                }
  161|   510k|                {
  162|   510k|                    eeo[0] = 0;
  163|   510k|                    eeo[1] = 0;
  164|   510k|                    eeo[2] = 0;
  165|   510k|                    eeo[3] = 0;
  166|   510k|                }
  167|   510k|                eeeo[0] = 0;
  168|   510k|                eeeo[1] = 0;
  169|   510k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  170|   510k|                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|   510k|                eee[0] = eeee[0] + eeeo[0];
  174|   510k|                eee[3] = eeee[0] - eeeo[0];
  175|   510k|                eee[1] = eeee[1] + eeeo[1];
  176|   510k|                eee[2] = eeee[1] - eeeo[1];
  177|  2.59M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (177:28): [True: 2.08M, False: 510k]
  ------------------
  178|  2.08M|                {
  179|  2.08M|                    ee[k] = eee[k] + eeo[k];
  180|  2.08M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  181|  2.08M|                }
  182|  4.67M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (182:28): [True: 4.16M, False: 510k]
  ------------------
  183|  4.16M|                {
  184|  4.16M|                    e[k] = ee[k] + eo[k];
  185|  4.16M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  186|  4.16M|                }
  187|  8.83M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (187:28): [True: 8.32M, False: 510k]
  ------------------
  188|  8.32M|                {
  189|  8.32M|                    pi2_tmp[k] =
  190|  8.32M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift) );
  ------------------
  |  |   53|  8.32M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 372, False: 8.32M]
  |  |  |  |  |  Branch (40:53): [True: 431, False: 8.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  8.32M|                    pi2_tmp[k + 16] =
  192|  8.32M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  8.32M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 410, False: 8.32M]
  |  |  |  |  |  Branch (40:53): [True: 256, False: 8.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  8.32M|                }
  194|   510k|            }
  195|  2.00M|            pi2_src++;
  196|  2.00M|            pi2_tmp += trans_size;
  197|  2.00M|            zero_cols = zero_cols >> 1;
  198|  2.00M|        }
  199|       |
  200|   131k|        pi2_tmp = pi2_tmp_orig;
  201|       |
  202|       |        /* Inverse Transform 2nd stage */
  203|   131k|        shift = 20 - u1_bit_depth;
  204|   131k|        add = 1 << (shift - 1);
  205|   131k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (205:12): [True: 67.0k, False: 64.3k]
  ------------------
  206|  67.0k|        {
  207|  2.17M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (207:24): [True: 2.10M, False: 67.0k]
  ------------------
  208|  2.10M|            {
  209|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  210|  35.7M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (210:28): [True: 33.6M, False: 2.10M]
  ------------------
  211|  33.6M|                {
  212|  33.6M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  213|  33.6M|                                    + g_ai2_ihevc_trans_32[3][k]
  214|  33.6M|                                                    * pi2_tmp[3 * trans_size];
  215|  33.6M|                }
  216|  19.0M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (216:28): [True: 16.9M, False: 2.10M]
  ------------------
  217|  16.9M|                {
  218|  16.9M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  219|  16.9M|                }
  220|  2.10M|                {
  221|  2.10M|                    eeo[0] = 0;
  222|  2.10M|                    eeo[1] = 0;
  223|  2.10M|                    eeo[2] = 0;
  224|  2.10M|                    eeo[3] = 0;
  225|  2.10M|                }
  226|  2.10M|                eeeo[0] = 0;
  227|  2.10M|                eeeo[1] = 0;
  228|  2.10M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  229|  2.10M|                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|  2.10M|                eee[0] = eeee[0] + eeeo[0];
  233|  2.10M|                eee[3] = eeee[0] - eeeo[0];
  234|  2.10M|                eee[1] = eeee[1] + eeeo[1];
  235|  2.10M|                eee[2] = eeee[1] - eeeo[1];
  236|  10.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (236:28): [True: 8.45M, False: 2.10M]
  ------------------
  237|  8.45M|                {
  238|  8.45M|                    ee[k] = eee[k] + eeo[k];
  239|  8.45M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  240|  8.45M|                }
  241|  19.0M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (241:28): [True: 16.9M, False: 2.10M]
  ------------------
  242|  16.9M|                {
  243|  16.9M|                    e[k] = ee[k] + eo[k];
  244|  16.9M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  245|  16.9M|                }
  246|  35.7M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (246:28): [True: 33.6M, False: 2.10M]
  ------------------
  247|  33.6M|                {
  248|  33.6M|                    WORD32 itrans_out;
  249|  33.6M|                    itrans_out =
  250|  33.6M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  33.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  33.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 33.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 33.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  33.6M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  33.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 753k, False: 32.8M]
  |  |  |  Branch (40:53): [True: 235k, False: 32.6M]
  |  |  ------------------
  ------------------
  252|  33.6M|                    itrans_out =
  253|  33.6M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  33.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  33.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 33.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 33.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  33.6M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  33.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 696k, False: 32.9M]
  |  |  |  Branch (40:53): [True: 192k, False: 32.7M]
  |  |  ------------------
  ------------------
  255|  33.6M|                }
  256|  2.10M|                pi2_tmp++;
  257|  2.10M|                pu2_pred += pred_strd;
  258|  2.10M|                pu2_dst += dst_strd;
  259|  2.10M|            }
  260|  67.0k|        }
  261|  64.3k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (261:17): [True: 12.5k, False: 51.7k]
  ------------------
  262|  12.5k|        {
  263|   404k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (263:24): [True: 392k, False: 12.5k]
  ------------------
  264|   392k|            {
  265|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  266|  6.64M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (266:28): [True: 6.25M, False: 392k]
  ------------------
  267|  6.25M|                {
  268|  6.25M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  269|  6.25M|                                    + g_ai2_ihevc_trans_32[3][k]
  270|  6.25M|                                                    * pi2_tmp[3 * trans_size]
  271|  6.25M|                                    + g_ai2_ihevc_trans_32[5][k]
  272|  6.25M|                                                    * pi2_tmp[5 * trans_size]
  273|  6.25M|                                    + g_ai2_ihevc_trans_32[7][k]
  274|  6.25M|                                                    * pi2_tmp[7 * trans_size];
  275|  6.25M|                }
  276|  3.55M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (276:28): [True: 3.15M, False: 392k]
  ------------------
  277|  3.15M|                {
  278|  3.15M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  279|  3.15M|                                    + g_ai2_ihevc_trans_32[6][k]
  280|  3.15M|                                                    * pi2_tmp[6 * trans_size];
  281|  3.15M|                }
  282|  1.97M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (282:28): [True: 1.58M, False: 392k]
  ------------------
  283|  1.58M|                {
  284|  1.58M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  285|  1.58M|                }
  286|   392k|                eeeo[0] = 0;
  287|   392k|                eeeo[1] = 0;
  288|   392k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  289|   392k|                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|   392k|                eee[0] = eeee[0] + eeeo[0];
  293|   392k|                eee[3] = eeee[0] - eeeo[0];
  294|   392k|                eee[1] = eeee[1] + eeeo[1];
  295|   392k|                eee[2] = eeee[1] - eeeo[1];
  296|  1.97M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (296:28): [True: 1.58M, False: 392k]
  ------------------
  297|  1.58M|                {
  298|  1.58M|                    ee[k] = eee[k] + eeo[k];
  299|  1.58M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  300|  1.58M|                }
  301|  3.54M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (301:28): [True: 3.15M, False: 392k]
  ------------------
  302|  3.15M|                {
  303|  3.15M|                    e[k] = ee[k] + eo[k];
  304|  3.15M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  305|  3.15M|                }
  306|  6.62M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (306:28): [True: 6.23M, False: 392k]
  ------------------
  307|  6.23M|                {
  308|  6.23M|                    WORD32 itrans_out;
  309|  6.23M|                    itrans_out =
  310|  6.23M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  6.23M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.23M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|  6.23M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  6.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 336k, False: 5.90M]
  |  |  |  Branch (40:53): [True: 37.1k, False: 5.86M]
  |  |  ------------------
  ------------------
  312|  6.23M|                    itrans_out =
  313|  6.23M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  6.23M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.23M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|  6.23M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  6.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 343k, False: 5.89M]
  |  |  |  Branch (40:53): [True: 50.3k, False: 5.84M]
  |  |  ------------------
  ------------------
  315|  6.23M|                }
  316|   392k|                pi2_tmp++;
  317|   392k|                pu2_pred += pred_strd;
  318|   392k|                pu2_dst += dst_strd;
  319|   392k|            }
  320|  12.5k|        }
  321|  51.7k|        else /* All rows of output of 1st stage are non-zero */
  322|  51.7k|        {
  323|  1.49M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (323:24): [True: 1.44M, False: 51.7k]
  ------------------
  324|  1.44M|            {
  325|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  326|  24.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (326:28): [True: 22.6M, False: 1.44M]
  ------------------
  327|  22.6M|                {
  328|  22.6M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  329|  22.6M|                                    + g_ai2_ihevc_trans_32[3][k]
  330|  22.6M|                                                    * pi2_tmp[3 * trans_size]
  331|  22.6M|                                    + g_ai2_ihevc_trans_32[5][k]
  332|  22.6M|                                                    * pi2_tmp[5 * trans_size]
  333|  22.6M|                                    + g_ai2_ihevc_trans_32[7][k]
  334|  22.6M|                                                    * pi2_tmp[7 * trans_size]
  335|  22.6M|                                    + g_ai2_ihevc_trans_32[9][k]
  336|  22.6M|                                                    * pi2_tmp[9 * trans_size]
  337|  22.6M|                                    + g_ai2_ihevc_trans_32[11][k]
  338|  22.6M|                                                    * pi2_tmp[11 * trans_size]
  339|  22.6M|                                    + g_ai2_ihevc_trans_32[13][k]
  340|  22.6M|                                                    * pi2_tmp[13 * trans_size]
  341|  22.6M|                                    + g_ai2_ihevc_trans_32[15][k]
  342|  22.6M|                                                    * pi2_tmp[15 * trans_size]
  343|  22.6M|                                    + g_ai2_ihevc_trans_32[17][k]
  344|  22.6M|                                                    * pi2_tmp[17 * trans_size]
  345|  22.6M|                                    + g_ai2_ihevc_trans_32[19][k]
  346|  22.6M|                                                    * pi2_tmp[19 * trans_size]
  347|  22.6M|                                    + g_ai2_ihevc_trans_32[21][k]
  348|  22.6M|                                                    * pi2_tmp[21 * trans_size]
  349|  22.6M|                                    + g_ai2_ihevc_trans_32[23][k]
  350|  22.6M|                                                    * pi2_tmp[23 * trans_size]
  351|  22.6M|                                    + g_ai2_ihevc_trans_32[25][k]
  352|  22.6M|                                                    * pi2_tmp[25 * trans_size]
  353|  22.6M|                                    + g_ai2_ihevc_trans_32[27][k]
  354|  22.6M|                                                    * pi2_tmp[27 * trans_size]
  355|  22.6M|                                    + g_ai2_ihevc_trans_32[29][k]
  356|  22.6M|                                                    * pi2_tmp[29 * trans_size]
  357|  22.6M|                                    + g_ai2_ihevc_trans_32[31][k]
  358|  22.6M|                                                    * pi2_tmp[31 * trans_size];
  359|  22.6M|                }
  360|  13.5M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (360:28): [True: 12.0M, False: 1.44M]
  ------------------
  361|  12.0M|                {
  362|  12.0M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  363|  12.0M|                                    + g_ai2_ihevc_trans_32[6][k]
  364|  12.0M|                                                    * pi2_tmp[6 * trans_size]
  365|  12.0M|                                    + g_ai2_ihevc_trans_32[10][k]
  366|  12.0M|                                                    * pi2_tmp[10 * trans_size]
  367|  12.0M|                                    + g_ai2_ihevc_trans_32[14][k]
  368|  12.0M|                                                    * pi2_tmp[14 * trans_size]
  369|  12.0M|                                    + g_ai2_ihevc_trans_32[18][k]
  370|  12.0M|                                                    * pi2_tmp[18 * trans_size]
  371|  12.0M|                                    + g_ai2_ihevc_trans_32[22][k]
  372|  12.0M|                                                    * pi2_tmp[22 * trans_size]
  373|  12.0M|                                    + g_ai2_ihevc_trans_32[26][k]
  374|  12.0M|                                                    * pi2_tmp[26 * trans_size]
  375|  12.0M|                                    + g_ai2_ihevc_trans_32[30][k]
  376|  12.0M|                                                    * pi2_tmp[30 * trans_size];
  377|  12.0M|                }
  378|  7.78M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (378:28): [True: 6.34M, False: 1.44M]
  ------------------
  379|  6.34M|                {
  380|  6.34M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  381|  6.34M|                                    + g_ai2_ihevc_trans_32[12][k]
  382|  6.34M|                                                    * pi2_tmp[12 * trans_size]
  383|  6.34M|                                    + g_ai2_ihevc_trans_32[20][k]
  384|  6.34M|                                                    * pi2_tmp[20 * trans_size]
  385|  6.34M|                                    + g_ai2_ihevc_trans_32[28][k]
  386|  6.34M|                                                    * pi2_tmp[28 * trans_size];
  387|  6.34M|                }
  388|  1.44M|                eeeo[0] =
  389|  1.44M|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  390|  1.44M|                                                + g_ai2_ihevc_trans_32[24][0]
  391|  1.44M|                                                                * pi2_tmp[24
  392|  1.44M|                                                                                * trans_size];
  393|  1.44M|                eeeo[1] =
  394|  1.44M|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  395|  1.44M|                                                + g_ai2_ihevc_trans_32[24][1]
  396|  1.44M|                                                                * pi2_tmp[24
  397|  1.44M|                                                                                * trans_size];
  398|  1.44M|                eeee[0] =
  399|  1.44M|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  400|  1.44M|                                                + g_ai2_ihevc_trans_32[16][0]
  401|  1.44M|                                                                * pi2_tmp[16
  402|  1.44M|                                                                                * trans_size];
  403|  1.44M|                eeee[1] =
  404|  1.44M|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  405|  1.44M|                                                + g_ai2_ihevc_trans_32[16][1]
  406|  1.44M|                                                                * pi2_tmp[16
  407|  1.44M|                                                                                * trans_size];
  408|       |
  409|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  410|  1.44M|                eee[0] = eeee[0] + eeeo[0];
  411|  1.44M|                eee[3] = eeee[0] - eeeo[0];
  412|  1.44M|                eee[1] = eeee[1] + eeeo[1];
  413|  1.44M|                eee[2] = eeee[1] - eeeo[1];
  414|  7.71M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (414:28): [True: 6.26M, False: 1.44M]
  ------------------
  415|  6.26M|                {
  416|  6.26M|                    ee[k] = eee[k] + eeo[k];
  417|  6.26M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  418|  6.26M|                }
  419|  13.8M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (419:28): [True: 12.3M, False: 1.44M]
  ------------------
  420|  12.3M|                {
  421|  12.3M|                    e[k] = ee[k] + eo[k];
  422|  12.3M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  423|  12.3M|                }
  424|  23.3M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (424:28): [True: 21.8M, False: 1.44M]
  ------------------
  425|  21.8M|                {
  426|  21.8M|                    WORD32 itrans_out;
  427|  21.8M|                    itrans_out =
  428|  21.8M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  21.8M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  21.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 21.8M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 21.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|  21.8M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  21.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.51M, False: 18.3M]
  |  |  |  Branch (40:53): [True: 187k, False: 18.1M]
  |  |  ------------------
  ------------------
  430|  21.8M|                    itrans_out =
  431|  21.8M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  21.8M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  21.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 21.8M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 21.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|  21.8M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  21.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.65M, False: 18.2M]
  |  |  |  Branch (40:53): [True: 156k, False: 18.0M]
  |  |  ------------------
  ------------------
  433|  21.8M|                }
  434|  1.44M|                pi2_tmp++;
  435|  1.44M|                pu2_pred += pred_strd;
  436|  1.44M|                pu2_dst += dst_strd;
  437|  1.44M|            }
  438|  51.7k|        }
  439|       |        /************************************************************************************************/
  440|       |        /************************************END - IT_RECON_32x32****************************************/
  441|       |        /************************************************************************************************/
  442|   131k|    }
  443|  93.9k|    else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (443:13): [True: 26.0k, False: 67.9k]
  ------------------
  444|  26.0k|    {
  445|       |        /************************************************************************************************/
  446|       |        /**********************************START - IT_RECON_32x32****************************************/
  447|       |        /************************************************************************************************/
  448|       |        /* Inverse Transform 1st stage */
  449|  26.0k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  26.0k|#define IT_SHIFT_STAGE_1 7
  ------------------
  450|  26.0k|        add = 1 << (shift - 1);
  451|       |
  452|   272k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (452:20): [True: 246k, False: 26.0k]
  ------------------
  453|   246k|        {
  454|       |            /* Checking for Zero Cols */
  455|   246k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (455:16): [True: 163k, False: 82.4k]
  ------------------
  456|   163k|            {
  457|   163k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  458|   163k|            }
  459|  82.4k|            else
  460|  82.4k|            {
  461|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  462|  1.40M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (462:28): [True: 1.32M, False: 82.4k]
  ------------------
  463|  1.32M|                {
  464|  1.32M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  465|  1.32M|                                    + g_ai2_ihevc_trans_32[3][k]
  466|  1.32M|                                                    * pi2_src[3 * src_strd]
  467|  1.32M|                                    + g_ai2_ihevc_trans_32[5][k]
  468|  1.32M|                                                    * pi2_src[5 * src_strd]
  469|  1.32M|                                    + g_ai2_ihevc_trans_32[7][k]
  470|  1.32M|                                                    * pi2_src[7 * src_strd];
  471|  1.32M|                }
  472|   745k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (472:28): [True: 662k, False: 82.4k]
  ------------------
  473|   662k|                {
  474|   662k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  475|   662k|                                    + g_ai2_ihevc_trans_32[6][k]
  476|   662k|                                                    * pi2_src[6 * src_strd];
  477|   662k|                }
  478|   413k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (478:28): [True: 331k, False: 82.4k]
  ------------------
  479|   331k|                {
  480|   331k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd];
  481|   331k|                }
  482|  82.4k|                eeeo[0] = 0;
  483|  82.4k|                eeeo[1] = 0;
  484|  82.4k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  485|  82.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|  82.4k|                eee[0] = eeee[0] + eeeo[0];
  489|  82.4k|                eee[3] = eeee[0] - eeeo[0];
  490|  82.4k|                eee[1] = eeee[1] + eeeo[1];
  491|  82.4k|                eee[2] = eeee[1] - eeeo[1];
  492|   413k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (492:28): [True: 331k, False: 82.4k]
  ------------------
  493|   331k|                {
  494|   331k|                    ee[k] = eee[k] + eeo[k];
  495|   331k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  496|   331k|                }
  497|   745k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (497:28): [True: 662k, False: 82.4k]
  ------------------
  498|   662k|                {
  499|   662k|                    e[k] = ee[k] + eo[k];
  500|   662k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  501|   662k|                }
  502|  1.40M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (502:28): [True: 1.32M, False: 82.4k]
  ------------------
  503|  1.32M|                {
  504|  1.32M|                    pi2_tmp[k] =
  505|  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: 405, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 640, False: 1.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  1.32M|                    pi2_tmp[k + 16] =
  507|  1.32M|                                    CLIP_S16( ((e[15 - k] - o[15 - 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: 305, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 291, False: 1.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  508|  1.32M|                }
  509|  82.4k|            }
  510|   246k|            pi2_src++;
  511|   246k|            pi2_tmp += trans_size;
  512|   246k|            zero_cols = zero_cols >> 1;
  513|   246k|        }
  514|       |
  515|  26.0k|        pi2_tmp = pi2_tmp_orig;
  516|       |
  517|       |        /* Inverse Transform 2nd stage */
  518|  26.0k|        shift = 20 - u1_bit_depth;
  519|  26.0k|        add = 1 << (shift - 1);
  520|  26.0k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (520:12): [True: 17.2k, False: 8.83k]
  ------------------
  521|  17.2k|        {
  522|   544k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (522:24): [True: 527k, False: 17.2k]
  ------------------
  523|   527k|            {
  524|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  525|  8.96M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (525:28): [True: 8.43M, False: 527k]
  ------------------
  526|  8.43M|                {
  527|  8.43M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  528|  8.43M|                                    + g_ai2_ihevc_trans_32[3][k]
  529|  8.43M|                                                    * pi2_tmp[3 * trans_size];
  530|  8.43M|                }
  531|  4.76M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (531:28): [True: 4.23M, False: 527k]
  ------------------
  532|  4.23M|                {
  533|  4.23M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  534|  4.23M|                }
  535|   527k|                {
  536|   527k|                    eeo[0] = 0;
  537|   527k|                    eeo[1] = 0;
  538|   527k|                    eeo[2] = 0;
  539|   527k|                    eeo[3] = 0;
  540|   527k|                }
  541|   527k|                eeeo[0] = 0;
  542|   527k|                eeeo[1] = 0;
  543|   527k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  544|   527k|                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|   527k|                eee[0] = eeee[0] + eeeo[0];
  548|   527k|                eee[3] = eeee[0] - eeeo[0];
  549|   527k|                eee[1] = eeee[1] + eeeo[1];
  550|   527k|                eee[2] = eeee[1] - eeeo[1];
  551|  2.63M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (551:28): [True: 2.11M, False: 527k]
  ------------------
  552|  2.11M|                {
  553|  2.11M|                    ee[k] = eee[k] + eeo[k];
  554|  2.11M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  555|  2.11M|                }
  556|  4.74M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (556:28): [True: 4.21M, False: 527k]
  ------------------
  557|  4.21M|                {
  558|  4.21M|                    e[k] = ee[k] + eo[k];
  559|  4.21M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  560|  4.21M|                }
  561|  8.70M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (561:28): [True: 8.18M, False: 527k]
  ------------------
  562|  8.18M|                {
  563|  8.18M|                    WORD32 itrans_out;
  564|  8.18M|                    itrans_out =
  565|  8.18M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  8.18M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.18M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.18M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.18M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|  8.18M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  8.18M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 454k, False: 7.72M]
  |  |  |  Branch (40:53): [True: 63.8k, False: 7.66M]
  |  |  ------------------
  ------------------
  567|  8.18M|                    itrans_out =
  568|  8.18M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  8.18M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.18M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.18M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.18M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|  8.18M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  8.18M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 442k, False: 7.73M]
  |  |  |  Branch (40:53): [True: 77.8k, False: 7.65M]
  |  |  ------------------
  ------------------
  570|  8.18M|                }
  571|   527k|                pi2_tmp++;
  572|   527k|                pu2_pred += pred_strd;
  573|   527k|                pu2_dst += dst_strd;
  574|   527k|            }
  575|  17.2k|        }
  576|  8.83k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (576:17): [True: 4.38k, False: 4.45k]
  ------------------
  577|  4.38k|        {
  578|   141k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (578:24): [True: 136k, False: 4.38k]
  ------------------
  579|   136k|            {
  580|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  581|  2.32M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (581:28): [True: 2.18M, False: 136k]
  ------------------
  582|  2.18M|                {
  583|  2.18M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  584|  2.18M|                                    + g_ai2_ihevc_trans_32[3][k]
  585|  2.18M|                                                    * pi2_tmp[3 * trans_size]
  586|  2.18M|                                    + g_ai2_ihevc_trans_32[5][k]
  587|  2.18M|                                                    * pi2_tmp[5 * trans_size]
  588|  2.18M|                                    + g_ai2_ihevc_trans_32[7][k]
  589|  2.18M|                                                    * pi2_tmp[7 * trans_size];
  590|  2.18M|                }
  591|  1.24M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (591:28): [True: 1.10M, False: 136k]
  ------------------
  592|  1.10M|                {
  593|  1.10M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  594|  1.10M|                                    + g_ai2_ihevc_trans_32[6][k]
  595|  1.10M|                                                    * pi2_tmp[6 * trans_size];
  596|  1.10M|                }
  597|   686k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (597:28): [True: 550k, False: 136k]
  ------------------
  598|   550k|                {
  599|   550k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  600|   550k|                }
  601|   136k|                eeeo[0] = 0;
  602|   136k|                eeeo[1] = 0;
  603|   136k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  604|   136k|                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|   136k|                eee[0] = eeee[0] + eeeo[0];
  608|   136k|                eee[3] = eeee[0] - eeeo[0];
  609|   136k|                eee[1] = eeee[1] + eeeo[1];
  610|   136k|                eee[2] = eeee[1] - eeeo[1];
  611|   692k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (611:28): [True: 556k, False: 136k]
  ------------------
  612|   556k|                {
  613|   556k|                    ee[k] = eee[k] + eeo[k];
  614|   556k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  615|   556k|                }
  616|  1.24M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (616:28): [True: 1.10M, False: 136k]
  ------------------
  617|  1.10M|                {
  618|  1.10M|                    e[k] = ee[k] + eo[k];
  619|  1.10M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  620|  1.10M|                }
  621|  2.29M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (621:28): [True: 2.16M, False: 136k]
  ------------------
  622|  2.16M|                {
  623|  2.16M|                    WORD32 itrans_out;
  624|  2.16M|                    itrans_out =
  625|  2.16M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  2.16M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.16M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  626|  2.16M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  2.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 544k, False: 1.61M]
  |  |  |  Branch (40:53): [True: 63.4k, False: 1.55M]
  |  |  ------------------
  ------------------
  627|  2.16M|                    itrans_out =
  628|  2.16M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  2.16M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.16M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|  2.16M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  2.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 562k, False: 1.59M]
  |  |  |  Branch (40:53): [True: 61.4k, False: 1.53M]
  |  |  ------------------
  ------------------
  630|  2.16M|                }
  631|   136k|                pi2_tmp++;
  632|   136k|                pu2_pred += pred_strd;
  633|   136k|                pu2_dst += dst_strd;
  634|   136k|            }
  635|  4.38k|        }
  636|  4.45k|        else /* All rows of output of 1st stage are non-zero */
  637|  4.45k|        {
  638|   146k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (638:24): [True: 141k, False: 4.45k]
  ------------------
  639|   141k|            {
  640|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  641|  2.40M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (641:28): [True: 2.26M, False: 141k]
  ------------------
  642|  2.26M|                {
  643|  2.26M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  644|  2.26M|                                    + g_ai2_ihevc_trans_32[3][k]
  645|  2.26M|                                                    * pi2_tmp[3 * trans_size]
  646|  2.26M|                                    + g_ai2_ihevc_trans_32[5][k]
  647|  2.26M|                                                    * pi2_tmp[5 * trans_size]
  648|  2.26M|                                    + g_ai2_ihevc_trans_32[7][k]
  649|  2.26M|                                                    * pi2_tmp[7 * trans_size]
  650|  2.26M|                                    + g_ai2_ihevc_trans_32[9][k]
  651|  2.26M|                                                    * pi2_tmp[9 * trans_size]
  652|  2.26M|                                    + g_ai2_ihevc_trans_32[11][k]
  653|  2.26M|                                                    * pi2_tmp[11 * trans_size]
  654|  2.26M|                                    + g_ai2_ihevc_trans_32[13][k]
  655|  2.26M|                                                    * pi2_tmp[13 * trans_size]
  656|  2.26M|                                    + g_ai2_ihevc_trans_32[15][k]
  657|  2.26M|                                                    * pi2_tmp[15 * trans_size]
  658|  2.26M|                                    + g_ai2_ihevc_trans_32[17][k]
  659|  2.26M|                                                    * pi2_tmp[17 * trans_size]
  660|  2.26M|                                    + g_ai2_ihevc_trans_32[19][k]
  661|  2.26M|                                                    * pi2_tmp[19 * trans_size]
  662|  2.26M|                                    + g_ai2_ihevc_trans_32[21][k]
  663|  2.26M|                                                    * pi2_tmp[21 * trans_size]
  664|  2.26M|                                    + g_ai2_ihevc_trans_32[23][k]
  665|  2.26M|                                                    * pi2_tmp[23 * trans_size]
  666|  2.26M|                                    + g_ai2_ihevc_trans_32[25][k]
  667|  2.26M|                                                    * pi2_tmp[25 * trans_size]
  668|  2.26M|                                    + g_ai2_ihevc_trans_32[27][k]
  669|  2.26M|                                                    * pi2_tmp[27 * trans_size]
  670|  2.26M|                                    + g_ai2_ihevc_trans_32[29][k]
  671|  2.26M|                                                    * pi2_tmp[29 * trans_size]
  672|  2.26M|                                    + g_ai2_ihevc_trans_32[31][k]
  673|  2.26M|                                                    * pi2_tmp[31 * trans_size];
  674|  2.26M|                }
  675|  1.27M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (675:28): [True: 1.13M, False: 141k]
  ------------------
  676|  1.13M|                {
  677|  1.13M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  678|  1.13M|                                    + g_ai2_ihevc_trans_32[6][k]
  679|  1.13M|                                                    * pi2_tmp[6 * trans_size]
  680|  1.13M|                                    + g_ai2_ihevc_trans_32[10][k]
  681|  1.13M|                                                    * pi2_tmp[10 * trans_size]
  682|  1.13M|                                    + g_ai2_ihevc_trans_32[14][k]
  683|  1.13M|                                                    * pi2_tmp[14 * trans_size]
  684|  1.13M|                                    + g_ai2_ihevc_trans_32[18][k]
  685|  1.13M|                                                    * pi2_tmp[18 * trans_size]
  686|  1.13M|                                    + g_ai2_ihevc_trans_32[22][k]
  687|  1.13M|                                                    * pi2_tmp[22 * trans_size]
  688|  1.13M|                                    + g_ai2_ihevc_trans_32[26][k]
  689|  1.13M|                                                    * pi2_tmp[26 * trans_size]
  690|  1.13M|                                    + g_ai2_ihevc_trans_32[30][k]
  691|  1.13M|                                                    * pi2_tmp[30 * trans_size];
  692|  1.13M|                }
  693|   711k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (693:28): [True: 569k, False: 141k]
  ------------------
  694|   569k|                {
  695|   569k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  696|   569k|                                    + g_ai2_ihevc_trans_32[12][k]
  697|   569k|                                                    * pi2_tmp[12 * trans_size]
  698|   569k|                                    + g_ai2_ihevc_trans_32[20][k]
  699|   569k|                                                    * pi2_tmp[20 * trans_size]
  700|   569k|                                    + g_ai2_ihevc_trans_32[28][k]
  701|   569k|                                                    * pi2_tmp[28 * trans_size];
  702|   569k|                }
  703|   141k|                eeeo[0] =
  704|   141k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  705|   141k|                                                + g_ai2_ihevc_trans_32[24][0]
  706|   141k|                                                                * pi2_tmp[24
  707|   141k|                                                                                * trans_size];
  708|   141k|                eeeo[1] =
  709|   141k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  710|   141k|                                                + g_ai2_ihevc_trans_32[24][1]
  711|   141k|                                                                * pi2_tmp[24
  712|   141k|                                                                                * trans_size];
  713|   141k|                eeee[0] =
  714|   141k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  715|   141k|                                                + g_ai2_ihevc_trans_32[16][0]
  716|   141k|                                                                * pi2_tmp[16
  717|   141k|                                                                                * trans_size];
  718|   141k|                eeee[1] =
  719|   141k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  720|   141k|                                                + g_ai2_ihevc_trans_32[16][1]
  721|   141k|                                                                * pi2_tmp[16
  722|   141k|                                                                                * trans_size];
  723|       |
  724|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  725|   141k|                eee[0] = eeee[0] + eeeo[0];
  726|   141k|                eee[3] = eeee[0] - eeeo[0];
  727|   141k|                eee[1] = eeee[1] + eeeo[1];
  728|   141k|                eee[2] = eeee[1] - eeeo[1];
  729|   708k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (729:28): [True: 566k, False: 141k]
  ------------------
  730|   566k|                {
  731|   566k|                    ee[k] = eee[k] + eeo[k];
  732|   566k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  733|   566k|                }
  734|  1.27M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (734:28): [True: 1.13M, False: 141k]
  ------------------
  735|  1.13M|                {
  736|  1.13M|                    e[k] = ee[k] + eo[k];
  737|  1.13M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  738|  1.13M|                }
  739|  2.39M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (739:28): [True: 2.25M, False: 141k]
  ------------------
  740|  2.25M|                {
  741|  2.25M|                    WORD32 itrans_out;
  742|  2.25M|                    itrans_out =
  743|  2.25M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  2.25M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.25M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|  2.25M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  2.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 297k, False: 1.95M]
  |  |  |  Branch (40:53): [True: 156k, False: 1.80M]
  |  |  ------------------
  ------------------
  745|  2.25M|                    itrans_out =
  746|  2.25M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  2.25M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.25M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  2.25M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  2.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 336k, False: 1.92M]
  |  |  |  Branch (40:53): [True: 131k, False: 1.78M]
  |  |  ------------------
  ------------------
  748|  2.25M|                }
  749|   141k|                pi2_tmp++;
  750|   141k|                pu2_pred += pred_strd;
  751|   141k|                pu2_dst += dst_strd;
  752|   141k|            }
  753|  4.45k|        }
  754|       |        /************************************************************************************************/
  755|       |        /************************************END - IT_RECON_32x32****************************************/
  756|       |        /************************************************************************************************/
  757|  26.0k|    }
  758|  67.9k|    else  /* All rows of input are non-zero */
  759|  67.9k|    {
  760|       |        /************************************************************************************************/
  761|       |        /**********************************START - IT_RECON_32x32****************************************/
  762|       |        /************************************************************************************************/
  763|       |        /* Inverse Transform 1st stage */
  764|  67.9k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  67.9k|#define IT_SHIFT_STAGE_1 7
  ------------------
  765|  67.9k|        add = 1 << (shift - 1);
  766|       |
  767|  1.06M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (767:20): [True: 995k, False: 67.9k]
  ------------------
  768|   995k|        {
  769|       |            /* Checking for Zero Cols */
  770|   995k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (770:16): [True: 533k, False: 461k]
  ------------------
  771|   533k|            {
  772|   533k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  773|   533k|            }
  774|   461k|            else
  775|   461k|            {
  776|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  777|  7.85M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (777:28): [True: 7.39M, False: 461k]
  ------------------
  778|  7.39M|                {
  779|  7.39M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  780|  7.39M|                                    + g_ai2_ihevc_trans_32[3][k]
  781|  7.39M|                                                    * pi2_src[3 * src_strd]
  782|  7.39M|                                    + g_ai2_ihevc_trans_32[5][k]
  783|  7.39M|                                                    * pi2_src[5 * src_strd]
  784|  7.39M|                                    + g_ai2_ihevc_trans_32[7][k]
  785|  7.39M|                                                    * pi2_src[7 * src_strd]
  786|  7.39M|                                    + g_ai2_ihevc_trans_32[9][k]
  787|  7.39M|                                                    * pi2_src[9 * src_strd]
  788|  7.39M|                                    + g_ai2_ihevc_trans_32[11][k]
  789|  7.39M|                                                    * pi2_src[11 * src_strd]
  790|  7.39M|                                    + g_ai2_ihevc_trans_32[13][k]
  791|  7.39M|                                                    * pi2_src[13 * src_strd]
  792|  7.39M|                                    + g_ai2_ihevc_trans_32[15][k]
  793|  7.39M|                                                    * pi2_src[15 * src_strd]
  794|  7.39M|                                    + g_ai2_ihevc_trans_32[17][k]
  795|  7.39M|                                                    * pi2_src[17 * src_strd]
  796|  7.39M|                                    + g_ai2_ihevc_trans_32[19][k]
  797|  7.39M|                                                    * pi2_src[19 * src_strd]
  798|  7.39M|                                    + g_ai2_ihevc_trans_32[21][k]
  799|  7.39M|                                                    * pi2_src[21 * src_strd]
  800|  7.39M|                                    + g_ai2_ihevc_trans_32[23][k]
  801|  7.39M|                                                    * pi2_src[23 * src_strd]
  802|  7.39M|                                    + g_ai2_ihevc_trans_32[25][k]
  803|  7.39M|                                                    * pi2_src[25 * src_strd]
  804|  7.39M|                                    + g_ai2_ihevc_trans_32[27][k]
  805|  7.39M|                                                    * pi2_src[27 * src_strd]
  806|  7.39M|                                    + g_ai2_ihevc_trans_32[29][k]
  807|  7.39M|                                                    * pi2_src[29 * src_strd]
  808|  7.39M|                                    + g_ai2_ihevc_trans_32[31][k]
  809|  7.39M|                                                    * pi2_src[31 * src_strd];
  810|  7.39M|                }
  811|  4.16M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (811:28): [True: 3.70M, False: 461k]
  ------------------
  812|  3.70M|                {
  813|  3.70M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  814|  3.70M|                                    + g_ai2_ihevc_trans_32[6][k]
  815|  3.70M|                                                    * pi2_src[6 * src_strd]
  816|  3.70M|                                    + g_ai2_ihevc_trans_32[10][k]
  817|  3.70M|                                                    * pi2_src[10 * src_strd]
  818|  3.70M|                                    + g_ai2_ihevc_trans_32[14][k]
  819|  3.70M|                                                    * pi2_src[14 * src_strd]
  820|  3.70M|                                    + g_ai2_ihevc_trans_32[18][k]
  821|  3.70M|                                                    * pi2_src[18 * src_strd]
  822|  3.70M|                                    + g_ai2_ihevc_trans_32[22][k]
  823|  3.70M|                                                    * pi2_src[22 * src_strd]
  824|  3.70M|                                    + g_ai2_ihevc_trans_32[26][k]
  825|  3.70M|                                                    * pi2_src[26 * src_strd]
  826|  3.70M|                                    + g_ai2_ihevc_trans_32[30][k]
  827|  3.70M|                                                    * pi2_src[30 * src_strd];
  828|  3.70M|                }
  829|  2.31M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (829:28): [True: 1.85M, False: 461k]
  ------------------
  830|  1.85M|                {
  831|  1.85M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]
  832|  1.85M|                                    + g_ai2_ihevc_trans_32[12][k]
  833|  1.85M|                                                    * pi2_src[12 * src_strd]
  834|  1.85M|                                    + g_ai2_ihevc_trans_32[20][k]
  835|  1.85M|                                                    * pi2_src[20 * src_strd]
  836|  1.85M|                                    + g_ai2_ihevc_trans_32[28][k]
  837|  1.85M|                                                    * pi2_src[28 * src_strd];
  838|  1.85M|                }
  839|   461k|                eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd]
  840|   461k|                                + g_ai2_ihevc_trans_32[24][0]
  841|   461k|                                                * pi2_src[24 * src_strd];
  842|   461k|                eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd]
  843|   461k|                                + g_ai2_ihevc_trans_32[24][1]
  844|   461k|                                                * pi2_src[24 * src_strd];
  845|   461k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]
  846|   461k|                                + g_ai2_ihevc_trans_32[16][0]
  847|   461k|                                                * pi2_src[16 * src_strd];
  848|   461k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]
  849|   461k|                                + g_ai2_ihevc_trans_32[16][1]
  850|   461k|                                                * pi2_src[16 * src_strd];
  851|       |
  852|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  853|   461k|                eee[0] = eeee[0] + eeeo[0];
  854|   461k|                eee[3] = eeee[0] - eeeo[0];
  855|   461k|                eee[1] = eeee[1] + eeeo[1];
  856|   461k|                eee[2] = eeee[1] - eeeo[1];
  857|  2.31M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (857:28): [True: 1.84M, False: 461k]
  ------------------
  858|  1.84M|                {
  859|  1.84M|                    ee[k] = eee[k] + eeo[k];
  860|  1.84M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  861|  1.84M|                }
  862|  4.16M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (862:28): [True: 3.69M, False: 461k]
  ------------------
  863|  3.69M|                {
  864|  3.69M|                    e[k] = ee[k] + eo[k];
  865|  3.69M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  866|  3.69M|                }
  867|  7.85M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (867:28): [True: 7.39M, False: 461k]
  ------------------
  868|  7.39M|                {
  869|  7.39M|                    pi2_tmp[k] =
  870|  7.39M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift) );
  ------------------
  |  |   53|  7.39M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.8k, False: 7.38M]
  |  |  |  |  |  Branch (40:53): [True: 9.26k, False: 7.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  871|  7.39M|                    pi2_tmp[k + 16] =
  872|  7.39M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  7.39M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.63k, False: 7.39M]
  |  |  |  |  |  Branch (40:53): [True: 3.57k, False: 7.38M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  873|  7.39M|                }
  874|   461k|            }
  875|   995k|            pi2_src++;
  876|   995k|            pi2_tmp += trans_size;
  877|   995k|            zero_cols = zero_cols >> 1;
  878|   995k|        }
  879|       |
  880|  67.9k|        pi2_tmp = pi2_tmp_orig;
  881|       |
  882|       |        /* Inverse Transform 2nd stage */
  883|  67.9k|        shift = 20 - u1_bit_depth;
  884|  67.9k|        add = 1 << (shift - 1);
  885|  67.9k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (885:12): [True: 36.4k, False: 31.4k]
  ------------------
  886|  36.4k|        {
  887|  1.15M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (887:24): [True: 1.11M, False: 36.4k]
  ------------------
  888|  1.11M|            {
  889|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  890|  18.5M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (890:28): [True: 17.4M, False: 1.11M]
  ------------------
  891|  17.4M|                {
  892|  17.4M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  893|  17.4M|                                    + g_ai2_ihevc_trans_32[3][k]
  894|  17.4M|                                                    * pi2_tmp[3 * trans_size];
  895|  17.4M|                }
  896|  9.99M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (896:28): [True: 8.88M, False: 1.11M]
  ------------------
  897|  8.88M|                {
  898|  8.88M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  899|  8.88M|                }
  900|  1.11M|                {
  901|  1.11M|                    eeo[0] = 0;
  902|  1.11M|                    eeo[1] = 0;
  903|  1.11M|                    eeo[2] = 0;
  904|  1.11M|                    eeo[3] = 0;
  905|  1.11M|                }
  906|  1.11M|                eeeo[0] = 0;
  907|  1.11M|                eeeo[1] = 0;
  908|  1.11M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  909|  1.11M|                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.11M|                eee[0] = eeee[0] + eeeo[0];
  913|  1.11M|                eee[3] = eeee[0] - eeeo[0];
  914|  1.11M|                eee[1] = eeee[1] + eeeo[1];
  915|  1.11M|                eee[2] = eeee[1] - eeeo[1];
  916|  5.55M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (916:28): [True: 4.43M, False: 1.11M]
  ------------------
  917|  4.43M|                {
  918|  4.43M|                    ee[k] = eee[k] + eeo[k];
  919|  4.43M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  920|  4.43M|                }
  921|  9.91M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (921:28): [True: 8.80M, False: 1.11M]
  ------------------
  922|  8.80M|                {
  923|  8.80M|                    e[k] = ee[k] + eo[k];
  924|  8.80M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  925|  8.80M|                }
  926|  18.3M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (926:28): [True: 17.2M, False: 1.11M]
  ------------------
  927|  17.2M|                {
  928|  17.2M|                    WORD32 itrans_out;
  929|  17.2M|                    itrans_out =
  930|  17.2M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  17.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  17.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 17.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 17.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|  17.2M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  17.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.28M, False: 15.9M]
  |  |  |  Branch (40:53): [True: 194k, False: 15.7M]
  |  |  ------------------
  ------------------
  932|  17.2M|                    itrans_out =
  933|  17.2M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  17.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  17.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 17.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 17.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  934|  17.2M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  17.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.38M, False: 15.8M]
  |  |  |  Branch (40:53): [True: 160k, False: 15.6M]
  |  |  ------------------
  ------------------
  935|  17.2M|                }
  936|  1.11M|                pi2_tmp++;
  937|  1.11M|                pu2_pred += pred_strd;
  938|  1.11M|                pu2_dst += dst_strd;
  939|  1.11M|            }
  940|  36.4k|        }
  941|  31.4k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (941:17): [True: 6.89k, False: 24.6k]
  ------------------
  942|  6.89k|        {
  943|   220k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (943:24): [True: 213k, False: 6.89k]
  ------------------
  944|   213k|            {
  945|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  946|  3.56M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (946:28): [True: 3.35M, False: 213k]
  ------------------
  947|  3.35M|                {
  948|  3.35M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  949|  3.35M|                                    + g_ai2_ihevc_trans_32[3][k]
  950|  3.35M|                                                    * pi2_tmp[3 * trans_size]
  951|  3.35M|                                    + g_ai2_ihevc_trans_32[5][k]
  952|  3.35M|                                                    * pi2_tmp[5 * trans_size]
  953|  3.35M|                                    + g_ai2_ihevc_trans_32[7][k]
  954|  3.35M|                                                    * pi2_tmp[7 * trans_size];
  955|  3.35M|                }
  956|  1.90M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (956:28): [True: 1.69M, False: 213k]
  ------------------
  957|  1.69M|                {
  958|  1.69M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  959|  1.69M|                                    + g_ai2_ihevc_trans_32[6][k]
  960|  1.69M|                                                    * pi2_tmp[6 * trans_size];
  961|  1.69M|                }
  962|  1.06M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (962:28): [True: 849k, False: 213k]
  ------------------
  963|   849k|                {
  964|   849k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  965|   849k|                }
  966|   213k|                eeeo[0] = 0;
  967|   213k|                eeeo[1] = 0;
  968|   213k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  969|   213k|                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|   213k|                eee[0] = eeee[0] + eeeo[0];
  973|   213k|                eee[3] = eeee[0] - eeeo[0];
  974|   213k|                eee[1] = eeee[1] + eeeo[1];
  975|   213k|                eee[2] = eeee[1] - eeeo[1];
  976|  1.06M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (976:28): [True: 853k, False: 213k]
  ------------------
  977|   853k|                {
  978|   853k|                    ee[k] = eee[k] + eeo[k];
  979|   853k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  980|   853k|                }
  981|  1.91M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (981:28): [True: 1.70M, False: 213k]
  ------------------
  982|  1.70M|                {
  983|  1.70M|                    e[k] = ee[k] + eo[k];
  984|  1.70M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  985|  1.70M|                }
  986|  3.57M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (986:28): [True: 3.36M, False: 213k]
  ------------------
  987|  3.36M|                {
  988|  3.36M|                    WORD32 itrans_out;
  989|  3.36M|                    itrans_out =
  990|  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  991|  3.36M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  3.36M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 186k, False: 3.17M]
  |  |  |  Branch (40:53): [True: 61.9k, False: 3.11M]
  |  |  ------------------
  ------------------
  992|  3.36M|                    itrans_out =
  993|  3.36M|                                    CLIP_S16( ((e[15 - k] - o[15 - 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|  3.36M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  3.36M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 158k, False: 3.20M]
  |  |  |  Branch (40:53): [True: 64.8k, False: 3.13M]
  |  |  ------------------
  ------------------
  995|  3.36M|                }
  996|   213k|                pi2_tmp++;
  997|   213k|                pu2_pred += pred_strd;
  998|   213k|                pu2_dst += dst_strd;
  999|   213k|            }
 1000|  6.89k|        }
 1001|  24.6k|        else /* All rows of output of 1st stage are non-zero */
 1002|  24.6k|        {
 1003|   803k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1003:24): [True: 779k, False: 24.6k]
  ------------------
 1004|   779k|            {
 1005|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1006|  13.2M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1006:28): [True: 12.4M, False: 779k]
  ------------------
 1007|  12.4M|                {
 1008|  12.4M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1009|  12.4M|                                    + g_ai2_ihevc_trans_32[3][k]
 1010|  12.4M|                                                    * pi2_tmp[3 * trans_size]
 1011|  12.4M|                                    + g_ai2_ihevc_trans_32[5][k]
 1012|  12.4M|                                                    * pi2_tmp[5 * trans_size]
 1013|  12.4M|                                    + g_ai2_ihevc_trans_32[7][k]
 1014|  12.4M|                                                    * pi2_tmp[7 * trans_size]
 1015|  12.4M|                                    + g_ai2_ihevc_trans_32[9][k]
 1016|  12.4M|                                                    * pi2_tmp[9 * trans_size]
 1017|  12.4M|                                    + g_ai2_ihevc_trans_32[11][k]
 1018|  12.4M|                                                    * pi2_tmp[11 * trans_size]
 1019|  12.4M|                                    + g_ai2_ihevc_trans_32[13][k]
 1020|  12.4M|                                                    * pi2_tmp[13 * trans_size]
 1021|  12.4M|                                    + g_ai2_ihevc_trans_32[15][k]
 1022|  12.4M|                                                    * pi2_tmp[15 * trans_size]
 1023|  12.4M|                                    + g_ai2_ihevc_trans_32[17][k]
 1024|  12.4M|                                                    * pi2_tmp[17 * trans_size]
 1025|  12.4M|                                    + g_ai2_ihevc_trans_32[19][k]
 1026|  12.4M|                                                    * pi2_tmp[19 * trans_size]
 1027|  12.4M|                                    + g_ai2_ihevc_trans_32[21][k]
 1028|  12.4M|                                                    * pi2_tmp[21 * trans_size]
 1029|  12.4M|                                    + g_ai2_ihevc_trans_32[23][k]
 1030|  12.4M|                                                    * pi2_tmp[23 * trans_size]
 1031|  12.4M|                                    + g_ai2_ihevc_trans_32[25][k]
 1032|  12.4M|                                                    * pi2_tmp[25 * trans_size]
 1033|  12.4M|                                    + g_ai2_ihevc_trans_32[27][k]
 1034|  12.4M|                                                    * pi2_tmp[27 * trans_size]
 1035|  12.4M|                                    + g_ai2_ihevc_trans_32[29][k]
 1036|  12.4M|                                                    * pi2_tmp[29 * trans_size]
 1037|  12.4M|                                    + g_ai2_ihevc_trans_32[31][k]
 1038|  12.4M|                                                    * pi2_tmp[31 * trans_size];
 1039|  12.4M|                }
 1040|  7.04M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1040:28): [True: 6.26M, False: 779k]
  ------------------
 1041|  6.26M|                {
 1042|  6.26M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1043|  6.26M|                                    + g_ai2_ihevc_trans_32[6][k]
 1044|  6.26M|                                                    * pi2_tmp[6 * trans_size]
 1045|  6.26M|                                    + g_ai2_ihevc_trans_32[10][k]
 1046|  6.26M|                                                    * pi2_tmp[10 * trans_size]
 1047|  6.26M|                                    + g_ai2_ihevc_trans_32[14][k]
 1048|  6.26M|                                                    * pi2_tmp[14 * trans_size]
 1049|  6.26M|                                    + g_ai2_ihevc_trans_32[18][k]
 1050|  6.26M|                                                    * pi2_tmp[18 * trans_size]
 1051|  6.26M|                                    + g_ai2_ihevc_trans_32[22][k]
 1052|  6.26M|                                                    * pi2_tmp[22 * trans_size]
 1053|  6.26M|                                    + g_ai2_ihevc_trans_32[26][k]
 1054|  6.26M|                                                    * pi2_tmp[26 * trans_size]
 1055|  6.26M|                                    + g_ai2_ihevc_trans_32[30][k]
 1056|  6.26M|                                                    * pi2_tmp[30 * trans_size];
 1057|  6.26M|                }
 1058|  3.93M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1058:28): [True: 3.15M, False: 779k]
  ------------------
 1059|  3.15M|                {
 1060|  3.15M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 1061|  3.15M|                                    + g_ai2_ihevc_trans_32[12][k]
 1062|  3.15M|                                                    * pi2_tmp[12 * trans_size]
 1063|  3.15M|                                    + g_ai2_ihevc_trans_32[20][k]
 1064|  3.15M|                                                    * pi2_tmp[20 * trans_size]
 1065|  3.15M|                                    + g_ai2_ihevc_trans_32[28][k]
 1066|  3.15M|                                                    * pi2_tmp[28 * trans_size];
 1067|  3.15M|                }
 1068|   779k|                eeeo[0] =
 1069|   779k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 1070|   779k|                                                + g_ai2_ihevc_trans_32[24][0]
 1071|   779k|                                                                * pi2_tmp[24
 1072|   779k|                                                                                * trans_size];
 1073|   779k|                eeeo[1] =
 1074|   779k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 1075|   779k|                                                + g_ai2_ihevc_trans_32[24][1]
 1076|   779k|                                                                * pi2_tmp[24
 1077|   779k|                                                                                * trans_size];
 1078|   779k|                eeee[0] =
 1079|   779k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 1080|   779k|                                                + g_ai2_ihevc_trans_32[16][0]
 1081|   779k|                                                                * pi2_tmp[16
 1082|   779k|                                                                                * trans_size];
 1083|   779k|                eeee[1] =
 1084|   779k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 1085|   779k|                                                + g_ai2_ihevc_trans_32[16][1]
 1086|   779k|                                                                * pi2_tmp[16
 1087|   779k|                                                                                * trans_size];
 1088|       |
 1089|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1090|   779k|                eee[0] = eeee[0] + eeeo[0];
 1091|   779k|                eee[3] = eeee[0] - eeeo[0];
 1092|   779k|                eee[1] = eeee[1] + eeeo[1];
 1093|   779k|                eee[2] = eeee[1] - eeeo[1];
 1094|  3.92M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1094:28): [True: 3.14M, False: 779k]
  ------------------
 1095|  3.14M|                {
 1096|  3.14M|                    ee[k] = eee[k] + eeo[k];
 1097|  3.14M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1098|  3.14M|                }
 1099|  7.06M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1099:28): [True: 6.28M, False: 779k]
  ------------------
 1100|  6.28M|                {
 1101|  6.28M|                    e[k] = ee[k] + eo[k];
 1102|  6.28M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1103|  6.28M|                }
 1104|  13.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1104:28): [True: 12.4M, False: 779k]
  ------------------
 1105|  12.4M|                {
 1106|  12.4M|                    WORD32 itrans_out;
 1107|  12.4M|                    itrans_out =
 1108|  12.4M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  12.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  12.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.75k, False: 12.4M]
  |  |  |  |  |  Branch (40:53): [True: 70, False: 12.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1109|  12.4M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  12.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.60M, False: 10.8M]
  |  |  |  Branch (40:53): [True: 1.29M, False: 9.51M]
  |  |  ------------------
  ------------------
 1110|  12.4M|                    itrans_out =
 1111|  12.4M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  12.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  12.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 12.4M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 12.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|  12.4M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  12.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.47M, False: 10.9M]
  |  |  |  Branch (40:53): [True: 1.13M, False: 9.80M]
  |  |  ------------------
  ------------------
 1113|  12.4M|                }
 1114|   779k|                pi2_tmp++;
 1115|   779k|                pu2_pred += pred_strd;
 1116|   779k|                pu2_dst += dst_strd;
 1117|   779k|            }
 1118|  24.6k|        }
 1119|       |        /************************************************************************************************/
 1120|       |        /************************************END - IT_RECON_32x32****************************************/
 1121|       |        /************************************************************************************************/
 1122|  67.9k|    }
 1123|   225k|}

ihevc_hbd_itrans_recon_8x8:
  106|   217k|{
  107|   217k|    WORD32 j, k;
  108|   217k|    WORD32 e[4], o[4];
  109|   217k|    WORD32 ee[2], eo[2];
  110|   217k|    WORD32 add;
  111|   217k|    WORD32 shift;
  112|   217k|    WORD16 *pi2_tmp_orig;
  113|   217k|    WORD32 trans_size;
  114|   217k|    WORD32 zero_rows_2nd_stage = zero_cols;
  115|   217k|    WORD32 row_limit_2nd_stage;
  116|   217k|    WORD16 clip_limit;
  117|       |
  118|   217k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   217k|#define TRANS_SIZE_8   8
  ------------------
  119|   217k|    clip_limit = (1 << u1_bit_depth) - 1;
  120|       |
  121|   217k|    pi2_tmp_orig = pi2_tmp;
  122|       |
  123|   217k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (123:8): [True: 128k, False: 88.7k]
  ------------------
  124|   128k|        row_limit_2nd_stage = 4;
  125|  88.7k|    else
  126|  88.7k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  88.7k|#define TRANS_SIZE_8   8
  ------------------
  127|       |
  128|       |
  129|   217k|    if((zero_rows & 0xF0) == 0xF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (129:8): [True: 131k, False: 85.6k]
  ------------------
  130|   131k|    {
  131|       |        /************************************************************************************************/
  132|       |        /**********************************START - IT_RECON_8x8******************************************/
  133|       |        /************************************************************************************************/
  134|       |
  135|       |        /* Inverse Transform 1st stage */
  136|   131k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   131k|#define IT_SHIFT_STAGE_1 7
  ------------------
  137|   131k|        add = 1 << (shift - 1);
  138|       |
  139|   753k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (139:20): [True: 621k, False: 131k]
  ------------------
  140|   621k|        {
  141|       |            /* Checking for Zero Cols */
  142|   621k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (142:16): [True: 283k, False: 338k]
  ------------------
  143|   283k|            {
  144|   283k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  145|   283k|            }
  146|   338k|            else
  147|   338k|            {
  148|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  149|  1.69M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (149:28): [True: 1.35M, False: 338k]
  ------------------
  150|  1.35M|                {
  151|  1.35M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  152|  1.35M|                                    + g_ai2_ihevc_trans_8[3][k]
  153|  1.35M|                                                    * pi2_src[3 * src_strd];
  154|  1.35M|                }
  155|   338k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd];
  156|   338k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd];
  157|   338k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0];
  158|   338k|                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|   338k|                e[0] = ee[0] + eo[0];
  162|   338k|                e[3] = ee[0] - eo[0];
  163|   338k|                e[1] = ee[1] + eo[1];
  164|   338k|                e[2] = ee[1] - eo[1];
  165|  1.69M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (165:28): [True: 1.35M, False: 338k]
  ------------------
  166|  1.35M|                {
  167|  1.35M|                    pi2_tmp[k] =
  168|  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: 497, False: 1.35M]
  |  |  |  |  |  Branch (40:53): [True: 465, False: 1.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  1.35M|                    pi2_tmp[k + 4] =
  170|  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: 221, False: 1.35M]
  |  |  |  |  |  Branch (40:53): [True: 353, False: 1.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|  1.35M|                }
  172|   338k|            }
  173|   621k|            pi2_src++;
  174|   621k|            pi2_tmp += trans_size;
  175|   621k|            zero_cols = zero_cols >> 1;
  176|   621k|        }
  177|       |
  178|   131k|        pi2_tmp = pi2_tmp_orig;
  179|       |
  180|       |        /* Inverse Transform 2nd stage */
  181|   131k|        shift = 20 - u1_bit_depth;
  182|   131k|        add = 1 << (shift - 1);
  183|   131k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (183:12): [True: 108k, False: 23.4k]
  ------------------
  184|   108k|        {
  185|   975k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (185:24): [True: 866k, False: 108k]
  ------------------
  186|   866k|            {
  187|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  188|  4.33M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (188:28): [True: 3.46M, False: 866k]
  ------------------
  189|  3.46M|                {
  190|  3.46M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  191|  3.46M|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  192|  3.46M|                }
  193|   866k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  194|   866k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  195|   866k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  196|   866k|                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|   866k|                e[0] = ee[0] + eo[0];
  200|   866k|                e[3] = ee[0] - eo[0];
  201|   866k|                e[1] = ee[1] + eo[1];
  202|   866k|                e[2] = ee[1] - eo[1];
  203|  4.33M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (203:28): [True: 3.46M, False: 866k]
  ------------------
  204|  3.46M|                {
  205|  3.46M|                    WORD32 itrans_out;
  206|  3.46M|                    itrans_out =
  207|  3.46M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  3.46M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.46M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.46M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|  3.46M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  3.46M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 246k, False: 3.22M]
  |  |  |  Branch (40:53): [True: 130k, False: 3.08M]
  |  |  ------------------
  ------------------
  209|  3.46M|                    itrans_out =
  210|  3.46M|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|  3.46M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.46M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.46M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|  3.46M|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|  3.46M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 249k, False: 3.21M]
  |  |  |  Branch (40:53): [True: 125k, False: 3.09M]
  |  |  ------------------
  ------------------
  212|  3.46M|                }
  213|   866k|                pi2_tmp++;
  214|   866k|                pu2_pred += pred_strd;
  215|   866k|                pu2_dst += dst_strd;
  216|   866k|            }
  217|   108k|        }
  218|  23.4k|        else /* All rows of output of 1st stage are non-zero */
  219|  23.4k|        {
  220|   211k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (220:24): [True: 187k, False: 23.4k]
  ------------------
  221|   187k|            {
  222|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  223|   939k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (223:28): [True: 751k, False: 187k]
  ------------------
  224|   751k|                {
  225|   751k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  226|   751k|                                    + g_ai2_ihevc_trans_8[3][k]
  227|   751k|                                                    * pi2_tmp[3 * trans_size]
  228|   751k|                                    + g_ai2_ihevc_trans_8[5][k]
  229|   751k|                                                    * pi2_tmp[5 * trans_size]
  230|   751k|                                    + g_ai2_ihevc_trans_8[7][k]
  231|   751k|                                                    * pi2_tmp[7 * trans_size];
  232|   751k|                }
  233|       |
  234|   187k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  235|   187k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  236|   187k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  237|   187k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  238|   187k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  239|   187k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  240|   187k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  241|   187k|                                + 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|   187k|                e[0] = ee[0] + eo[0];
  245|   187k|                e[3] = ee[0] - eo[0];
  246|   187k|                e[1] = ee[1] + eo[1];
  247|   187k|                e[2] = ee[1] - eo[1];
  248|   939k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (248:28): [True: 751k, False: 187k]
  ------------------
  249|   751k|                {
  250|   751k|                    WORD32 itrans_out;
  251|   751k|                    itrans_out =
  252|   751k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   751k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   751k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 751k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 751k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|   751k|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   751k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 69.5k, False: 682k]
  |  |  |  Branch (40:53): [True: 58.3k, False: 623k]
  |  |  ------------------
  ------------------
  254|   751k|                    itrans_out =
  255|   751k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|   751k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   751k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 751k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 751k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|   751k|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|   751k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 81.4k, False: 670k]
  |  |  |  Branch (40:53): [True: 47.6k, False: 622k]
  |  |  ------------------
  ------------------
  257|   751k|                }
  258|   187k|                pi2_tmp++;
  259|   187k|                pu2_pred += pred_strd;
  260|   187k|                pu2_dst += dst_strd;
  261|   187k|            }
  262|  23.4k|        }
  263|       |        /************************************************************************************************/
  264|       |        /************************************END - IT_RECON_8x8******************************************/
  265|       |        /************************************************************************************************/
  266|   131k|    }
  267|  85.6k|    else /* All rows of input are non-zero */
  268|  85.6k|    {
  269|       |        /************************************************************************************************/
  270|       |        /**********************************START - IT_RECON_8x8******************************************/
  271|       |        /************************************************************************************************/
  272|       |
  273|       |        /* Inverse Transform 1st stage */
  274|  85.6k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  85.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  275|  85.6k|        add = 1 << (shift - 1);
  276|       |
  277|   689k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (277:20): [True: 603k, False: 85.6k]
  ------------------
  278|   603k|        {
  279|       |            /* Checking for Zero Cols */
  280|   603k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (280:16): [True: 214k, False: 388k]
  ------------------
  281|   214k|            {
  282|   214k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  283|   214k|            }
  284|   388k|            else
  285|   388k|            {
  286|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  287|  1.94M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (287:28): [True: 1.55M, False: 388k]
  ------------------
  288|  1.55M|                {
  289|  1.55M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  290|  1.55M|                                    + g_ai2_ihevc_trans_8[3][k]
  291|  1.55M|                                                    * pi2_src[3 * src_strd]
  292|  1.55M|                                    + g_ai2_ihevc_trans_8[5][k]
  293|  1.55M|                                                    * pi2_src[5 * src_strd]
  294|  1.55M|                                    + g_ai2_ihevc_trans_8[7][k]
  295|  1.55M|                                                    * pi2_src[7 * src_strd];
  296|  1.55M|                }
  297|       |
  298|   388k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  299|   388k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  300|   388k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  301|   388k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  302|   388k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  303|   388k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  304|   388k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  305|   388k|                                + 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|   388k|                e[0] = ee[0] + eo[0];
  309|   388k|                e[3] = ee[0] - eo[0];
  310|   388k|                e[1] = ee[1] + eo[1];
  311|   388k|                e[2] = ee[1] - eo[1];
  312|  1.94M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (312:28): [True: 1.55M, False: 388k]
  ------------------
  313|  1.55M|                {
  314|  1.55M|                    pi2_tmp[k] =
  315|  1.55M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  1.55M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.55k, False: 1.55M]
  |  |  |  |  |  Branch (40:53): [True: 525, False: 1.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  1.55M|                    pi2_tmp[k + 4] =
  317|  1.55M|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift) );
  ------------------
  |  |   53|  1.55M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 472, False: 1.55M]
  |  |  |  |  |  Branch (40:53): [True: 553, False: 1.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  1.55M|                }
  319|   388k|            }
  320|   603k|            pi2_src++;
  321|   603k|            pi2_tmp += trans_size;
  322|   603k|            zero_cols = zero_cols >> 1;
  323|   603k|        }
  324|       |
  325|  85.6k|        pi2_tmp = pi2_tmp_orig;
  326|       |
  327|       |        /* Inverse Transform 2nd stage */
  328|  85.6k|        shift = 20 - u1_bit_depth;
  329|  85.6k|        add = 1 << (shift - 1);
  330|  85.6k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (330:12): [True: 20.4k, False: 65.2k]
  ------------------
  331|  20.4k|        {
  332|   183k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (332:24): [True: 163k, False: 20.4k]
  ------------------
  333|   163k|            {
  334|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  335|   816k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (335:28): [True: 653k, False: 163k]
  ------------------
  336|   653k|                {
  337|   653k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  338|   653k|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  339|   653k|                }
  340|   163k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  341|   163k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  342|   163k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  343|   163k|                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|   163k|                e[0] = ee[0] + eo[0];
  347|   163k|                e[3] = ee[0] - eo[0];
  348|   163k|                e[1] = ee[1] + eo[1];
  349|   163k|                e[2] = ee[1] - eo[1];
  350|   816k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (350:28): [True: 653k, False: 163k]
  ------------------
  351|   653k|                {
  352|   653k|                    WORD32 itrans_out;
  353|   653k|                    itrans_out =
  354|   653k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   653k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   653k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 653k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 653k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|   653k|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   653k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 50.4k, False: 602k]
  |  |  |  Branch (40:53): [True: 33.7k, False: 568k]
  |  |  ------------------
  ------------------
  356|   653k|                    itrans_out =
  357|   653k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|   653k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   653k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 653k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 653k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|   653k|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|   653k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 48.1k, False: 604k]
  |  |  |  Branch (40:53): [True: 34.7k, False: 570k]
  |  |  ------------------
  ------------------
  359|   653k|                }
  360|   163k|                pi2_tmp++;
  361|   163k|                pu2_pred += pred_strd;
  362|   163k|                pu2_dst += dst_strd;
  363|   163k|            }
  364|  20.4k|        }
  365|  65.2k|        else /* All rows of output of 1st stage are non-zero */
  366|  65.2k|        {
  367|   587k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (367:24): [True: 521k, False: 65.2k]
  ------------------
  368|   521k|            {
  369|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  370|  2.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (370:28): [True: 2.08M, False: 521k]
  ------------------
  371|  2.08M|                {
  372|  2.08M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  373|  2.08M|                                    + g_ai2_ihevc_trans_8[3][k]
  374|  2.08M|                                                    * pi2_tmp[3 * trans_size]
  375|  2.08M|                                    + g_ai2_ihevc_trans_8[5][k]
  376|  2.08M|                                                    * pi2_tmp[5 * trans_size]
  377|  2.08M|                                    + g_ai2_ihevc_trans_8[7][k]
  378|  2.08M|                                                    * pi2_tmp[7 * trans_size];
  379|  2.08M|                }
  380|       |
  381|   521k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  382|   521k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  383|   521k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  384|   521k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  385|   521k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  386|   521k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  387|   521k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  388|   521k|                                + 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|   521k|                e[0] = ee[0] + eo[0];
  392|   521k|                e[3] = ee[0] - eo[0];
  393|   521k|                e[1] = ee[1] + eo[1];
  394|   521k|                e[2] = ee[1] - eo[1];
  395|  2.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (395:28): [True: 2.08M, False: 521k]
  ------------------
  396|  2.08M|                {
  397|  2.08M|                    WORD32 itrans_out;
  398|  2.08M|                    itrans_out =
  399|  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: 0, False: 2.08M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|  2.08M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  2.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 52.7k, False: 2.03M]
  |  |  |  Branch (40:53): [True: 24.0k, False: 2.01M]
  |  |  ------------------
  ------------------
  401|  2.08M|                    itrans_out =
  402|  2.08M|                                    CLIP_S16( ((e[3-k] - o[3-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: 0, False: 2.08M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  403|  2.08M|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|  2.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 44.8k, False: 2.04M]
  |  |  |  Branch (40:53): [True: 20.4k, False: 2.02M]
  |  |  ------------------
  ------------------
  404|  2.08M|                }
  405|   521k|                pi2_tmp++;
  406|   521k|                pu2_pred += pred_strd;
  407|   521k|                pu2_dst += dst_strd;
  408|   521k|            }
  409|  65.2k|        }
  410|       |        /************************************************************************************************/
  411|       |        /************************************END - IT_RECON_8x8******************************************/
  412|       |        /************************************************************************************************/
  413|  85.6k|    }
  414|   217k|}

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

ihevc_hbd_recon_4x4_ttype1:
  100|   404k|{
  101|   404k|    WORD32 i, j;
  102|   404k|    WORD32 trans_size;
  103|   404k|    WORD16 clip_limit;
  104|       |
  105|   404k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   404k|#define TRANS_SIZE_4   4
  ------------------
  106|   404k|    clip_limit = (1 << u1_bit_depth) - 1;
  107|       |
  108|       |    /* Reconstruction */
  109|       |
  110|  2.02M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (110:16): [True: 1.61M, False: 404k]
  ------------------
  111|  1.61M|    {
  112|       |        /* Checking for Zero Cols */
  113|  1.61M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (113:12): [True: 486k, False: 1.13M]
  ------------------
  114|   486k|        {
  115|  2.43M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (115:24): [True: 1.94M, False: 486k]
  ------------------
  116|  1.94M|            {
  117|  1.94M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  118|  1.94M|            }
  119|   486k|        }
  120|  1.13M|        else
  121|  1.13M|        {
  122|  5.65M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (122:24): [True: 4.52M, False: 1.13M]
  ------------------
  123|  4.52M|            {
  124|  4.52M|                pu2_dst[j * dst_strd] =
  125|  4.52M|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  4.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 202k, False: 4.32M]
  |  |  |  Branch (40:53): [True: 34.9k, False: 4.28M]
  |  |  ------------------
  ------------------
  126|  4.52M|            }
  127|  1.13M|        }
  128|  1.61M|        pi2_src++;
  129|  1.61M|        pu2_dst++;
  130|  1.61M|        pu2_pred++;
  131|  1.61M|        zero_cols = zero_cols >> 1;
  132|  1.61M|    }
  133|   404k|}
ihevc_hbd_recon_4x4:
  183|  3.37k|{
  184|  3.37k|    WORD32 i, j;
  185|  3.37k|    WORD32 trans_size;
  186|  3.37k|    WORD16 clip_limit;
  187|       |
  188|  3.37k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  3.37k|#define TRANS_SIZE_4   4
  ------------------
  189|  3.37k|    clip_limit = (1 << u1_bit_depth) - 1;
  190|       |
  191|       |    /* Reconstruction */
  192|       |
  193|  16.8k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (193:16): [True: 13.5k, False: 3.37k]
  ------------------
  194|  13.5k|    {
  195|       |        /* Checking for Zero Cols */
  196|  13.5k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (196:12): [True: 4.16k, False: 9.34k]
  ------------------
  197|  4.16k|        {
  198|  20.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (198:24): [True: 16.6k, False: 4.16k]
  ------------------
  199|  16.6k|            {
  200|  16.6k|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  201|  16.6k|            }
  202|  4.16k|        }
  203|  9.34k|        else
  204|  9.34k|        {
  205|  46.7k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (205:24): [True: 37.3k, False: 9.34k]
  ------------------
  206|  37.3k|            {
  207|  37.3k|                pu2_dst[j * dst_strd] =
  208|  37.3k|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  37.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.70k, False: 30.6k]
  |  |  |  Branch (40:53): [True: 6.58k, False: 24.0k]
  |  |  ------------------
  ------------------
  209|  37.3k|            }
  210|  9.34k|        }
  211|  13.5k|        pi2_src++;
  212|  13.5k|        pu2_dst++;
  213|  13.5k|        pu2_pred++;
  214|  13.5k|        zero_cols = zero_cols >> 1;
  215|  13.5k|    }
  216|  3.37k|}
ihevc_hbd_recon_8x8:
  266|  87.4k|{
  267|  87.4k|    WORD32 i, j;
  268|  87.4k|    WORD32 trans_size;
  269|  87.4k|    WORD16 clip_limit;
  270|       |
  271|  87.4k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  87.4k|#define TRANS_SIZE_8   8
  ------------------
  272|  87.4k|    clip_limit = (1 << u1_bit_depth) - 1;
  273|       |
  274|       |    /* Reconstruction */
  275|       |
  276|   785k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (276:16): [True: 698k, False: 87.4k]
  ------------------
  277|   698k|    {
  278|       |        /* Checking for Zero Cols */
  279|   698k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (279:12): [True: 458k, False: 240k]
  ------------------
  280|   458k|        {
  281|  4.12M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (281:24): [True: 3.66M, False: 458k]
  ------------------
  282|  3.66M|            {
  283|  3.66M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  284|  3.66M|            }
  285|   458k|        }
  286|   240k|        else
  287|   240k|        {
  288|  2.16M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (288:24): [True: 1.92M, False: 240k]
  ------------------
  289|  1.92M|            {
  290|  1.92M|                pu2_dst[j * dst_strd] =
  291|  1.92M|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  1.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 20.2k, False: 1.90M]
  |  |  |  Branch (40:53): [True: 10.4k, False: 1.89M]
  |  |  ------------------
  ------------------
  292|  1.92M|            }
  293|   240k|        }
  294|   698k|        pi2_src++;
  295|   698k|        pu2_dst++;
  296|   698k|        pu2_pred++;
  297|   698k|        zero_cols = zero_cols >> 1;
  298|   698k|    }
  299|  87.4k|}
ihevc_hbd_recon_16x16:
  349|  34.6k|{
  350|  34.6k|    WORD32 i, j;
  351|  34.6k|    WORD32 trans_size;
  352|  34.6k|    WORD16 clip_limit;
  353|       |
  354|  34.6k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  34.6k|#define TRANS_SIZE_16 16
  ------------------
  355|  34.6k|    clip_limit = (1 << u1_bit_depth) - 1;
  356|       |
  357|       |    /* Reconstruction */
  358|       |
  359|   588k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (359:16): [True: 553k, False: 34.6k]
  ------------------
  360|   553k|    {
  361|       |        /* Checking for Zero Cols */
  362|   553k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (362:12): [True: 460k, False: 93.3k]
  ------------------
  363|   460k|        {
  364|  7.82M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (364:24): [True: 7.36M, False: 460k]
  ------------------
  365|  7.36M|            {
  366|  7.36M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  367|  7.36M|            }
  368|   460k|        }
  369|  93.3k|        else
  370|  93.3k|        {
  371|  1.58M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (371:24): [True: 1.49M, False: 93.3k]
  ------------------
  372|  1.49M|            {
  373|  1.49M|                pu2_dst[j * dst_strd] =
  374|  1.49M|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  1.49M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.37k, False: 1.48M]
  |  |  |  Branch (40:53): [True: 7.75k, False: 1.48M]
  |  |  ------------------
  ------------------
  375|  1.49M|            }
  376|  93.3k|        }
  377|   553k|        pi2_src++;
  378|   553k|        pu2_dst++;
  379|   553k|        pu2_pred++;
  380|   553k|        zero_cols = zero_cols >> 1;
  381|   553k|    }
  382|  34.6k|}
ihevc_hbd_recon_32x32:
  432|  59.1k|{
  433|  59.1k|    WORD32 i, j;
  434|  59.1k|    WORD32 trans_size;
  435|  59.1k|    WORD16 clip_limit;
  436|       |
  437|  59.1k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|  59.1k|#define TRANS_SIZE_32 32
  ------------------
  438|  59.1k|    clip_limit = (1 << u1_bit_depth) - 1;
  439|       |
  440|       |    /* Reconstruction */
  441|       |
  442|  1.93M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (442:16): [True: 1.87M, False: 59.1k]
  ------------------
  443|  1.87M|    {
  444|       |        /* Checking for Zero Cols */
  445|  1.87M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (445:12): [True: 1.67M, False: 200k]
  ------------------
  446|  1.67M|        {
  447|  55.1M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (447:24): [True: 53.4M, False: 1.67M]
  ------------------
  448|  53.4M|            {
  449|  53.4M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  450|  53.4M|            }
  451|  1.67M|        }
  452|   200k|        else
  453|   200k|        {
  454|  6.68M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (454:24): [True: 6.48M, False: 200k]
  ------------------
  455|  6.48M|            {
  456|  6.48M|                pu2_dst[j * dst_strd] =
  457|  6.48M|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  6.48M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 38.6k, False: 6.44M]
  |  |  |  Branch (40:53): [True: 42.8k, False: 6.40M]
  |  |  ------------------
  ------------------
  458|  6.48M|            }
  459|   200k|        }
  460|  1.87M|        pi2_src++;
  461|  1.87M|        pu2_dst++;
  462|  1.87M|        pu2_pred++;
  463|  1.87M|        zero_cols = zero_cols >> 1;
  464|  1.87M|    }
  465|  59.1k|}

ihevc_hbd_sao_band_offset_luma:
   72|   441k|{
   73|   441k|    WORD32 band_shift;
   74|   441k|    WORD32 band_table[NUM_BAND_TABLE];
   75|   441k|    WORD32 i;
   76|   441k|    WORD32 row, col;
   77|       |
   78|       |    /* Updating left and top and top-left */
   79|  12.5M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (79:18): [True: 12.1M, False: 441k]
  ------------------
   80|  12.1M|    {
   81|  12.1M|        pu2_src_left[row] = pu2_src[row * src_strd + (wd - 1)];
   82|  12.1M|    }
   83|   441k|    pu2_src_top_left[0] = pu2_src_top[wd - 1];
   84|  12.5M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (84:18): [True: 12.0M, False: 441k]
  ------------------
   85|  12.0M|    {
   86|  12.0M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
   87|  12.0M|    }
   88|       |
   89|   441k|    band_shift = u4_bit_depth - 5;
   90|  14.5M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   47|  14.5M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (90:16): [True: 14.1M, False: 441k]
  ------------------
   91|  14.1M|    {
   92|  14.1M|        band_table[i] = 0;
   93|  14.1M|    }
   94|  2.20M|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (94:16): [True: 1.76M, False: 441k]
  ------------------
   95|  1.76M|    {
   96|  1.76M|        band_table[(i + sao_band_pos) & 31] = i + 1;
   97|  1.76M|    }
   98|       |
   99|  12.2M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (99:18): [True: 11.8M, False: 441k]
  ------------------
  100|  11.8M|    {
  101|   357M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (101:22): [True: 345M, False: 11.8M]
  ------------------
  102|   345M|        {
  103|   345M|            WORD32 band_idx;
  104|   345M|            WORD32 idx = pu2_src[col] >> band_shift;
  105|       |
  106|   345M|            band_idx = (idx < NUM_BAND_TABLE) ? band_table[idx] : 0;
  ------------------
  |  |   47|   345M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (106:24): [True: 345M, False: 2.69k]
  ------------------
  107|   345M|            pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|   345M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 110k, False: 345M]
  |  |  |  Branch (40:53): [True: 335k, False: 345M]
  |  |  ------------------
  ------------------
  108|   345M|        }
  109|  11.8M|        pu2_src += src_strd;
  110|  11.8M|    }
  111|   441k|}
ihevc_hbd_sao_band_offset_chroma:
  125|   375k|{
  126|   375k|    WORD32 band_shift;
  127|   375k|    WORD32 band_table_u[NUM_BAND_TABLE];
  128|   375k|    WORD32 band_table_v[NUM_BAND_TABLE];
  129|   375k|    WORD32 i;
  130|   375k|    WORD32 row, col;
  131|       |
  132|       |    /* Updating left and top and top-left */
  133|  10.9M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (133:18): [True: 10.6M, False: 375k]
  ------------------
  134|  10.6M|    {
  135|  10.6M|        pu2_src_left[2 * row] = pu2_src[row * src_strd + (wd - 2)];
  136|  10.6M|        pu2_src_left[2 * row + 1] = pu2_src[row * src_strd + (wd - 1)];
  137|  10.6M|    }
  138|   375k|    pu2_src_top_left[0] = pu2_src_top[wd - 2];
  139|   375k|    pu2_src_top_left[1] = pu2_src_top[wd - 1];
  140|  11.6M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (140:18): [True: 11.2M, False: 375k]
  ------------------
  141|  11.2M|    {
  142|  11.2M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
  143|  11.2M|    }
  144|       |
  145|   375k|    band_shift = u4_bit_depth - 5;
  146|  12.4M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   47|  12.4M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (146:16): [True: 12.0M, False: 375k]
  ------------------
  147|  12.0M|    {
  148|  12.0M|        band_table_u[i] = 0;
  149|  12.0M|        band_table_v[i] = 0;
  150|  12.0M|    }
  151|  1.87M|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (151:16): [True: 1.50M, False: 375k]
  ------------------
  152|  1.50M|    {
  153|  1.50M|        band_table_u[(i + sao_band_pos_u) & 31] = i + 1;
  154|  1.50M|        band_table_v[(i + sao_band_pos_v) & 31] = i + 1;
  155|  1.50M|    }
  156|       |
  157|  10.8M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (157:18): [True: 10.4M, False: 375k]
  ------------------
  158|  10.4M|    {
  159|   328M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (159:22): [True: 318M, False: 10.4M]
  ------------------
  160|   318M|        {
  161|   318M|            WORD32 band_idx;
  162|   318M|            WORD8 *pi1_sao_offset;
  163|   318M|            WORD32 idx = pu2_src[col] >> band_shift;
  164|       |
  165|   318M|            pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (165:30): [True: 159M, False: 159M]
  ------------------
  166|   318M|            if(idx < NUM_BAND_TABLE)
  ------------------
  |  |   47|   318M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (166:16): [True: 317M, False: 839k]
  ------------------
  167|   317M|            {
  168|   317M|                band_idx = (0 == col % 2) ? band_table_u[idx] : band_table_v[idx];
  ------------------
  |  Branch (168:28): [True: 158M, False: 158M]
  ------------------
  169|   317M|            }
  170|   839k|            else
  171|   839k|            {
  172|   839k|                band_idx = 0;
  173|   839k|            }
  174|   318M|            pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|   318M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 886k, False: 317M]
  |  |  |  Branch (40:53): [True: 80.8k, False: 317M]
  |  |  ------------------
  ------------------
  175|   318M|        }
  176|  10.4M|        pu2_src += src_strd;
  177|  10.4M|    }
  178|   375k|}
ihevc_hbd_sao_edge_offset_class0:
  192|   102k|{
  193|   102k|    WORD32 row, col;
  194|   102k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  195|   102k|    UWORD16 au2_src_left_tmp[MAX_CTB_SIZE];
  196|   102k|    WORD8 u1_sign_left, u1_sign_right;
  197|       |
  198|       |    /* Initialize the mask values */
  199|   102k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|   102k|#define MAX_CTB_SIZE        64
  ------------------
  200|       |
  201|       |    /* Update top and top-left arrays */
  202|   102k|    *pu2_src_top_left = pu2_src_top[wd - 1];
  203|  2.59M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (203:18): [True: 2.49M, False: 102k]
  ------------------
  204|  2.49M|    {
  205|  2.49M|        au2_src_left_tmp[row] = pu2_src[row * src_strd + wd - 1];
  206|  2.49M|    }
  207|  2.59M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (207:18): [True: 2.49M, False: 102k]
  ------------------
  208|  2.49M|    {
  209|  2.49M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
  210|  2.49M|    }
  211|       |
  212|       |    /* Update masks based on the availability flags */
  213|   102k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (213:8): [True: 11.2k, False: 91.4k]
  ------------------
  214|  11.2k|    {
  215|  11.2k|        au1_mask[0] = 0;
  216|  11.2k|    }
  217|   102k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (217:8): [True: 7.41k, False: 95.1k]
  ------------------
  218|  7.41k|    {
  219|  7.41k|        au1_mask[wd - 1] = 0;
  220|  7.41k|    }
  221|       |
  222|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  223|   102k|    {
  224|  2.57M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (224:22): [True: 2.46M, False: 102k]
  ------------------
  225|  2.46M|        {
  226|  2.46M|            u1_sign_left = SIGN(pu2_src[0] - pu2_src_left[row]);
  ------------------
  |  |   44|  2.46M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.80M, False: 661k]
  |  |  |  Branch (44:34): [True: 794k, False: 1.01M]
  |  |  ------------------
  ------------------
  227|  69.7M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (227:26): [True: 67.3M, False: 2.46M]
  ------------------
  228|  67.3M|            {
  229|  67.3M|                WORD32 edge_idx;
  230|       |
  231|  67.3M|                u1_sign_right = SIGN(pu2_src[col] - pu2_src[col + 1]);
  ------------------
  |  |   44|  67.3M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 50.3M, False: 16.9M]
  |  |  |  Branch (44:34): [True: 14.2M, False: 36.0M]
  |  |  ------------------
  ------------------
  232|  67.3M|                edge_idx = 2 + u1_sign_left + u1_sign_right;
  233|  67.3M|                u1_sign_left = -u1_sign_right;
  234|       |
  235|  67.3M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
  236|       |
  237|  67.3M|                if(0 != edge_idx)
  ------------------
  |  Branch (237:20): [True: 10.2M, False: 57.0M]
  ------------------
  238|  10.2M|                {
  239|  10.2M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  10.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.50k, False: 10.2M]
  |  |  |  Branch (40:53): [True: 2.73k, False: 10.2M]
  |  |  ------------------
  ------------------
  240|  10.2M|                }
  241|  67.3M|            }
  242|       |
  243|  2.46M|            pu2_src += src_strd;
  244|  2.46M|        }
  245|   102k|    }
  246|       |
  247|       |    /* Update left array */
  248|  2.60M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (248:18): [True: 2.49M, False: 102k]
  ------------------
  249|  2.49M|    {
  250|  2.49M|        pu2_src_left[row] = au2_src_left_tmp[row];
  251|  2.49M|    }
  252|   102k|}
ihevc_hbd_sao_edge_offset_class0_chroma:
  267|  88.1k|{
  268|  88.1k|    WORD32 row, col;
  269|  88.1k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  270|  88.1k|    UWORD16 au2_src_left_tmp[2 * MAX_CTB_SIZE];
  271|  88.1k|    WORD8 u1_sign_left_u, u1_sign_right_u;
  272|  88.1k|    WORD8 u1_sign_left_v, u1_sign_right_v;
  273|       |
  274|       |    /* Initialize the mask values */
  275|  88.1k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  88.1k|#define MAX_CTB_SIZE        64
  ------------------
  276|       |
  277|       |    /* Update left, top and top-left arrays */
  278|  88.1k|    pu2_src_top_left[0] = pu2_src_top[wd - 2];
  279|  88.1k|    pu2_src_top_left[1] = pu2_src_top[wd - 1];
  280|  2.55M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (280:18): [True: 2.47M, False: 88.1k]
  ------------------
  281|  2.47M|    {
  282|  2.47M|        au2_src_left_tmp[2 * row] = pu2_src[row * src_strd + wd - 2];
  283|  2.47M|        au2_src_left_tmp[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
  284|  2.47M|    }
  285|  2.75M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (285:18): [True: 2.67M, False: 88.1k]
  ------------------
  286|  2.67M|    {
  287|  2.67M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
  288|  2.67M|    }
  289|       |
  290|       |    /* Update masks based on the availability flags */
  291|  88.1k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (291:8): [True: 6.49k, False: 81.6k]
  ------------------
  292|  6.49k|    {
  293|  6.49k|        au1_mask[0] = 0;
  294|  6.49k|    }
  295|  88.1k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (295:8): [True: 3.41k, False: 84.6k]
  ------------------
  296|  3.41k|    {
  297|  3.41k|        au1_mask[(wd - 1) >> 1] = 0;
  298|  3.41k|    }
  299|       |
  300|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  301|  88.1k|    {
  302|  2.55M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (302:22): [True: 2.46M, False: 88.1k]
  ------------------
  303|  2.46M|        {
  304|  2.46M|            u1_sign_left_u = SIGN(pu2_src[0] - pu2_src_left[2 * row]);
  ------------------
  |  |   44|  2.46M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.21M, False: 249k]
  |  |  |  Branch (44:34): [True: 227k, False: 1.98M]
  |  |  ------------------
  ------------------
  305|  2.46M|            u1_sign_left_v = SIGN(pu2_src[1] - pu2_src_left[2 * row + 1]);
  ------------------
  |  |   44|  2.46M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.25M, False: 207k]
  |  |  |  Branch (44:34): [True: 267k, False: 1.99M]
  |  |  ------------------
  ------------------
  306|  79.5M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (306:26): [True: 77.0M, False: 2.46M]
  ------------------
  307|  77.0M|            {
  308|  77.0M|                WORD32 edge_idx;
  309|  77.0M|                WORD8 *pi1_sao_offset;
  310|       |
  311|  77.0M|                if(0 == col % 2)
  ------------------
  |  Branch (311:20): [True: 38.5M, False: 38.5M]
  ------------------
  312|  38.5M|                {
  313|  38.5M|                    pi1_sao_offset = pi1_sao_offset_u;
  314|  38.5M|                    u1_sign_right_u = SIGN(pu2_src[col] - pu2_src[col + 2]);
  ------------------
  |  |   44|  38.5M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.4M, False: 2.05M]
  |  |  |  Branch (44:34): [True: 2.53M, False: 33.9M]
  |  |  ------------------
  ------------------
  315|  38.5M|                    edge_idx = 2 + u1_sign_left_u + u1_sign_right_u;
  316|  38.5M|                    u1_sign_left_u = -u1_sign_right_u;
  317|  38.5M|                }
  318|  38.5M|                else
  319|  38.5M|                {
  320|  38.5M|                    pi1_sao_offset = pi1_sao_offset_v;
  321|  38.5M|                    u1_sign_right_v = SIGN(pu2_src[col] - pu2_src[col + 2]);
  ------------------
  |  |   44|  38.5M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.2M, False: 2.30M]
  |  |  |  Branch (44:34): [True: 2.38M, False: 33.8M]
  |  |  ------------------
  ------------------
  322|  38.5M|                    edge_idx = 2 + u1_sign_left_v + u1_sign_right_v;
  323|  38.5M|                    u1_sign_left_v = -u1_sign_right_v;
  324|  38.5M|                }
  325|       |
  326|  77.0M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  327|       |
  328|  77.0M|                if(0 != edge_idx)
  ------------------
  |  Branch (328:20): [True: 4.70M, False: 72.3M]
  ------------------
  329|  4.70M|                {
  330|  4.70M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  4.70M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 34.8k, False: 4.67M]
  |  |  |  Branch (40:53): [True: 3.73k, False: 4.67M]
  |  |  ------------------
  ------------------
  331|  4.70M|                }
  332|  77.0M|            }
  333|       |
  334|  2.46M|            pu2_src += src_strd;
  335|  2.46M|        }
  336|  88.1k|    }
  337|       |
  338|  5.03M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (338:18): [True: 4.94M, False: 88.1k]
  ------------------
  339|  4.94M|    {
  340|  4.94M|        pu2_src_left[row] = au2_src_left_tmp[row];
  341|  4.94M|    }
  342|  88.1k|}
ihevc_hbd_sao_edge_offset_class1:
  356|  64.7k|{
  357|  64.7k|    WORD32 row, col;
  358|  64.7k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  359|  64.7k|    UWORD16 au2_src_top_tmp[MAX_CTB_SIZE];
  360|  64.7k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  361|  64.7k|    WORD8 u1_sign_down;
  362|       |
  363|       |    /* Initialize the mask values */
  364|  64.7k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  64.7k|#define MAX_CTB_SIZE        64
  ------------------
  365|       |
  366|       |    /* Update left, top and top-left arrays */
  367|  64.7k|    *pu2_src_top_left = pu2_src_top[wd - 1];
  368|  1.93M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (368:18): [True: 1.86M, False: 64.7k]
  ------------------
  369|  1.86M|    {
  370|  1.86M|        pu2_src_left[row] = pu2_src[row * src_strd + wd - 1];
  371|  1.86M|    }
  372|  1.94M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (372:18): [True: 1.87M, False: 64.7k]
  ------------------
  373|  1.87M|    {
  374|  1.87M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  375|  1.87M|    }
  376|       |
  377|       |    /* Update height and source pointers based on the availability flags */
  378|  64.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (378:8): [True: 16.7k, False: 48.0k]
  ------------------
  379|  16.7k|    {
  380|  16.7k|        pu2_src += src_strd;
  381|  16.7k|        ht--;
  382|   532k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (382:22): [True: 515k, False: 16.7k]
  ------------------
  383|   515k|        {
  384|   515k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - src_strd]);
  ------------------
  |  |   44|   515k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 408k, False: 107k]
  |  |  |  Branch (44:34): [True: 52.7k, False: 355k]
  |  |  ------------------
  ------------------
  385|   515k|        }
  386|  16.7k|    }
  387|  48.0k|    else
  388|  48.0k|    {
  389|  1.41M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (389:22): [True: 1.36M, False: 48.0k]
  ------------------
  390|  1.36M|        {
  391|  1.36M|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col]);
  ------------------
  |  |   44|  1.36M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 935k, False: 427k]
  |  |  |  Branch (44:34): [True: 422k, False: 513k]
  |  |  ------------------
  ------------------
  392|  1.36M|        }
  393|  48.0k|    }
  394|  64.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (394:8): [True: 1.09k, False: 63.6k]
  ------------------
  395|  1.09k|    {
  396|  1.09k|        ht--;
  397|  1.09k|    }
  398|       |
  399|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  400|  64.7k|    {
  401|  1.90M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (401:22): [True: 1.84M, False: 64.7k]
  ------------------
  402|  1.84M|        {
  403|  58.6M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (403:26): [True: 56.8M, False: 1.84M]
  ------------------
  404|  56.8M|            {
  405|  56.8M|                WORD32 edge_idx;
  406|       |
  407|  56.8M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + src_strd]);
  ------------------
  |  |   44|  56.8M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 42.9M, False: 13.8M]
  |  |  |  Branch (44:34): [True: 16.0M, False: 26.9M]
  |  |  ------------------
  ------------------
  408|  56.8M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  409|  56.8M|                au1_sign_up[col] = -u1_sign_down;
  410|       |
  411|  56.8M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
  412|       |
  413|  56.8M|                if(0 != edge_idx)
  ------------------
  |  Branch (413:20): [True: 8.12M, False: 48.7M]
  ------------------
  414|  8.12M|                {
  415|  8.12M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  8.12M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.51k, False: 8.12M]
  |  |  |  Branch (40:53): [True: 682, False: 8.12M]
  |  |  ------------------
  ------------------
  416|  8.12M|                }
  417|  56.8M|            }
  418|       |
  419|  1.84M|            pu2_src += src_strd;
  420|  1.84M|        }
  421|  64.7k|    }
  422|       |
  423|  1.94M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (423:18): [True: 1.87M, False: 64.7k]
  ------------------
  424|  1.87M|    {
  425|  1.87M|        pu2_src_top[col] = au2_src_top_tmp[col];
  426|  1.87M|    }
  427|  64.7k|}
ihevc_hbd_sao_edge_offset_class1_chroma:
  442|  53.8k|{
  443|  53.8k|    WORD32 row, col;
  444|  53.8k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  445|  53.8k|    UWORD16 au2_src_top_tmp[2 * MAX_CTB_SIZE];
  446|  53.8k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
  447|  53.8k|    WORD8 u1_sign_down;
  448|       |
  449|       |    /* Initialize the mask values */
  450|  53.8k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  53.8k|#define MAX_CTB_SIZE        64
  ------------------
  451|       |
  452|       |    /* Update left, top and top-left arrays */
  453|  53.8k|    pu2_src_top_left[0] = pu2_src_top[wd - 2];
  454|  53.8k|    pu2_src_top_left[1] = pu2_src_top[wd - 1];
  455|  1.44M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (455:18): [True: 1.39M, False: 53.8k]
  ------------------
  456|  1.39M|    {
  457|  1.39M|        pu2_src_left[2 * row] = pu2_src[row * src_strd + wd - 2];
  458|  1.39M|        pu2_src_left[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
  459|  1.39M|    }
  460|  1.62M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (460:18): [True: 1.57M, False: 53.8k]
  ------------------
  461|  1.57M|    {
  462|  1.57M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  463|  1.57M|    }
  464|       |
  465|       |    /* Update height and source pointers based on the availability flags */
  466|  53.8k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (466:8): [True: 9.87k, False: 43.9k]
  ------------------
  467|  9.87k|    {
  468|  9.87k|        pu2_src += src_strd;
  469|  9.87k|        ht--;
  470|   312k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (470:22): [True: 303k, False: 9.87k]
  ------------------
  471|   303k|        {
  472|   303k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - src_strd]);
  ------------------
  |  |   44|   303k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 292k, False: 10.7k]
  |  |  |  Branch (44:34): [True: 7.50k, False: 284k]
  |  |  ------------------
  ------------------
  473|   303k|        }
  474|  9.87k|    }
  475|  43.9k|    else
  476|  43.9k|    {
  477|  1.31M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (477:22): [True: 1.26M, False: 43.9k]
  ------------------
  478|  1.26M|        {
  479|  1.26M|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col]);
  ------------------
  |  |   44|  1.26M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.12M, False: 143k]
  |  |  |  Branch (44:34): [True: 136k, False: 989k]
  |  |  ------------------
  ------------------
  480|  1.26M|        }
  481|  43.9k|    }
  482|  53.8k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (482:8): [True: 773, False: 53.0k]
  ------------------
  483|    773|    {
  484|    773|        ht--;
  485|    773|    }
  486|       |
  487|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  488|  53.8k|    {
  489|  1.43M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (489:22): [True: 1.38M, False: 53.8k]
  ------------------
  490|  1.38M|        {
  491|  44.1M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (491:26): [True: 42.7M, False: 1.38M]
  ------------------
  492|  42.7M|            {
  493|  42.7M|                WORD32 edge_idx;
  494|  42.7M|                WORD8 *pi1_sao_offset;
  495|       |
  496|  42.7M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (496:34): [True: 21.3M, False: 21.3M]
  ------------------
  497|       |
  498|  42.7M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + src_strd]);
  ------------------
  |  |   44|  42.7M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 39.5M, False: 3.16M]
  |  |  |  Branch (44:34): [True: 2.94M, False: 36.6M]
  |  |  ------------------
  ------------------
  499|  42.7M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  500|  42.7M|                au1_sign_up[col] = -u1_sign_down;
  501|       |
  502|  42.7M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  503|       |
  504|  42.7M|                if(0 != edge_idx)
  ------------------
  |  Branch (504:20): [True: 3.73M, False: 38.9M]
  ------------------
  505|  3.73M|                {
  506|  3.73M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  3.73M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 55.3k, False: 3.67M]
  |  |  |  Branch (40:53): [True: 1.84k, False: 3.67M]
  |  |  ------------------
  ------------------
  507|  3.73M|                }
  508|  42.7M|            }
  509|       |
  510|  1.38M|            pu2_src += src_strd;
  511|  1.38M|        }
  512|  53.8k|    }
  513|       |
  514|  1.62M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (514:18): [True: 1.57M, False: 53.8k]
  ------------------
  515|  1.57M|    {
  516|  1.57M|        pu2_src_top[col] = au2_src_top_tmp[col];
  517|  1.57M|    }
  518|  53.8k|}
ihevc_hbd_sao_edge_offset_class2:
  532|  62.7k|{
  533|  62.7k|    WORD32 row, col;
  534|  62.7k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  535|  62.7k|    UWORD16 au2_src_left_tmp[MAX_CTB_SIZE], au2_src_top_tmp[MAX_CTB_SIZE];
  536|  62.7k|    UWORD16 u2_src_top_left_tmp;
  537|  62.7k|    WORD8 au1_sign_up[MAX_CTB_SIZE + 1], au1_sign_up_tmp[MAX_CTB_SIZE + 1];
  538|  62.7k|    WORD8 u1_sign_down;
  539|  62.7k|    WORD8 *pu1_sign_up;
  540|  62.7k|    WORD8 *pu1_sign_up_tmp;
  541|  62.7k|    UWORD16 *pu2_src_left_cpy;
  542|       |
  543|  62.7k|    UWORD16 u2_pos_0_0_tmp;
  544|  62.7k|    UWORD16 u2_pos_wd_ht_tmp;
  545|       |
  546|  62.7k|    pu1_sign_up = au1_sign_up;
  547|  62.7k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  548|  62.7k|    pu2_src_left_cpy = pu2_src_left;
  549|       |
  550|       |    /* Initialize the mask values */
  551|  62.7k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  62.7k|#define MAX_CTB_SIZE        64
  ------------------
  552|       |
  553|       |    /* Update left, top and top-left arrays */
  554|  62.7k|    u2_src_top_left_tmp = pu2_src_top[wd - 1];
  555|  1.74M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (555:18): [True: 1.68M, False: 62.7k]
  ------------------
  556|  1.68M|    {
  557|  1.68M|        au2_src_left_tmp[row] = pu2_src[row * src_strd + wd - 1];
  558|  1.68M|    }
  559|  1.76M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (559:18): [True: 1.69M, False: 62.7k]
  ------------------
  560|  1.69M|    {
  561|  1.69M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  562|  1.69M|    }
  563|       |
  564|       |    /* If top-left is available, process separately */
  565|  62.7k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (565:8): [True: 44.7k, False: 18.0k]
  ------------------
  566|  44.7k|    {
  567|  44.7k|        WORD32 edge_idx;
  568|       |
  569|  44.7k|        edge_idx = 2 + SIGN(pu2_src[0] - pu2_src_top_left[0]) +
  ------------------
  |  |   44|  44.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 32.8k, False: 11.8k]
  |  |  |  Branch (44:34): [True: 18.3k, False: 14.4k]
  |  |  ------------------
  ------------------
  570|  44.7k|                        SIGN(pu2_src[0] - pu2_src[1 + src_strd]);
  ------------------
  |  |   44|  44.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 30.8k, False: 13.8k]
  |  |  |  Branch (44:34): [True: 12.9k, False: 17.8k]
  |  |  ------------------
  ------------------
  571|       |
  572|  44.7k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  573|       |
  574|  44.7k|        if(0 != edge_idx)
  ------------------
  |  Branch (574:12): [True: 13.4k, False: 31.2k]
  ------------------
  575|  13.4k|        {
  576|  13.4k|            u2_pos_0_0_tmp = CLIP3(pu2_src[0] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  13.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 37, False: 13.4k]
  |  |  |  Branch (40:53): [True: 124, False: 13.3k]
  |  |  ------------------
  ------------------
  577|  13.4k|        }
  578|  31.2k|        else
  579|  31.2k|        {
  580|  31.2k|            u2_pos_0_0_tmp = pu2_src[0];
  581|  31.2k|        }
  582|  44.7k|    }
  583|  18.0k|    else
  584|  18.0k|    {
  585|  18.0k|        u2_pos_0_0_tmp = pu2_src[0];
  586|  18.0k|    }
  587|       |
  588|       |    /* If bottom-right is available, process separately */
  589|  62.7k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (589:8): [True: 59.2k, False: 3.44k]
  ------------------
  590|  59.2k|    {
  591|  59.2k|        WORD32 edge_idx;
  592|       |
  593|  59.2k|        edge_idx = 2 + SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd- 1 - src_strd]) +
  ------------------
  |  |   44|  59.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 45.8k, False: 13.4k]
  |  |  |  Branch (44:34): [True: 22.0k, False: 23.8k]
  |  |  ------------------
  ------------------
  594|  59.2k|                        SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd + 1 + src_strd]);
  ------------------
  |  |   44|  59.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.1k, False: 23.1k]
  |  |  |  Branch (44:34): [True: 18.7k, False: 17.4k]
  |  |  ------------------
  ------------------
  595|       |
  596|  59.2k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  597|       |
  598|  59.2k|        if(0 != edge_idx)
  ------------------
  |  Branch (598:12): [True: 19.7k, False: 39.5k]
  ------------------
  599|  19.7k|        {
  600|  19.7k|            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|  19.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 73, False: 19.6k]
  |  |  |  Branch (40:53): [True: 114, False: 19.5k]
  |  |  ------------------
  ------------------
  601|  19.7k|        }
  602|  39.5k|        else
  603|  39.5k|        {
  604|  39.5k|            u2_pos_wd_ht_tmp = pu2_src[wd - 1 + (ht - 1) * src_strd];
  605|  39.5k|        }
  606|  59.2k|    }
  607|  3.44k|    else
  608|  3.44k|    {
  609|  3.44k|        u2_pos_wd_ht_tmp = pu2_src[wd - 1 + (ht - 1) * src_strd];
  610|  3.44k|    }
  611|       |
  612|       |    /* If Left is not available */
  613|  62.7k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (613:8): [True: 5.02k, False: 57.7k]
  ------------------
  614|  5.02k|    {
  615|  5.02k|        au1_mask[0] = 0;
  616|  5.02k|    }
  617|       |
  618|       |    /* If Top is not available */
  619|  62.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (619:8): [True: 13.9k, False: 48.7k]
  ------------------
  620|  13.9k|    {
  621|  13.9k|        pu2_src += src_strd;
  622|  13.9k|        ht--;
  623|  13.9k|        pu2_src_left_cpy += 1;
  624|   416k|        for(col = 1;col < wd; col++)
  ------------------
  |  Branch (624:21): [True: 402k, False: 13.9k]
  ------------------
  625|   402k|        {
  626|   402k|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - 1 - src_strd]);
  ------------------
  |  |   44|   402k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 256k, False: 146k]
  |  |  |  Branch (44:34): [True: 102k, False: 154k]
  |  |  ------------------
  ------------------
  627|   402k|        }
  628|  13.9k|    }
  629|  48.7k|    else
  630|  48.7k|    {
  631|  1.27M|        for(col = 1;col < wd; col++)
  ------------------
  |  Branch (631:21): [True: 1.23M, False: 48.7k]
  ------------------
  632|  1.23M|        {
  633|  1.23M|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col - 1]);
  ------------------
  |  |   44|  1.23M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 884k, False: 347k]
  |  |  |  Branch (44:34): [True: 432k, False: 451k]
  |  |  ------------------
  ------------------
  634|  1.23M|        }
  635|  48.7k|    }
  636|       |
  637|       |    /* If Right is not available */
  638|  62.7k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (638:8): [True: 2.60k, False: 60.1k]
  ------------------
  639|  2.60k|    {
  640|  2.60k|        au1_mask[wd - 1] = 0;
  641|  2.60k|    }
  642|       |
  643|       |    /* If Bottom is not available */
  644|  62.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (644:8): [True: 960, False: 61.7k]
  ------------------
  645|    960|    {
  646|    960|        ht--;
  647|    960|    }
  648|       |
  649|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  650|  62.7k|    {
  651|  1.71M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (651:22): [True: 1.65M, False: 62.7k]
  ------------------
  652|  1.65M|        {
  653|  1.65M|            pu1_sign_up[0] = SIGN(pu2_src[0] - pu2_src_left_cpy[row - 1]);
  ------------------
  |  |   44|  1.65M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.16M, False: 496k]
  |  |  |  Branch (44:34): [True: 638k, False: 521k]
  |  |  ------------------
  ------------------
  654|  51.4M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (654:26): [True: 49.7M, False: 1.65M]
  ------------------
  655|  49.7M|            {
  656|  49.7M|                WORD32 edge_idx;
  657|       |
  658|  49.7M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + 1 + src_strd]);
  ------------------
  |  |   44|  49.7M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.5M, False: 15.1M]
  |  |  |  Branch (44:34): [True: 14.6M, False: 19.8M]
  |  |  ------------------
  ------------------
  659|  49.7M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  660|  49.7M|                pu1_sign_up_tmp[col + 1] = -u1_sign_down;
  661|       |
  662|  49.7M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
  663|       |
  664|  49.7M|                if(0 != edge_idx)
  ------------------
  |  Branch (664:20): [True: 11.2M, False: 38.4M]
  ------------------
  665|  11.2M|                {
  666|  11.2M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  11.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.41k, False: 11.2M]
  |  |  |  Branch (40:53): [True: 26.3k, False: 11.2M]
  |  |  ------------------
  ------------------
  667|  11.2M|                }
  668|  49.7M|            }
  669|       |
  670|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  671|  1.65M|            {
  672|  1.65M|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  673|  1.65M|                pu1_sign_up = pu1_sign_up_tmp;
  674|  1.65M|                pu1_sign_up_tmp = pu1_swap_tmp;
  675|  1.65M|            }
  676|       |
  677|  1.65M|            pu2_src += src_strd;
  678|  1.65M|        }
  679|       |
  680|  62.7k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd] = u2_pos_0_0_tmp;
  ------------------
  |  Branch (680:20): [True: 48.8k, False: 13.9k]
  ------------------
  681|  62.7k|        pu2_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u2_pos_wd_ht_tmp;
  ------------------
  |  Branch (681:18): [True: 61.8k, False: 913]
  ------------------
  682|  62.7k|    }
  683|       |
  684|  62.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (684:8): [True: 13.9k, False: 48.7k]
  ------------------
  685|  13.9k|        ht++;
  686|  62.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (686:8): [True: 960, False: 61.7k]
  ------------------
  687|    960|        ht++;
  688|  62.7k|    *pu2_src_top_left = u2_src_top_left_tmp;
  689|  1.74M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (689:18): [True: 1.68M, False: 62.7k]
  ------------------
  690|  1.68M|    {
  691|  1.68M|        pu2_src_left[row] = au2_src_left_tmp[row];
  692|  1.68M|    }
  693|  1.76M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (693:18): [True: 1.69M, False: 62.7k]
  ------------------
  694|  1.69M|    {
  695|  1.69M|        pu2_src_top[col] = au2_src_top_tmp[col];
  696|  1.69M|    }
  697|  62.7k|}
ihevc_hbd_sao_edge_offset_class2_chroma:
  712|   101k|{
  713|   101k|    WORD32 row, col;
  714|   101k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  715|   101k|    UWORD16 au2_src_left_tmp[2 * MAX_CTB_SIZE], au2_src_top_tmp[2 * MAX_CTB_SIZE];
  716|   101k|    UWORD16 au2_src_top_left_tmp[2];
  717|   101k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE + 2], au1_sign_up_tmp[2 * MAX_CTB_SIZE + 2];
  718|   101k|    WORD8 u1_sign_down;
  719|   101k|    WORD8 *pu1_sign_up;
  720|   101k|    WORD8 *pu1_sign_up_tmp;
  721|   101k|    UWORD16 *pu2_src_left_cpy;
  722|       |
  723|   101k|    UWORD16 u2_pos_0_0_tmp_u;
  724|   101k|    UWORD16 u2_pos_0_0_tmp_v;
  725|   101k|    UWORD16 u2_pos_wd_ht_tmp_u;
  726|   101k|    UWORD16 u2_pos_wd_ht_tmp_v;
  727|       |
  728|   101k|    pu1_sign_up = au1_sign_up;
  729|   101k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  730|   101k|    pu2_src_left_cpy = pu2_src_left;
  731|       |
  732|       |    /* Initialize the mask values */
  733|   101k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|   101k|#define MAX_CTB_SIZE        64
  ------------------
  734|       |
  735|       |    /* Update left, top and top-left arrays */
  736|   101k|    au2_src_top_left_tmp[0] = pu2_src_top[wd - 2];
  737|   101k|    au2_src_top_left_tmp[1] = pu2_src_top[wd - 1];
  738|  2.23M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (738:18): [True: 2.13M, False: 101k]
  ------------------
  739|  2.13M|    {
  740|  2.13M|        au2_src_left_tmp[2 * row] = pu2_src[row * src_strd + wd - 2];
  741|  2.13M|        au2_src_left_tmp[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
  742|  2.13M|    }
  743|  2.64M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (743:18): [True: 2.54M, False: 101k]
  ------------------
  744|  2.54M|    {
  745|  2.54M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  746|  2.54M|    }
  747|       |
  748|       |    /* If top-left is available, process separately */
  749|   101k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (749:8): [True: 73.3k, False: 28.1k]
  ------------------
  750|  73.3k|    {
  751|  73.3k|        WORD32 edge_idx;
  752|       |
  753|       |        /* U */
  754|  73.3k|        edge_idx = 2 + SIGN(pu2_src[0] - pu2_src_top_left[0]) +
  ------------------
  |  |   44|  73.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 62.6k, False: 10.6k]
  |  |  |  Branch (44:34): [True: 9.79k, False: 52.9k]
  |  |  ------------------
  ------------------
  755|  73.3k|                        SIGN(pu2_src[0] - pu2_src[2 + src_strd]);
  ------------------
  |  |   44|  73.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 60.0k, False: 13.2k]
  |  |  |  Branch (44:34): [True: 10.5k, False: 49.5k]
  |  |  ------------------
  ------------------
  756|       |
  757|  73.3k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  758|       |
  759|  73.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (759:12): [True: 14.8k, False: 58.4k]
  ------------------
  760|  14.8k|        {
  761|  14.8k|            u2_pos_0_0_tmp_u = CLIP3(pu2_src[0] + pi1_sao_offset_u[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  14.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.15k, False: 13.6k]
  |  |  |  Branch (40:53): [True: 1.97k, False: 11.7k]
  |  |  ------------------
  ------------------
  762|  14.8k|        }
  763|  58.4k|        else
  764|  58.4k|        {
  765|  58.4k|            u2_pos_0_0_tmp_u = pu2_src[0];
  766|  58.4k|        }
  767|       |
  768|       |        /* V */
  769|  73.3k|        edge_idx = 2 + SIGN(pu2_src[1] - pu2_src_top_left[1]) +
  ------------------
  |  |   44|  73.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 61.5k, False: 11.7k]
  |  |  |  Branch (44:34): [True: 13.9k, False: 47.5k]
  |  |  ------------------
  ------------------
  770|  73.3k|                        SIGN(pu2_src[1] - pu2_src[1 + 2 + src_strd]);
  ------------------
  |  |   44|  73.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 55.7k, False: 17.6k]
  |  |  |  Branch (44:34): [True: 10.1k, False: 45.5k]
  |  |  ------------------
  ------------------
  771|       |
  772|  73.3k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  773|       |
  774|  73.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (774:12): [True: 15.3k, False: 57.9k]
  ------------------
  775|  15.3k|        {
  776|  15.3k|            u2_pos_0_0_tmp_v = CLIP3(pu2_src[1] + pi1_sao_offset_v[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  15.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 667, False: 14.6k]
  |  |  |  Branch (40:53): [True: 306, False: 14.3k]
  |  |  ------------------
  ------------------
  777|  15.3k|        }
  778|  57.9k|        else
  779|  57.9k|        {
  780|  57.9k|            u2_pos_0_0_tmp_v = pu2_src[1];
  781|  57.9k|        }
  782|  73.3k|    }
  783|  28.1k|    else
  784|  28.1k|    {
  785|  28.1k|        u2_pos_0_0_tmp_u = pu2_src[0];
  786|  28.1k|        u2_pos_0_0_tmp_v = pu2_src[1];
  787|  28.1k|    }
  788|       |
  789|       |    /* If bottom-right is available, process separately */
  790|   101k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (790:8): [True: 93.2k, False: 8.20k]
  ------------------
  791|  93.2k|    {
  792|  93.2k|        WORD32 edge_idx;
  793|       |
  794|       |        /* U */
  795|  93.2k|        edge_idx = 2 + SIGN(pu2_src[wd - 2 + (ht - 1) * src_strd] - pu2_src[wd - 2 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  93.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 77.9k, False: 15.3k]
  |  |  |  Branch (44:34): [True: 14.9k, False: 63.0k]
  |  |  ------------------
  ------------------
  796|  93.2k|                        SIGN(pu2_src[wd - 2 + (ht - 1) * src_strd] - pu2_src[wd - 2 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  93.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 77.9k, False: 15.3k]
  |  |  |  Branch (44:34): [True: 18.8k, False: 59.1k]
  |  |  ------------------
  ------------------
  797|       |
  798|  93.2k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  799|       |
  800|  93.2k|        if(0 != edge_idx)
  ------------------
  |  Branch (800:12): [True: 20.1k, False: 73.1k]
  ------------------
  801|  20.1k|        {
  802|  20.1k|            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|  20.1k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.08k, False: 19.0k]
  |  |  |  Branch (40:53): [True: 923, False: 18.1k]
  |  |  ------------------
  ------------------
  803|  20.1k|        }
  804|  73.1k|        else
  805|  73.1k|        {
  806|  73.1k|            u2_pos_wd_ht_tmp_u = pu2_src[wd - 2 + (ht - 1) * src_strd];
  807|  73.1k|        }
  808|       |
  809|       |        /* V */
  810|  93.2k|        edge_idx = 2 + SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  93.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 73.7k, False: 19.5k]
  |  |  |  Branch (44:34): [True: 15.8k, False: 57.8k]
  |  |  ------------------
  ------------------
  811|  93.2k|                        SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  93.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 75.7k, False: 17.4k]
  |  |  |  Branch (44:34): [True: 22.0k, False: 53.7k]
  |  |  ------------------
  ------------------
  812|       |
  813|  93.2k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  814|       |
  815|  93.2k|        if(0 != edge_idx)
  ------------------
  |  Branch (815:12): [True: 25.8k, False: 67.4k]
  ------------------
  816|  25.8k|        {
  817|  25.8k|            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|  25.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 746, False: 25.0k]
  |  |  |  Branch (40:53): [True: 300, False: 24.7k]
  |  |  ------------------
  ------------------
  818|  25.8k|        }
  819|  67.4k|        else
  820|  67.4k|        {
  821|  67.4k|            u2_pos_wd_ht_tmp_v = pu2_src[wd - 1 + (ht - 1) * src_strd];
  822|  67.4k|        }
  823|  93.2k|    }
  824|  8.20k|    else
  825|  8.20k|    {
  826|  8.20k|        u2_pos_wd_ht_tmp_u = pu2_src[wd - 2 + (ht - 1) * src_strd];
  827|  8.20k|        u2_pos_wd_ht_tmp_v = pu2_src[wd - 1 + (ht - 1) * src_strd];
  828|  8.20k|    }
  829|       |
  830|       |    /* If Left is not available */
  831|   101k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (831:8): [True: 9.70k, False: 91.7k]
  ------------------
  832|  9.70k|    {
  833|  9.70k|        au1_mask[0] = 0;
  834|  9.70k|    }
  835|       |
  836|       |    /* If Top is not available */
  837|   101k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (837:8): [True: 20.4k, False: 80.9k]
  ------------------
  838|  20.4k|    {
  839|  20.4k|        pu2_src += src_strd;
  840|  20.4k|        pu2_src_left_cpy += 2;
  841|  20.4k|        ht--;
  842|   559k|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (842:22): [True: 538k, False: 20.4k]
  ------------------
  843|   538k|        {
  844|   538k|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - 2 - src_strd]);
  ------------------
  |  |   44|   538k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 523k, False: 15.5k]
  |  |  |  Branch (44:34): [True: 25.2k, False: 498k]
  |  |  ------------------
  ------------------
  845|   538k|        }
  846|  20.4k|    }
  847|  80.9k|    else
  848|  80.9k|    {
  849|  1.88M|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (849:22): [True: 1.80M, False: 80.9k]
  ------------------
  850|  1.80M|        {
  851|  1.80M|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col - 2]);
  ------------------
  |  |   44|  1.80M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.56M, False: 244k]
  |  |  |  Branch (44:34): [True: 236k, False: 1.32M]
  |  |  ------------------
  ------------------
  852|  1.80M|        }
  853|  80.9k|    }
  854|       |
  855|       |    /* If Right is not available */
  856|   101k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (856:8): [True: 7.46k, False: 94.0k]
  ------------------
  857|  7.46k|    {
  858|  7.46k|        au1_mask[(wd - 1) >> 1] = 0;
  859|  7.46k|    }
  860|       |
  861|       |    /* If Bottom is not available */
  862|   101k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (862:8): [True: 1.01k, False: 100k]
  ------------------
  863|  1.01k|    {
  864|  1.01k|        ht--;
  865|  1.01k|    }
  866|       |
  867|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  868|   101k|    {
  869|  2.19M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (869:22): [True: 2.09M, False: 101k]
  ------------------
  870|  2.09M|        {
  871|  2.09M|            pu1_sign_up[0] = SIGN(pu2_src[0] - pu2_src_left_cpy[2 * (row - 1)]);
  ------------------
  |  |   44|  2.09M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.82M, False: 273k]
  |  |  |  Branch (44:34): [True: 312k, False: 1.51M]
  |  |  ------------------
  ------------------
  872|  2.09M|            pu1_sign_up[1] = SIGN(pu2_src[1] - pu2_src_left_cpy[2 * (row - 1) + 1]);
  ------------------
  |  |   44|  2.09M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.78M, False: 308k]
  |  |  |  Branch (44:34): [True: 401k, False: 1.38M]
  |  |  ------------------
  ------------------
  873|  63.3M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (873:26): [True: 61.2M, False: 2.09M]
  ------------------
  874|  61.2M|            {
  875|  61.2M|                WORD32 edge_idx;
  876|  61.2M|                WORD8 *pi1_sao_offset;
  877|       |
  878|  61.2M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (878:34): [True: 30.6M, False: 30.6M]
  ------------------
  879|       |
  880|  61.2M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + 2 + src_strd]);
  ------------------
  |  |   44|  61.2M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 53.2M, False: 8.02M]
  |  |  |  Branch (44:34): [True: 6.19M, False: 47.0M]
  |  |  ------------------
  ------------------
  881|  61.2M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  882|  61.2M|                pu1_sign_up_tmp[col + 2] = -u1_sign_down;
  883|       |
  884|  61.2M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  885|       |
  886|  61.2M|                if(0 != edge_idx)
  ------------------
  |  Branch (886:20): [True: 9.82M, False: 51.4M]
  ------------------
  887|  9.82M|                {
  888|  9.82M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  9.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 267k, False: 9.56M]
  |  |  |  Branch (40:53): [True: 78.1k, False: 9.48M]
  |  |  ------------------
  ------------------
  889|  9.82M|                }
  890|  61.2M|            }
  891|       |
  892|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  893|  2.09M|            {
  894|  2.09M|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  895|  2.09M|                pu1_sign_up = pu1_sign_up_tmp;
  896|  2.09M|                pu1_sign_up_tmp = pu1_swap_tmp;
  897|  2.09M|            }
  898|       |
  899|  2.09M|            pu2_src += src_strd;
  900|  2.09M|        }
  901|       |
  902|   101k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd] = u2_pos_0_0_tmp_u;
  ------------------
  |  Branch (902:20): [True: 81.0k, False: 20.4k]
  ------------------
  903|   101k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + 1] = u2_pos_0_0_tmp_v;
  ------------------
  |  Branch (903:20): [True: 81.0k, False: 20.4k]
  ------------------
  904|   101k|        pu2_src[(pu1_avail[3] ? wd - 2 - src_strd : wd - 2)] = u2_pos_wd_ht_tmp_u;
  ------------------
  |  Branch (904:18): [True: 100k, False: 977]
  ------------------
  905|   101k|        pu2_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u2_pos_wd_ht_tmp_v;
  ------------------
  |  Branch (905:18): [True: 100k, False: 972]
  ------------------
  906|   101k|    }
  907|       |
  908|   101k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (908:8): [True: 20.4k, False: 80.9k]
  ------------------
  909|  20.4k|        ht++;
  910|   101k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (910:8): [True: 1.01k, False: 100k]
  ------------------
  911|  1.01k|        ht++;
  912|   101k|    pu2_src_top_left[0] = au2_src_top_left_tmp[0];
  913|   101k|    pu2_src_top_left[1] = au2_src_top_left_tmp[1];
  914|  4.36M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (914:18): [True: 4.26M, False: 101k]
  ------------------
  915|  4.26M|    {
  916|  4.26M|        pu2_src_left[row] = au2_src_left_tmp[row];
  917|  4.26M|    }
  918|  2.65M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (918:18): [True: 2.54M, False: 101k]
  ------------------
  919|  2.54M|    {
  920|  2.54M|        pu2_src_top[col] = au2_src_top_tmp[col];
  921|  2.54M|    }
  922|   101k|}
ihevc_hbd_sao_edge_offset_class3:
  936|  70.2k|{
  937|  70.2k|    WORD32 row, col;
  938|  70.2k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  939|  70.2k|    UWORD16 au2_src_top_tmp[MAX_CTB_SIZE];
  940|  70.2k|    UWORD16 au2_src_left_tmp[MAX_CTB_SIZE];
  941|  70.2k|    UWORD16 u2_src_top_left_tmp;
  942|  70.2k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  943|  70.2k|    UWORD16 *pu2_src_left_cpy;
  944|  70.2k|    WORD8 u1_sign_down;
  945|       |
  946|  70.2k|    UWORD16 u2_pos_0_ht_tmp;
  947|  70.2k|    UWORD16 u2_pos_wd_0_tmp;
  948|       |
  949|  70.2k|    pu2_src_left_cpy = pu2_src_left;
  950|       |
  951|       |    /* Initialize the mask values */
  952|  70.2k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  70.2k|#define MAX_CTB_SIZE        64
  ------------------
  953|       |
  954|       |    /* Update left, top and top-left arrays */
  955|  70.2k|    u2_src_top_left_tmp = pu2_src_top[wd - 1];
  956|  1.85M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (956:18): [True: 1.78M, False: 70.2k]
  ------------------
  957|  1.78M|    {
  958|  1.78M|        au2_src_left_tmp[row] = pu2_src[row * src_strd + wd - 1];
  959|  1.78M|    }
  960|  1.88M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (960:18): [True: 1.81M, False: 70.2k]
  ------------------
  961|  1.81M|    {
  962|  1.81M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  963|  1.81M|    }
  964|       |
  965|       |    /* If top-right is available, process separately */
  966|  70.2k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (966:8): [True: 51.1k, False: 19.1k]
  ------------------
  967|  51.1k|    {
  968|  51.1k|        WORD32 edge_idx;
  969|       |
  970|  51.1k|        edge_idx = 2 + SIGN(pu2_src[wd - 1] - pu2_src_top_right[0]) +
  ------------------
  |  |   44|  51.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.0k, False: 15.0k]
  |  |  |  Branch (44:34): [True: 18.0k, False: 18.0k]
  |  |  ------------------
  ------------------
  971|  51.1k|                        SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 - 1 + src_strd]);
  ------------------
  |  |   44|  51.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 35.1k, False: 15.9k]
  |  |  |  Branch (44:34): [True: 14.3k, False: 20.7k]
  |  |  ------------------
  ------------------
  972|       |
  973|  51.1k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  974|       |
  975|  51.1k|        if(0 != edge_idx)
  ------------------
  |  Branch (975:12): [True: 13.1k, False: 37.9k]
  ------------------
  976|  13.1k|        {
  977|  13.1k|            u2_pos_wd_0_tmp = CLIP3(pu2_src[wd - 1] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  13.1k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 109, False: 13.0k]
  |  |  |  Branch (40:53): [True: 23, False: 13.0k]
  |  |  ------------------
  ------------------
  978|  13.1k|        }
  979|  37.9k|        else
  980|  37.9k|        {
  981|  37.9k|            u2_pos_wd_0_tmp = pu2_src[wd - 1];
  982|  37.9k|        }
  983|  51.1k|    }
  984|  19.1k|    else
  985|  19.1k|    {
  986|  19.1k|        u2_pos_wd_0_tmp = pu2_src[wd - 1];
  987|  19.1k|    }
  988|       |
  989|       |    /* If bottom-left is available, process separately */
  990|  70.2k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (990:8): [True: 63.1k, False: 7.11k]
  ------------------
  991|  63.1k|    {
  992|  63.1k|        WORD32 edge_idx;
  993|       |
  994|  63.1k|        edge_idx = 2 + SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src[(ht - 1) * src_strd + 1 - src_strd]) +
  ------------------
  |  |   44|  63.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 43.6k, False: 19.4k]
  |  |  |  Branch (44:34): [True: 18.8k, False: 24.7k]
  |  |  ------------------
  ------------------
  995|  63.1k|                        SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src_bot_left[0]);
  ------------------
  |  |   44|  63.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 42.2k, False: 20.8k]
  |  |  |  Branch (44:34): [True: 21.2k, False: 21.0k]
  |  |  ------------------
  ------------------
  996|       |
  997|  63.1k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  998|       |
  999|  63.1k|        if(0 != edge_idx)
  ------------------
  |  Branch (999:12): [True: 14.9k, False: 48.1k]
  ------------------
 1000|  14.9k|        {
 1001|  14.9k|            u2_pos_0_ht_tmp = CLIP3(pu2_src[(ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  14.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 91, False: 14.8k]
  |  |  |  Branch (40:53): [True: 25, False: 14.8k]
  |  |  ------------------
  ------------------
 1002|  14.9k|        }
 1003|  48.1k|        else
 1004|  48.1k|        {
 1005|  48.1k|            u2_pos_0_ht_tmp = pu2_src[(ht - 1) * src_strd];
 1006|  48.1k|        }
 1007|  63.1k|    }
 1008|  7.11k|    else
 1009|  7.11k|    {
 1010|  7.11k|        u2_pos_0_ht_tmp = pu2_src[(ht - 1) * src_strd];
 1011|  7.11k|    }
 1012|       |
 1013|       |    /* If Left is not available */
 1014|  70.2k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1014:8): [True: 5.82k, False: 64.3k]
  ------------------
 1015|  5.82k|    {
 1016|  5.82k|        au1_mask[0] = 0;
 1017|  5.82k|    }
 1018|       |
 1019|       |    /* If Top is not available */
 1020|  70.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1020:8): [True: 15.7k, False: 54.4k]
  ------------------
 1021|  15.7k|    {
 1022|  15.7k|        pu2_src += src_strd;
 1023|  15.7k|        ht--;
 1024|  15.7k|        pu2_src_left_cpy += 1;
 1025|   440k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1025:22): [True: 424k, False: 15.7k]
  ------------------
 1026|   424k|        {
 1027|   424k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col + 1 - src_strd]);
  ------------------
  |  |   44|   424k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 360k, False: 63.9k]
  |  |  |  Branch (44:34): [True: 69.2k, False: 291k]
  |  |  ------------------
  ------------------
 1028|   424k|        }
 1029|  15.7k|    }
 1030|  54.4k|    else
 1031|  54.4k|    {
 1032|  1.37M|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1032:22): [True: 1.31M, False: 54.4k]
  ------------------
 1033|  1.31M|        {
 1034|  1.31M|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col + 1]);
  ------------------
  |  |   44|  1.31M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 931k, False: 387k]
  |  |  |  Branch (44:34): [True: 423k, False: 507k]
  |  |  ------------------
  ------------------
 1035|  1.31M|        }
 1036|  54.4k|    }
 1037|       |
 1038|       |    /* If Right is not available */
 1039|  70.2k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1039:8): [True: 4.34k, False: 65.8k]
  ------------------
 1040|  4.34k|    {
 1041|  4.34k|        au1_mask[wd - 1] = 0;
 1042|  4.34k|    }
 1043|       |
 1044|       |    /* If Bottom is not available */
 1045|  70.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1045:8): [True: 1.52k, False: 68.6k]
  ------------------
 1046|  1.52k|    {
 1047|  1.52k|        ht--;
 1048|  1.52k|    }
 1049|       |
 1050|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1051|  70.2k|    {
 1052|  1.81M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1052:22): [True: 1.74M, False: 70.2k]
  ------------------
 1053|  1.74M|        {
 1054|  1.74M|            au1_sign_up[wd - 1] = SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 + 1 - src_strd]);
  ------------------
  |  |   44|  1.74M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.28M, False: 465k]
  |  |  |  Branch (44:34): [True: 557k, False: 726k]
  |  |  ------------------
  ------------------
 1055|  53.2M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1055:26): [True: 51.5M, False: 1.74M]
  ------------------
 1056|  51.5M|            {
 1057|  51.5M|                WORD32 edge_idx;
 1058|       |
 1059|  51.5M|                u1_sign_down = SIGN(pu2_src[col] - ((col == 0) ? pu2_src_left_cpy[row + 1] :
  ------------------
  |  |   44|   103M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 38.4M, False: 13.0M]
  |  |  |  Branch (44:23): [True: 1.74M, False: 49.7M]
  |  |  |  Branch (44:34): [True: 13.4M, False: 25.0M]
  |  |  |  Branch (44:35): [True: 1.23M, False: 37.2M]
  |  |  ------------------
  ------------------
 1060|  51.5M|                                                            pu2_src[col - 1 + src_strd]));
 1061|  51.5M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1062|  51.5M|                if(col > 0)
  ------------------
  |  Branch (1062:20): [True: 49.8M, False: 1.72M]
  ------------------
 1063|  49.8M|                    au1_sign_up[col - 1] = -u1_sign_down;
 1064|       |
 1065|  51.5M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
 1066|       |
 1067|  51.5M|                if(0 != edge_idx)
  ------------------
  |  Branch (1067:20): [True: 9.92M, False: 41.6M]
  ------------------
 1068|  9.92M|                {
 1069|  9.92M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  9.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 8.16k, False: 9.92M]
  |  |  |  Branch (40:53): [True: 2.37k, False: 9.91M]
  |  |  ------------------
  ------------------
 1070|  9.92M|                }
 1071|  51.5M|            }
 1072|       |
 1073|  1.74M|            pu2_src += src_strd;
 1074|  1.74M|        }
 1075|       |
 1076|  70.2k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u2_pos_wd_0_tmp;
  ------------------
  |  Branch (1076:20): [True: 54.2k, False: 15.9k]
  ------------------
 1077|  70.2k|        pu2_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u2_pos_0_ht_tmp;
  ------------------
  |  Branch (1077:18): [True: 68.5k, False: 1.69k]
  ------------------
 1078|  70.2k|    }
 1079|       |
 1080|  70.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1080:8): [True: 15.7k, False: 54.4k]
  ------------------
 1081|  15.7k|        ht++;
 1082|  70.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1082:8): [True: 1.52k, False: 68.6k]
  ------------------
 1083|  1.52k|        ht++;
 1084|  70.2k|    *pu2_src_top_left = u2_src_top_left_tmp;
 1085|  1.85M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1085:18): [True: 1.78M, False: 70.2k]
  ------------------
 1086|  1.78M|    {
 1087|  1.78M|        pu2_src_left[row] = au2_src_left_tmp[row];
 1088|  1.78M|    }
 1089|  1.88M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1089:18): [True: 1.81M, False: 70.2k]
  ------------------
 1090|  1.81M|    {
 1091|  1.81M|        pu2_src_top[col] = au2_src_top_tmp[col];
 1092|  1.81M|    }
 1093|  70.2k|}
ihevc_hbd_sao_edge_offset_class3_chroma:
 1109|   122k|{
 1110|   122k|    WORD32 row, col;
 1111|   122k|    UWORD8 au1_mask[MAX_CTB_SIZE];
 1112|   122k|    UWORD16 au2_src_left_tmp[2 * MAX_CTB_SIZE], au2_src_top_tmp[2 * MAX_CTB_SIZE];
 1113|   122k|    UWORD16 au2_src_top_left_tmp[2];
 1114|   122k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
 1115|   122k|    UWORD16 *pu2_src_left_cpy;
 1116|   122k|    WORD8 u1_sign_down;
 1117|       |
 1118|   122k|    UWORD16 u2_pos_wd_0_tmp_u;
 1119|   122k|    UWORD16 u2_pos_wd_0_tmp_v;
 1120|   122k|    UWORD16 u2_pos_0_ht_tmp_u;
 1121|   122k|    UWORD16 u2_pos_0_ht_tmp_v;
 1122|       |
 1123|   122k|    pu2_src_left_cpy = pu2_src_left;
 1124|       |
 1125|       |    /* Initialize the mask values */
 1126|   122k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|   122k|#define MAX_CTB_SIZE        64
  ------------------
 1127|       |
 1128|       |    /* Update left, top and top-left arrays */
 1129|   122k|    au2_src_top_left_tmp[0] = pu2_src_top[wd - 2];
 1130|   122k|    au2_src_top_left_tmp[1] = pu2_src_top[wd - 1];
 1131|  2.78M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1131:18): [True: 2.66M, False: 122k]
  ------------------
 1132|  2.66M|    {
 1133|  2.66M|        au2_src_left_tmp[2 * row] = pu2_src[row * src_strd + wd - 2];
 1134|  2.66M|        au2_src_left_tmp[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
 1135|  2.66M|    }
 1136|  3.27M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1136:18): [True: 3.15M, False: 122k]
  ------------------
 1137|  3.15M|    {
 1138|  3.15M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
 1139|  3.15M|    }
 1140|       |
 1141|       |    /* If top-right is available, process separately */
 1142|   122k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1142:8): [True: 90.8k, False: 31.3k]
  ------------------
 1143|  90.8k|    {
 1144|  90.8k|        WORD32 edge_idx;
 1145|       |
 1146|       |        /* U */
 1147|  90.8k|        edge_idx = 2 + SIGN(pu2_src[wd - 2] - pu2_src_top_right[0]) +
  ------------------
  |  |   44|  90.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 74.4k, False: 16.4k]
  |  |  |  Branch (44:34): [True: 16.0k, False: 58.4k]
  |  |  ------------------
  ------------------
 1148|  90.8k|                        SIGN(pu2_src[wd - 2] - pu2_src[wd - 2 - 2 + src_strd]);
  ------------------
  |  |   44|  90.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 75.2k, False: 15.6k]
  |  |  |  Branch (44:34): [True: 14.8k, False: 60.3k]
  |  |  ------------------
  ------------------
 1149|       |
 1150|  90.8k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1151|       |
 1152|  90.8k|        if(0 != edge_idx)
  ------------------
  |  Branch (1152:12): [True: 16.1k, False: 74.7k]
  ------------------
 1153|  16.1k|        {
 1154|  16.1k|            u2_pos_wd_0_tmp_u = CLIP3(pu2_src[wd - 2] + pi1_sao_offset_u[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  16.1k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 867, False: 15.2k]
  |  |  |  Branch (40:53): [True: 509, False: 14.7k]
  |  |  ------------------
  ------------------
 1155|  16.1k|        }
 1156|  74.7k|        else
 1157|  74.7k|        {
 1158|  74.7k|            u2_pos_wd_0_tmp_u = pu2_src[wd - 2];
 1159|  74.7k|        }
 1160|       |
 1161|       |        /* V */
 1162|  90.8k|        edge_idx = 2 + SIGN(pu2_src[wd - 1] - pu2_src_top_right[1]) +
  ------------------
  |  |   44|  90.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 66.0k, False: 24.8k]
  |  |  |  Branch (44:34): [True: 16.9k, False: 49.0k]
  |  |  ------------------
  ------------------
 1163|  90.8k|                        SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 - 2 + src_strd]);
  ------------------
  |  |   44|  90.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 60.8k, False: 30.0k]
  |  |  |  Branch (44:34): [True: 22.0k, False: 38.7k]
  |  |  ------------------
  ------------------
 1164|       |
 1165|  90.8k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1166|       |
 1167|  90.8k|        if(0 != edge_idx)
  ------------------
  |  Branch (1167:12): [True: 32.7k, False: 58.1k]
  ------------------
 1168|  32.7k|        {
 1169|  32.7k|            u2_pos_wd_0_tmp_v = CLIP3(pu2_src[wd - 1] + pi1_sao_offset_v[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  32.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 13.1k, False: 19.6k]
  |  |  |  Branch (40:53): [True: 95, False: 19.5k]
  |  |  ------------------
  ------------------
 1170|  32.7k|        }
 1171|  58.1k|        else
 1172|  58.1k|        {
 1173|  58.1k|            u2_pos_wd_0_tmp_v = pu2_src[wd - 1];
 1174|  58.1k|        }
 1175|  90.8k|    }
 1176|  31.3k|    else
 1177|  31.3k|    {
 1178|  31.3k|        u2_pos_wd_0_tmp_u = pu2_src[wd - 2];
 1179|  31.3k|        u2_pos_wd_0_tmp_v = pu2_src[wd - 1];
 1180|  31.3k|    }
 1181|       |
 1182|       |    /* If bottom-left is available, process separately */
 1183|   122k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1183:8): [True: 101k, False: 21.1k]
  ------------------
 1184|   101k|    {
 1185|   101k|        WORD32 edge_idx;
 1186|       |
 1187|       |        /* U */
 1188|   101k|        edge_idx = 2 + SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src[(ht - 1) * src_strd + 2 - src_strd]) +
  ------------------
  |  |   44|   101k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 81.4k, False: 19.5k]
  |  |  |  Branch (44:34): [True: 19.2k, False: 62.2k]
  |  |  ------------------
  ------------------
 1189|   101k|                        SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src_bot_left[0]);
  ------------------
  |  |   44|   101k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 80.6k, False: 20.4k]
  |  |  |  Branch (44:34): [True: 21.6k, False: 58.9k]
  |  |  ------------------
  ------------------
 1190|       |
 1191|   101k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1192|       |
 1193|   101k|        if(0 != edge_idx)
  ------------------
  |  Branch (1193:12): [True: 22.4k, False: 78.6k]
  ------------------
 1194|  22.4k|        {
 1195|  22.4k|            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|  22.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 827, False: 21.6k]
  |  |  |  Branch (40:53): [True: 562, False: 21.0k]
  |  |  ------------------
  ------------------
 1196|  22.4k|        }
 1197|  78.6k|        else
 1198|  78.6k|        {
 1199|  78.6k|            u2_pos_0_ht_tmp_u = pu2_src[(ht - 1) * src_strd];
 1200|  78.6k|        }
 1201|       |
 1202|       |        /* V */
 1203|   101k|        edge_idx = 2 + SIGN(pu2_src[(ht - 1) * src_strd + 1] - pu2_src[(ht - 1) * src_strd + 1 + 2 - src_strd]) +
  ------------------
  |  |   44|   101k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 64.7k, False: 36.3k]
  |  |  |  Branch (44:34): [True: 19.0k, False: 45.7k]
  |  |  ------------------
  ------------------
 1204|   101k|                        SIGN(pu2_src[(ht - 1) * src_strd + 1] - pu2_src_bot_left[1]);
  ------------------
  |  |   44|   101k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 79.9k, False: 21.1k]
  |  |  |  Branch (44:34): [True: 30.1k, False: 49.7k]
  |  |  ------------------
  ------------------
 1205|       |
 1206|   101k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1207|       |
 1208|   101k|        if(0 != edge_idx)
  ------------------
  |  Branch (1208:12): [True: 35.7k, False: 65.3k]
  ------------------
 1209|  35.7k|        {
 1210|  35.7k|            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|  35.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 13.2k, False: 22.5k]
  |  |  |  Branch (40:53): [True: 56, False: 22.4k]
  |  |  ------------------
  ------------------
 1211|  35.7k|        }
 1212|  65.3k|        else
 1213|  65.3k|        {
 1214|  65.3k|            u2_pos_0_ht_tmp_v = pu2_src[(ht - 1) * src_strd + 1];
 1215|  65.3k|        }
 1216|   101k|    }
 1217|  21.1k|    else
 1218|  21.1k|    {
 1219|  21.1k|        u2_pos_0_ht_tmp_u = pu2_src[(ht - 1) * src_strd];
 1220|  21.1k|        u2_pos_0_ht_tmp_v = pu2_src[(ht - 1) * src_strd + 1];
 1221|  21.1k|    }
 1222|       |
 1223|       |    /* If Left is not available */
 1224|   122k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1224:8): [True: 18.1k, False: 104k]
  ------------------
 1225|  18.1k|    {
 1226|  18.1k|        au1_mask[0] = 0;
 1227|  18.1k|    }
 1228|       |
 1229|       |    /* If Top is not available */
 1230|   122k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1230:8): [True: 23.0k, False: 99.2k]
  ------------------
 1231|  23.0k|    {
 1232|  23.0k|        pu2_src += src_strd;
 1233|  23.0k|        ht--;
 1234|  23.0k|        pu2_src_left_cpy += 2;
 1235|   702k|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1235:22): [True: 679k, False: 23.0k]
  ------------------
 1236|   679k|        {
 1237|   679k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col + 2 - src_strd]);
  ------------------
  |  |   44|   679k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 614k, False: 64.7k]
  |  |  |  Branch (44:34): [True: 92.8k, False: 521k]
  |  |  ------------------
  ------------------
 1238|   679k|        }
 1239|  23.0k|    }
 1240|  99.2k|    else
 1241|  99.2k|    {
 1242|  2.32M|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1242:22): [True: 2.22M, False: 99.2k]
  ------------------
 1243|  2.22M|        {
 1244|  2.22M|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col + 2]);
  ------------------
  |  |   44|  2.22M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.84M, False: 379k]
  |  |  |  Branch (44:34): [True: 440k, False: 1.40M]
  |  |  ------------------
  ------------------
 1245|  2.22M|        }
 1246|  99.2k|    }
 1247|       |
 1248|       |    /* If Right is not available */
 1249|   122k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1249:8): [True: 9.58k, False: 112k]
  ------------------
 1250|  9.58k|    {
 1251|  9.58k|        au1_mask[(wd - 1) >> 1] = 0;
 1252|  9.58k|    }
 1253|       |
 1254|       |    /* If Bottom is not available */
 1255|   122k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1255:8): [True: 3.69k, False: 118k]
  ------------------
 1256|  3.69k|    {
 1257|  3.69k|        ht--;
 1258|  3.69k|    }
 1259|       |
 1260|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1261|   122k|    {
 1262|  2.72M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1262:22): [True: 2.59M, False: 122k]
  ------------------
 1263|  2.59M|        {
 1264|  2.59M|            au1_sign_up[wd - 2] = SIGN(pu2_src[wd - 2] - pu2_src[wd - 2 + 2 - src_strd]);
  ------------------
  |  |   44|  2.59M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.10M, False: 490k]
  |  |  |  Branch (44:34): [True: 599k, False: 1.50M]
  |  |  ------------------
  ------------------
 1265|  2.59M|            au1_sign_up[wd - 1] = SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 + 2 - src_strd]);
  ------------------
  |  |   44|  2.59M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.93M, False: 664k]
  |  |  |  Branch (44:34): [True: 590k, False: 1.34M]
  |  |  ------------------
  ------------------
 1266|  78.9M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1266:26): [True: 76.3M, False: 2.59M]
  ------------------
 1267|  76.3M|            {
 1268|  76.3M|                WORD32 edge_idx;
 1269|  76.3M|                WORD8 *pi1_sao_offset;
 1270|       |
 1271|  76.3M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (1271:34): [True: 38.1M, False: 38.1M]
  ------------------
 1272|       |
 1273|  76.3M|                u1_sign_down = SIGN(pu2_src[col] - ((col < 2) ? pu2_src_left_cpy[2 * (row + 1) + col] :
  ------------------
  |  |   44|   152M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 62.7M, False: 13.5M]
  |  |  |  Branch (44:23): [True: 5.19M, False: 71.1M]
  |  |  |  Branch (44:34): [True: 12.0M, False: 50.7M]
  |  |  |  Branch (44:35): [True: 4.09M, False: 58.6M]
  |  |  ------------------
  ------------------
 1274|  76.3M|                                                                    pu2_src[col - 2 + src_strd]));
 1275|  76.3M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1276|  76.3M|                if(col > 1)
  ------------------
  |  Branch (1276:20): [True: 71.1M, False: 5.14M]
  ------------------
 1277|  71.1M|                    au1_sign_up[col - 2] = -u1_sign_down;
 1278|       |
 1279|  76.3M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
 1280|       |
 1281|  76.3M|                if(0 != edge_idx)
  ------------------
  |  Branch (1281:20): [True: 14.1M, False: 62.1M]
  ------------------
 1282|  14.1M|                {
 1283|  14.1M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  14.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 766k, False: 13.3M]
  |  |  |  Branch (40:53): [True: 26.2k, False: 13.3M]
  |  |  ------------------
  ------------------
 1284|  14.1M|                }
 1285|  76.3M|            }
 1286|       |
 1287|  2.59M|            pu2_src += src_strd;
 1288|  2.59M|        }
 1289|       |
 1290|   122k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 2] = u2_pos_wd_0_tmp_u;
  ------------------
  |  Branch (1290:20): [True: 99.0k, False: 23.1k]
  ------------------
 1291|   122k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u2_pos_wd_0_tmp_v;
  ------------------
  |  Branch (1291:20): [True: 99.0k, False: 23.1k]
  ------------------
 1292|   122k|        pu2_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u2_pos_0_ht_tmp_u;
  ------------------
  |  Branch (1292:18): [True: 118k, False: 3.85k]
  ------------------
 1293|   122k|        pu2_src[(pu1_avail[3] ?  (-src_strd) : 0) + 1] = u2_pos_0_ht_tmp_v;
  ------------------
  |  Branch (1293:18): [True: 118k, False: 3.84k]
  ------------------
 1294|   122k|    }
 1295|       |
 1296|   122k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1296:8): [True: 23.0k, False: 99.2k]
  ------------------
 1297|  23.0k|        ht++;
 1298|   122k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1298:8): [True: 3.69k, False: 118k]
  ------------------
 1299|  3.69k|        ht++;
 1300|   122k|    pu2_src_top_left[0] = au2_src_top_left_tmp[0];
 1301|   122k|    pu2_src_top_left[1] = au2_src_top_left_tmp[1];
 1302|  5.44M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1302:18): [True: 5.32M, False: 122k]
  ------------------
 1303|  5.32M|    {
 1304|  5.32M|        pu2_src_left[row] = au2_src_left_tmp[row];
 1305|  5.32M|    }
 1306|  3.27M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1306:18): [True: 3.15M, False: 122k]
  ------------------
 1307|  3.15M|    {
 1308|  3.15M|        pu2_src_top[col] = au2_src_top_tmp[col];
 1309|  3.15M|    }
 1310|   122k|}

ihevc_hbd_weighted_pred_uni:
  112|  73.6k|{
  113|  73.6k|    WORD32 row, col;
  114|  73.6k|    WORD32 tmp;
  115|       |
  116|   679k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (116:18): [True: 606k, False: 73.6k]
  ------------------
  117|   606k|    {
  118|  6.53M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (118:22): [True: 5.93M, False: 606k]
  ------------------
  119|  5.93M|        {
  120|  5.93M|            tmp = (pi2_src[col] + lvl_shift) * wgt0;
  121|  5.93M|            tmp += 1 << (shift - 1);
  122|  5.93M|            tmp = (tmp >> shift) + off0;
  123|       |
  124|  5.93M|            pu2_dst[col] = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  5.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 702k, False: 5.23M]
  |  |  |  Branch (40:53): [True: 156k, False: 5.07M]
  |  |  ------------------
  ------------------
  125|  5.93M|        }
  126|       |
  127|   606k|        pi2_src += src_strd;
  128|   606k|        pu2_dst += dst_strd;
  129|   606k|    }
  130|  73.6k|}
ihevc_hbd_weighted_pred_chroma_uni:
  198|  73.0k|{
  199|  73.0k|    WORD32 row, col;
  200|  73.0k|    WORD32 tmp;
  201|       |
  202|   510k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (202:18): [True: 436k, False: 73.0k]
  ------------------
  203|   436k|    {
  204|  2.65M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (204:22): [True: 2.21M, False: 436k]
  ------------------
  205|  2.21M|        {
  206|  2.21M|            tmp = (pi2_src[col] + lvl_shift) * wgt0_cb;
  207|  2.21M|            tmp += 1 << (shift - 1);
  208|  2.21M|            tmp = (tmp >> shift) + off0_cb;
  209|       |
  210|  2.21M|            pu2_dst[col] = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  2.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 20.6k, False: 2.19M]
  |  |  |  Branch (40:53): [True: 15.6k, False: 2.18M]
  |  |  ------------------
  ------------------
  211|       |
  212|  2.21M|            tmp = (pi2_src[col + 1] + lvl_shift) * wgt0_cr;
  213|  2.21M|            tmp += 1 << (shift - 1);
  214|  2.21M|            tmp = (tmp >> shift) + off0_cr;
  215|       |
  216|  2.21M|            pu2_dst[col+1] = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  2.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 30.3k, False: 2.18M]
  |  |  |  Branch (40:53): [True: 44.2k, False: 2.14M]
  |  |  ------------------
  ------------------
  217|  2.21M|        }
  218|       |
  219|   436k|        pi2_src += src_strd;
  220|   436k|        pu2_dst += dst_strd;
  221|   436k|    }
  222|  73.0k|}
ihevc_hbd_weighted_pred_bi:
  305|   225k|{
  306|   225k|    WORD32 row, col;
  307|   225k|    WORD32 tmp;
  308|       |
  309|  2.04M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (309:18): [True: 1.82M, False: 225k]
  ------------------
  310|  1.82M|    {
  311|  18.9M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (311:22): [True: 17.0M, False: 1.82M]
  ------------------
  312|  17.0M|        {
  313|  17.0M|            tmp = (pi2_src1[col] + lvl_shift1) * wgt0;
  314|  17.0M|            tmp += (pi2_src2[col] + lvl_shift2) * wgt1;
  315|  17.0M|            tmp += (off0 + off1 + 1) << (shift - 1);
  316|       |
  317|  17.0M|            pu2_dst[col] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  17.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.70M, False: 15.3M]
  |  |  |  Branch (40:53): [True: 758k, False: 14.6M]
  |  |  ------------------
  ------------------
  318|  17.0M|        }
  319|       |
  320|  1.82M|        pi2_src1 += src_strd1;
  321|  1.82M|        pi2_src2 += src_strd2;
  322|  1.82M|        pu2_dst += dst_strd;
  323|  1.82M|    }
  324|   225k|}
ihevc_hbd_weighted_pred_chroma_bi:
  411|   214k|{
  412|   214k|    WORD32 row, col;
  413|   214k|    WORD32 tmp;
  414|       |
  415|  1.53M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (415:18): [True: 1.32M, False: 214k]
  ------------------
  416|  1.32M|    {
  417|  7.55M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (417:22): [True: 6.23M, False: 1.32M]
  ------------------
  418|  6.23M|        {
  419|  6.23M|            tmp = (pi2_src1[col] + lvl_shift1) * wgt0_cb;
  420|  6.23M|            tmp += (pi2_src2[col] + lvl_shift2) * wgt1_cb;
  421|  6.23M|            tmp += (off0_cb + off1_cb + 1) << (shift - 1);
  422|       |
  423|  6.23M|            pu2_dst[col] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  6.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 239k, False: 5.99M]
  |  |  |  Branch (40:53): [True: 110k, False: 5.88M]
  |  |  ------------------
  ------------------
  424|       |
  425|  6.23M|            tmp = (pi2_src1[col + 1] + lvl_shift1) * wgt0_cr;
  426|  6.23M|            tmp += (pi2_src2[col + 1] + lvl_shift2) * wgt1_cr;
  427|  6.23M|            tmp += (off0_cr + off1_cr + 1) << (shift - 1);
  428|       |
  429|  6.23M|            pu2_dst[col+1] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  6.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 165k, False: 6.06M]
  |  |  |  Branch (40:53): [True: 209k, False: 5.86M]
  |  |  ------------------
  ------------------
  430|  6.23M|        }
  431|       |
  432|  1.32M|        pi2_src1 += src_strd1;
  433|  1.32M|        pi2_src2 += src_strd2;
  434|  1.32M|        pu2_dst += dst_strd;
  435|  1.32M|    }
  436|   214k|}
ihevc_hbd_weighted_pred_bi_default:
  499|   220k|{
  500|   220k|    WORD32 row, col;
  501|   220k|    WORD32 tmp;
  502|   220k|    WORD32 shift;
  503|       |
  504|   220k|    shift = 14 - bit_depth + 1;
  505|  1.63M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (505:18): [True: 1.41M, False: 220k]
  ------------------
  506|  1.41M|    {
  507|  14.9M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (507:22): [True: 13.5M, False: 1.41M]
  ------------------
  508|  13.5M|        {
  509|  13.5M|            tmp = pi2_src1[col] + lvl_shift1;
  510|  13.5M|            tmp += pi2_src2[col] + lvl_shift2;
  511|  13.5M|            tmp += 1 << (shift - 1);
  512|       |
  513|  13.5M|            pu2_dst[col] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  13.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.34k, False: 13.5M]
  |  |  |  Branch (40:53): [True: 20.3k, False: 13.5M]
  |  |  ------------------
  ------------------
  514|  13.5M|        }
  515|       |
  516|  1.41M|        pi2_src1 += src_strd1;
  517|  1.41M|        pi2_src2 += src_strd2;
  518|  1.41M|        pu2_dst += dst_strd;
  519|  1.41M|    }
  520|   220k|}

ihevc_inter_pred_luma_copy:
  133|   662k|{
  134|   662k|    WORD32 row, col;
  135|   662k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   662k|#define UNUSED(x) ((void)(x))
  ------------------
  136|  5.81M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (136:18): [True: 5.14M, False: 662k]
  ------------------
  137|  5.14M|    {
  138|  52.3M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (138:22): [True: 47.2M, False: 5.14M]
  ------------------
  139|  47.2M|        {
  140|  47.2M|            pu1_dst[col] = pu1_src[col];
  141|  47.2M|        }
  142|       |
  143|  5.14M|        pu1_src += src_strd;
  144|  5.14M|        pu1_dst += dst_strd;
  145|  5.14M|    }
  146|   662k|}
ihevc_inter_pred_luma_horz:
  195|   684k|{
  196|   684k|    WORD32 row, col, i;
  197|   684k|    WORD16 i2_tmp;
  198|       |
  199|  5.59M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (199:18): [True: 4.91M, False: 684k]
  ------------------
  200|  4.91M|    {
  201|  42.2M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (201:22): [True: 37.3M, False: 4.91M]
  ------------------
  202|  37.3M|        {
  203|  37.3M|            i2_tmp = 0;
  204|   330M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   330M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (204:24): [True: 293M, False: 37.3M]
  ------------------
  205|   293M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3)];
  206|       |
  207|  37.3M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  37.3M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  37.3M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  37.3M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  37.3M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  37.3M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  208|  37.3M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  37.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  37.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 265k, False: 37.0M]
  |  |  |  |  |  Branch (40:53): [True: 313k, False: 36.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|       |
  210|  37.3M|            pu1_dst[col] = (UWORD8)i2_tmp;
  211|  37.3M|        }
  212|       |
  213|  4.91M|        pu1_src += src_strd;
  214|  4.91M|        pu1_dst += dst_strd;
  215|  4.91M|    }
  216|       |
  217|   684k|}
ihevc_inter_pred_luma_vert:
  268|   535k|{
  269|   535k|    WORD32 row, col, i;
  270|   535k|    WORD16 i2_tmp;
  271|       |
  272|  4.44M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (272:18): [True: 3.91M, False: 535k]
  ------------------
  273|  3.91M|    {
  274|  35.7M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (274:22): [True: 31.7M, False: 3.91M]
  ------------------
  275|  31.7M|        {
  276|  31.7M|            i2_tmp = 0;
  277|   281M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   281M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (277:24): [True: 250M, False: 31.7M]
  ------------------
  278|   250M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3) * src_strd];
  279|       |
  280|  31.7M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  31.7M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  31.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  31.7M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  31.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  31.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  281|  31.7M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  31.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  31.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 239k, False: 31.5M]
  |  |  |  |  |  Branch (40:53): [True: 646k, False: 30.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|       |
  283|  31.7M|            pu1_dst[col] = (UWORD8)i2_tmp;
  284|  31.7M|        }
  285|       |
  286|  3.91M|        pu1_src += src_strd;
  287|  3.91M|        pu1_dst += dst_strd;
  288|  3.91M|    }
  289|       |
  290|   535k|}
ihevc_inter_pred_luma_copy_w16out:
  341|  41.0M|{
  342|  41.0M|    WORD32 row, col;
  343|  41.0M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  41.0M|#define UNUSED(x) ((void)(x))
  ------------------
  344|   352M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (344:18): [True: 311M, False: 41.0M]
  ------------------
  345|   311M|    {
  346|  2.97G|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (346:22): [True: 2.66G, False: 311M]
  ------------------
  347|  2.66G|        {
  348|  2.66G|            pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.66G|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.66G|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  349|  2.66G|        }
  350|       |
  351|   311M|        pu1_src += src_strd;
  352|   311M|        pi2_dst += dst_strd;
  353|   311M|    }
  354|       |
  355|  41.0M|}
ihevc_inter_pred_luma_horz_w16out:
  407|  4.47M|{
  408|  4.47M|    WORD32 row, col, i;
  409|  4.47M|    WORD16 i2_tmp;
  410|       |
  411|  51.3M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (411:18): [True: 46.8M, False: 4.47M]
  ------------------
  412|  46.8M|    {
  413|   412M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (413:22): [True: 365M, False: 46.8M]
  ------------------
  414|   365M|        {
  415|   365M|            i2_tmp = 0;
  416|  3.23G|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  3.23G|#define NTAPS_LUMA 8
  ------------------
  |  Branch (416:24): [True: 2.86G, False: 365M]
  ------------------
  417|  2.86G|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3)];
  418|       |
  419|   365M|            pi2_dst[col] = i2_tmp;
  420|   365M|        }
  421|       |
  422|  46.8M|        pu1_src += src_strd;
  423|  46.8M|        pi2_dst += dst_strd;
  424|  46.8M|    }
  425|       |
  426|  4.47M|}
ihevc_inter_pred_luma_vert_w16out:
  478|  1.83M|{
  479|  1.83M|    WORD32 row, col, i;
  480|  1.83M|    WORD16 i2_tmp;
  481|       |
  482|  15.1M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (482:18): [True: 13.3M, False: 1.83M]
  ------------------
  483|  13.3M|    {
  484|   121M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (484:22): [True: 108M, False: 13.3M]
  ------------------
  485|   108M|        {
  486|   108M|            i2_tmp = 0;
  487|   965M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   965M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (487:24): [True: 856M, False: 108M]
  ------------------
  488|   856M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3) * src_strd];
  489|       |
  490|   108M|            pi2_dst[col] = i2_tmp;
  491|   108M|        }
  492|       |
  493|  13.3M|        pu1_src += src_strd;
  494|  13.3M|        pi2_dst += dst_strd;
  495|  13.3M|    }
  496|       |
  497|  1.83M|}
ihevc_inter_pred_luma_vert_w16inp:
  548|   931k|{
  549|   931k|    WORD32 row, col, i;
  550|   931k|    WORD32 i4_tmp;
  551|       |
  552|  8.13M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (552:18): [True: 7.20M, False: 931k]
  ------------------
  553|  7.20M|    {
  554|  66.2M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (554:22): [True: 59.0M, False: 7.20M]
  ------------------
  555|  59.0M|        {
  556|  59.0M|            i4_tmp = 0;
  557|   525M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   525M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (557:24): [True: 466M, False: 59.0M]
  ------------------
  558|   466M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  559|       |
  560|  59.0M|            i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  59.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  59.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  59.0M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  59.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  59.0M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  59.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  59.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  561|  59.0M|            i4_tmp = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  59.0M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  59.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 522k, False: 58.5M]
  |  |  |  |  |  Branch (40:53): [True: 1.16M, False: 57.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  562|       |
  563|  59.0M|            pu1_dst[col] = i4_tmp;
  564|  59.0M|        }
  565|       |
  566|  7.20M|        pi2_src += src_strd;
  567|  7.20M|        pu1_dst += dst_strd;
  568|  7.20M|    }
  569|       |
  570|   931k|}
ihevc_inter_pred_luma_vert_w16inp_w16out:
  623|  1.49M|{
  624|  1.49M|    WORD32 row, col, i;
  625|  1.49M|    WORD32 i4_tmp;
  626|       |
  627|  13.4M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (627:18): [True: 11.9M, False: 1.49M]
  ------------------
  628|  11.9M|    {
  629|   123M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (629:22): [True: 111M, False: 11.9M]
  ------------------
  630|   111M|        {
  631|   111M|            i4_tmp = 0;
  632|   995M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   995M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (632:24): [True: 884M, False: 111M]
  ------------------
  633|   884M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  634|       |
  635|   111M|            i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) - OFFSET14;
  ------------------
  |  |   41|   111M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   111M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) - OFFSET14;
  ------------------
  |  |   43|   111M|#define OFFSET14 (1 << (14 - 1))
  ------------------
  636|       |
  637|   111M|            pi2_dst[col] = i4_tmp;
  638|   111M|        }
  639|       |
  640|  11.9M|        pi2_src += src_strd;
  641|  11.9M|        pi2_dst += dst_strd;
  642|  11.9M|    }
  643|       |
  644|  1.49M|}
ihevc_inter_pred_chroma_copy:
  695|   322k|{
  696|   322k|    WORD32 row, col;
  697|   322k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   322k|#define UNUSED(x) ((void)(x))
  ------------------
  698|  1.64M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (698:18): [True: 1.32M, False: 322k]
  ------------------
  699|  1.32M|    {
  700|  15.0M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (700:22): [True: 13.7M, False: 1.32M]
  ------------------
  701|  13.7M|        {
  702|  13.7M|            pu1_dst[col] = pu1_src[col];
  703|  13.7M|        }
  704|       |
  705|  1.32M|        pu1_src += src_strd;
  706|  1.32M|        pu1_dst += dst_strd;
  707|  1.32M|    }
  708|   322k|}
ihevc_inter_pred_chroma_horz:
  760|   284k|{
  761|   284k|    WORD32 row, col, i;
  762|   284k|    WORD16 i2_tmp_u, i2_tmp_v;
  763|       |
  764|  1.42M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (764:18): [True: 1.14M, False: 284k]
  ------------------
  765|  1.14M|    {
  766|  6.27M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (766:22): [True: 5.13M, False: 1.14M]
  ------------------
  767|  5.13M|        {
  768|  5.13M|            i2_tmp_u = 0;
  769|  5.13M|            i2_tmp_v = 0;
  770|  25.6M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  25.6M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (770:24): [True: 20.4M, False: 5.13M]
  ------------------
  771|  20.4M|            {
  772|  20.4M|                i2_tmp_u += pi1_coeff[i] * pu1_src[col + (i - 1) * 2];
  773|  20.4M|                i2_tmp_v += pi1_coeff[i] * pu1_src[col + 1 + (i - 1) * 2];
  774|  20.4M|            }
  775|       |
  776|  5.13M|            i2_tmp_u = (i2_tmp_u + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  5.13M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  5.13M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  5.13M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp_u = (i2_tmp_u + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  5.13M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.13M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  777|  5.13M|            i2_tmp_u = CLIP_U8(i2_tmp_u);
  ------------------
  |  |   40|  5.13M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.13M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 17.8k, False: 5.11M]
  |  |  |  |  |  Branch (40:53): [True: 18.2k, False: 5.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|  5.13M|            i2_tmp_v = (i2_tmp_v + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  5.13M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  5.13M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  5.13M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp_v = (i2_tmp_v + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  5.13M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.13M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  779|  5.13M|            i2_tmp_v = CLIP_U8(i2_tmp_v);
  ------------------
  |  |   40|  5.13M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.13M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 18.1k, False: 5.11M]
  |  |  |  |  |  Branch (40:53): [True: 21.1k, False: 5.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  780|       |
  781|       |
  782|  5.13M|            pu1_dst[col] = (UWORD8)i2_tmp_u;
  783|  5.13M|            pu1_dst[col + 1] = (UWORD8)i2_tmp_v;
  784|  5.13M|        }
  785|       |
  786|  1.14M|        pu1_src += src_strd;
  787|  1.14M|        pu1_dst += dst_strd;
  788|  1.14M|    }
  789|   284k|}
ihevc_inter_pred_chroma_vert:
  842|   691k|{
  843|   691k|    WORD32 row, col, i;
  844|   691k|    WORD16 i2_tmp;
  845|       |
  846|  3.35M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (846:18): [True: 2.66M, False: 691k]
  ------------------
  847|  2.66M|    {
  848|  24.6M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (848:22): [True: 22.0M, False: 2.66M]
  ------------------
  849|  22.0M|        {
  850|  22.0M|            i2_tmp = 0;
  851|   109M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   109M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (851:24): [True: 87.7M, False: 22.0M]
  ------------------
  852|  87.7M|            {
  853|  87.7M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 1) * src_strd];
  854|  87.7M|            }
  855|       |
  856|  22.0M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  22.0M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  22.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  22.0M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  22.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  857|  22.0M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  22.0M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  22.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 15.1k, False: 22.0M]
  |  |  |  |  |  Branch (40:53): [True: 459k, False: 21.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  858|       |
  859|  22.0M|            pu1_dst[col] = (UWORD8)i2_tmp;
  860|  22.0M|        }
  861|       |
  862|  2.66M|        pu1_src += src_strd;
  863|  2.66M|        pu1_dst += dst_strd;
  864|  2.66M|    }
  865|   691k|}
ihevc_inter_pred_chroma_copy_w16out:
  917|  39.1M|{
  918|  39.1M|    WORD32 row, col;
  919|  39.1M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  39.1M|#define UNUSED(x) ((void)(x))
  ------------------
  920|   191M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (920:18): [True: 152M, False: 39.1M]
  ------------------
  921|   152M|    {
  922|  1.47G|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (922:22): [True: 1.31G, False: 152M]
  ------------------
  923|  1.31G|        {
  924|  1.31G|            pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.31G|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.31G|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  925|  1.31G|        }
  926|       |
  927|   152M|        pu1_src += src_strd;
  928|   152M|        pi2_dst += dst_strd;
  929|   152M|    }
  930|  39.1M|}
ihevc_inter_pred_chroma_horz_w16out:
  983|  6.18M|{
  984|  6.18M|    WORD32 row, col, i;
  985|  6.18M|    WORD16 i2_tmp_u, i2_tmp_v;
  986|       |
  987|  41.9M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (987:18): [True: 35.7M, False: 6.18M]
  ------------------
  988|  35.7M|    {
  989|   190M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (989:22): [True: 154M, False: 35.7M]
  ------------------
  990|   154M|        {
  991|   154M|            i2_tmp_u = 0;
  992|   154M|            i2_tmp_v = 0;
  993|   770M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   770M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (993:24): [True: 616M, False: 154M]
  ------------------
  994|   616M|            {
  995|   616M|                i2_tmp_u += pi1_coeff[i] * pu1_src[col + (i - 1) * 2];
  996|   616M|                i2_tmp_v += pi1_coeff[i] * pu1_src[col + 1 + (i - 1) * 2];
  997|   616M|            }
  998|       |
  999|   154M|            pi2_dst[col] = i2_tmp_u;
 1000|   154M|            pi2_dst[col + 1] = i2_tmp_v;
 1001|   154M|        }
 1002|       |
 1003|  35.7M|        pu1_src += src_strd;
 1004|  35.7M|        pi2_dst += dst_strd;
 1005|  35.7M|    }
 1006|  6.18M|}
ihevc_inter_pred_chroma_vert_w16out:
 1059|  2.50M|{
 1060|  2.50M|    WORD32 row, col, i;
 1061|  2.50M|    WORD16 i2_tmp;
 1062|       |
 1063|  11.6M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1063:18): [True: 9.13M, False: 2.50M]
  ------------------
 1064|  9.13M|    {
 1065|  85.8M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1065:22): [True: 76.6M, False: 9.13M]
  ------------------
 1066|  76.6M|        {
 1067|  76.6M|            i2_tmp = 0;
 1068|   381M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   381M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1068:24): [True: 305M, False: 76.6M]
  ------------------
 1069|   305M|            {
 1070|   305M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 1) * src_strd];
 1071|   305M|            }
 1072|       |
 1073|  76.6M|            pi2_dst[col] = i2_tmp;
 1074|  76.6M|        }
 1075|       |
 1076|  9.13M|        pu1_src += src_strd;
 1077|  9.13M|        pi2_dst += dst_strd;
 1078|  9.13M|    }
 1079|  2.50M|}
ihevc_inter_pred_chroma_vert_w16inp:
 1130|  1.52M|{
 1131|  1.52M|    WORD32 row, col, i;
 1132|  1.52M|    WORD32 i4_tmp;
 1133|       |
 1134|  7.60M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1134:18): [True: 6.07M, False: 1.52M]
  ------------------
 1135|  6.07M|    {
 1136|  56.7M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1136:22): [True: 50.7M, False: 6.07M]
  ------------------
 1137|  50.7M|        {
 1138|  50.7M|            i4_tmp = 0;
 1139|   253M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   253M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1139:24): [True: 202M, False: 50.7M]
  ------------------
 1140|   202M|            {
 1141|   202M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 1) * src_strd];
 1142|   202M|            }
 1143|       |
 1144|  50.7M|            i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  50.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  50.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  50.7M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  50.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  50.7M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  50.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  50.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1145|  50.7M|            i4_tmp = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  50.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  50.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 62.7k, False: 50.6M]
  |  |  |  |  |  Branch (40:53): [True: 405k, False: 50.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1146|       |
 1147|  50.7M|            pu1_dst[col] = i4_tmp;
 1148|  50.7M|        }
 1149|       |
 1150|  6.07M|        pi2_src += src_strd;
 1151|  6.07M|        pu1_dst += dst_strd;
 1152|  6.07M|    }
 1153|       |
 1154|  1.52M|}
ihevc_inter_pred_chroma_vert_w16inp_w16out:
 1207|  2.22M|{
 1208|  2.22M|    WORD32 row, col, i;
 1209|  2.22M|    WORD32 i4_tmp;
 1210|       |
 1211|  11.3M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1211:18): [True: 9.13M, False: 2.22M]
  ------------------
 1212|  9.13M|    {
 1213|  95.4M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1213:22): [True: 86.3M, False: 9.13M]
  ------------------
 1214|  86.3M|        {
 1215|  86.3M|            i4_tmp = 0;
 1216|   431M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   431M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1216:24): [True: 344M, False: 86.3M]
  ------------------
 1217|   344M|            {
 1218|   344M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 1) * src_strd];
 1219|   344M|            }
 1220|       |
 1221|  86.3M|            i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  86.3M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  86.3M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1222|       |
 1223|  86.3M|            pi2_dst[col] = i4_tmp;
 1224|  86.3M|        }
 1225|       |
 1226|  9.13M|        pi2_src += src_strd;
 1227|  9.13M|        pi2_dst += dst_strd;
 1228|  9.13M|    }
 1229|       |
 1230|  2.22M|}

ihevc_intra_pred_luma_ref_subst_all_avlble:
  120|   852k|{
  121|       |
  122|   852k|    WORD32 i;
  123|   852k|    WORD32 two_nt = 2 * nt;
  124|   852k|    UNUSED(nbr_flags);
  ------------------
  |  |   38|   852k|#define UNUSED(x) ((void)(x))
  ------------------
  125|   852k|    UNUSED(dst_strd);
  ------------------
  |  |   38|   852k|#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|   852k|    ASSERT((nbr_flags == 0x11188) || (nbr_flags == 0x133CC) || (nbr_flags == 0x1FFFF));
  ------------------
  |  |   55|   852k|#define ASSERT(x) {}
  ------------------
  133|   852k|    {
  134|       |
  135|   852k|        if(nt == 4)
  ------------------
  |  Branch (135:12): [True: 392k, False: 460k]
  ------------------
  136|   392k|        {
  137|       |            /* 1 bit extraction for all the neighboring blocks */
  138|       |
  139|       |
  140|       |            /* Else fill the corresponding samples */
  141|   392k|            pu1_dst[two_nt] = *pu1_top_left;
  142|       |            //if(left)
  143|   392k|            {
  144|  1.96M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (144:28): [True: 1.56M, False: 392k]
  ------------------
  145|  1.56M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  146|   392k|            }
  147|       |//            if(bot_left)
  148|   392k|            {
  149|  1.96M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (149:29): [True: 1.56M, False: 392k]
  ------------------
  150|  1.56M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  151|   392k|            }
  152|       |//            if(top)
  153|   392k|            {
  154|   392k|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  155|   392k|            }
  156|       |//            if(tp_right)
  157|   392k|            {
  158|   392k|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  159|   392k|            }
  160|       |
  161|       |
  162|   392k|        }
  163|   460k|        else
  164|       |
  165|   460k|        {
  166|       |
  167|       |            /* Else fill the corresponding samples */
  168|   460k|            ASSERT((nt == 8) || (nt == 16) || (nt == 32));
  ------------------
  |  |   55|   460k|#define ASSERT(x) {}
  ------------------
  169|   460k|            pu1_dst[two_nt] = *pu1_top_left;
  170|       |
  171|  9.75M|            for(i = 0; i < nt; i++)
  ------------------
  |  Branch (171:24): [True: 9.29M, False: 460k]
  ------------------
  172|  9.29M|                pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  173|       |
  174|  9.77M|            for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (174:25): [True: 9.30M, False: 460k]
  ------------------
  175|  9.30M|                pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  176|       |
  177|   460k|            memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  178|       |
  179|   460k|            memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  180|   460k|        }
  181|       |
  182|   852k|    }
  183|   852k|}
ihevc_intra_pred_luma_ref_substitution:
  194|  4.54M|{
  195|  4.54M|    UWORD8 pu1_ref;
  196|  4.54M|    WORD32 dc_val, i;
  197|  4.54M|    WORD32 total_samples = (4 * nt) + 1;
  198|  4.54M|    WORD32 two_nt = 2 * nt;
  199|       |
  200|  4.54M|    WORD32 three_nt = 3 * nt;
  201|  4.54M|    WORD32 get_bits;
  202|  4.54M|    WORD32 next;
  203|  4.54M|    WORD32 bot_left, left, top, tp_right, tp_left;
  204|       |
  205|  4.54M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  206|  4.54M|    UNUSED(dst_strd);
  ------------------
  |  |   38|  4.54M|#define UNUSED(x) ((void)(x))
  ------------------
  207|       |    /*dc_val = 1 << (BIT_DEPTH - 1);*/
  208|  4.54M|    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.54M|    if(nbr_flags == 0)
  ------------------
  |  Branch (217:8): [True: 35.5k, False: 4.50M]
  ------------------
  218|  35.5k|    {
  219|  2.33M|        for(i = 0; i < total_samples; i++)
  ------------------
  |  Branch (219:20): [True: 2.29M, False: 35.5k]
  ------------------
  220|  2.29M|        {
  221|  2.29M|            pu1_dst[i] = dc_val;
  222|  2.29M|        }
  223|  35.5k|    }
  224|  4.50M|    else
  225|  4.50M|    {
  226|  4.50M|        if(nt <= 8)
  ------------------
  |  Branch (226:12): [True: 2.70M, False: 1.79M]
  ------------------
  227|  2.70M|        {
  228|       |            /* 1 bit extraction for all the neighboring blocks */
  229|  2.70M|            tp_left = (nbr_flags & 0x10000) >> 16;
  230|  2.70M|            bot_left = (nbr_flags & 0x8) >> 3;
  231|  2.70M|            left = (nbr_flags & 0x80) >> 7;
  232|  2.70M|            top = (nbr_flags & 0x100) >> 8;
  233|  2.70M|            tp_right = (nbr_flags & 0x1000) >> 12;
  234|       |
  235|       |            /* Else fill the corresponding samples */
  236|  2.70M|            if(tp_left)
  ------------------
  |  Branch (236:16): [True: 2.44M, False: 265k]
  ------------------
  237|  2.44M|                pu1_dst[two_nt] = *pu1_top_left;
  238|   265k|            else
  239|   265k|                pu1_dst[two_nt] = 0;
  240|       |
  241|       |
  242|  2.70M|            if(left)
  ------------------
  |  Branch (242:16): [True: 2.59M, False: 115k]
  ------------------
  243|  2.59M|            {
  244|  15.8M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (244:28): [True: 13.2M, False: 2.59M]
  ------------------
  245|  13.2M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  246|  2.59M|            }
  247|   115k|            else
  248|   115k|            {
  249|   115k|                memset(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  250|   115k|            }
  251|       |
  252|       |
  253|  2.70M|            if(bot_left)
  ------------------
  |  Branch (253:16): [True: 425k, False: 2.28M]
  ------------------
  254|   425k|            {
  255|  2.63M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (255:29): [True: 2.21M, False: 425k]
  ------------------
  256|  2.21M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  257|   425k|            }
  258|  2.28M|            else
  259|  2.28M|            {
  260|  2.28M|                memset(&pu1_dst[two_nt - 1 - (two_nt - 1)], 0, nt);
  261|  2.28M|            }
  262|       |
  263|       |
  264|  2.70M|            if(top)
  ------------------
  |  Branch (264:16): [True: 2.55M, False: 153k]
  ------------------
  265|  2.55M|            {
  266|  2.55M|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  267|  2.55M|            }
  268|   153k|            else
  269|   153k|            {
  270|   153k|                memset(&pu1_dst[two_nt + 1], 0, nt);
  271|   153k|            }
  272|       |
  273|  2.70M|            if(tp_right)
  ------------------
  |  Branch (273:16): [True: 1.48M, False: 1.22M]
  ------------------
  274|  1.48M|            {
  275|  1.48M|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  276|  1.48M|            }
  277|  1.22M|            else
  278|  1.22M|            {
  279|  1.22M|                memset(&pu1_dst[two_nt + 1 + nt], 0, nt);
  280|  1.22M|            }
  281|  2.70M|            next = 1;
  282|       |
  283|       |            /* If bottom -left is not available, reverse substitution process*/
  284|  2.70M|            if(bot_left == 0)
  ------------------
  |  Branch (284:16): [True: 2.28M, False: 426k]
  ------------------
  285|  2.28M|            {
  286|  2.28M|                WORD32 a_nbr_flag[5];
  287|  2.28M|                a_nbr_flag[0] = bot_left;
  288|  2.28M|                a_nbr_flag[1] = left;
  289|  2.28M|                a_nbr_flag[2] = tp_left;
  290|  2.28M|                a_nbr_flag[3] = top;
  291|  2.28M|                a_nbr_flag[4] = tp_right;
  292|       |
  293|       |                /* Check for the 1st available sample from bottom-left*/
  294|  2.51M|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (294:23): [True: 229k, False: 2.28M]
  ------------------
  295|   229k|                    next++;
  296|       |
  297|       |                /* If Left, top-left are available*/
  298|  2.28M|                if(next <= 2)
  ------------------
  |  Branch (298:20): [True: 2.16M, False: 113k]
  ------------------
  299|  2.16M|                {
  300|  2.16M|                    idx = nt * next;
  301|  2.16M|                    pu1_ref = pu1_dst[idx];
  302|  13.2M|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (302:32): [True: 11.0M, False: 2.16M]
  ------------------
  303|  11.0M|                        pu1_dst[i] = pu1_ref;
  304|  2.16M|                }
  305|   113k|                else /* If top, top-right are available */
  306|   113k|                {
  307|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available*/
  308|   113k|                    idx = (nt * (next - 1)) + 1;
  309|   113k|                    pu1_ref = pu1_dst[idx];
  310|  1.33M|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (310:32): [True: 1.21M, False: 113k]
  ------------------
  311|  1.21M|                        pu1_dst[i] = pu1_ref;
  312|   113k|                }
  313|  2.28M|            }
  314|       |
  315|       |            /* Forward Substitution Process */
  316|       |            /* If left is Unavailable, copy the last bottom-left value */
  317|  2.70M|            if(left == 0)
  ------------------
  |  Branch (317:16): [True: 114k, False: 2.59M]
  ------------------
  318|   114k|            {
  319|   114k|                memset(&pu1_dst[nt], pu1_dst[nt - 1], nt);
  320|       |
  321|   114k|            }
  322|       |            /* If top-left is Unavailable, copy the last left value */
  323|  2.70M|            if(tp_left == 0)
  ------------------
  |  Branch (323:16): [True: 266k, False: 2.44M]
  ------------------
  324|   266k|                pu1_dst[two_nt] = pu1_dst[two_nt - 1];
  325|       |            /* If top is Unavailable, copy the last top-left value */
  326|  2.70M|            if(top == 0)
  ------------------
  |  Branch (326:16): [True: 152k, False: 2.55M]
  ------------------
  327|   152k|            {
  328|   152k|                memset(&pu1_dst[two_nt + 1], pu1_dst[two_nt], nt);
  329|   152k|            }
  330|       |            /* If to right is Unavailable, copy the last top value */
  331|  2.70M|            if(tp_right == 0)
  ------------------
  |  Branch (331:16): [True: 1.23M, False: 1.47M]
  ------------------
  332|  1.23M|            {
  333|  1.23M|                memset(&pu1_dst[three_nt + 1], pu1_dst[three_nt], nt);
  334|       |
  335|  1.23M|            }
  336|  2.70M|        }
  337|       |
  338|  4.50M|        if(nt == 16)
  ------------------
  |  Branch (338:12): [True: 870k, False: 3.63M]
  ------------------
  339|   870k|        {
  340|   870k|            WORD32 nbr_flags_temp = 0;
  341|   870k|            nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4)
  342|   870k|                            + ((nbr_flags & 0x300) >> 4)
  343|   870k|                            + ((nbr_flags & 0x3000) >> 6)
  344|   870k|                            + ((nbr_flags & 0x10000) >> 8);
  345|       |
  346|       |            /* Else fill the corresponding samples */
  347|   870k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (347:16): [True: 767k, False: 102k]
  ------------------
  348|   767k|                pu1_dst[two_nt] = *pu1_top_left;
  349|   102k|            else
  350|   102k|                pu1_dst[two_nt] = 0;
  351|       |
  352|   870k|            if(nbr_flags & 0xC0)
  ------------------
  |  Branch (352:16): [True: 834k, False: 35.8k]
  ------------------
  353|   834k|            {
  354|  14.1M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (354:28): [True: 13.3M, False: 834k]
  ------------------
  355|  13.3M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  356|   834k|            }
  357|  35.8k|            else
  358|  35.8k|            {
  359|  35.8k|                memset(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  360|  35.8k|            }
  361|       |
  362|       |            /* Bottom - left availability is checked for every 8x8 TU position and set accordingly */
  363|   870k|            {
  364|   870k|                if(nbr_flags & 0x8)
  ------------------
  |  Branch (364:20): [True: 162k, False: 707k]
  ------------------
  365|   162k|                {
  366|  1.45M|                    for(i = nt; i < (nt + 8); i++)
  ------------------
  |  Branch (366:33): [True: 1.29M, False: 162k]
  ------------------
  367|  1.29M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  368|   162k|                }
  369|   707k|                else
  370|   707k|                {
  371|   707k|                    memset(&pu1_dst[nt - 8], 0, 8);
  372|   707k|                }
  373|       |
  374|   870k|                if(nbr_flags & 0x4)
  ------------------
  |  Branch (374:20): [True: 161k, False: 709k]
  ------------------
  375|   161k|                {
  376|  1.44M|                    for(i = (nt + 8); i < two_nt; i++)
  ------------------
  |  Branch (376:39): [True: 1.28M, False: 161k]
  ------------------
  377|  1.28M|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  378|   161k|                }
  379|   709k|                else
  380|   709k|                {
  381|   709k|                    memset(&pu1_dst[0], 0, 8);
  382|   709k|                }
  383|   870k|            }
  384|       |
  385|   870k|            if(nbr_flags & 0x300)
  ------------------
  |  Branch (385:16): [True: 802k, False: 68.0k]
  ------------------
  386|   802k|            {
  387|   802k|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  388|   802k|            }
  389|  68.0k|            else
  390|  68.0k|            {
  391|  68.0k|                memset(&pu1_dst[two_nt + 1], 0, nt);
  392|  68.0k|            }
  393|       |
  394|   870k|            if(nbr_flags & 0x3000)
  ------------------
  |  Branch (394:16): [True: 478k, False: 391k]
  ------------------
  395|   478k|            {
  396|   478k|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  397|   478k|            }
  398|   391k|            else
  399|   391k|            {
  400|   391k|                memset(&pu1_dst[two_nt + 1 + nt], 0, nt);
  401|   391k|            }
  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|   870k|            {
  405|   870k|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 8; /* for below left and left */
  ------------------
  |  |   43|   870k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 36.0k, False: 834k]
  |  |  ------------------
  ------------------
  406|       |
  407|   870k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (407:20): [True: 36.0k, False: 834k]
  ------------------
  408|  36.0k|                    nbr_id_from_bl = 32;
  409|       |
  410|   870k|                if(nbr_id_from_bl == 32)
  ------------------
  |  Branch (410:20): [True: 36.0k, False: 834k]
  ------------------
  411|  36.0k|                {
  412|       |                    /* for top left : 1 pel per nbr bit */
  413|  36.0k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (413:24): [True: 35.7k, False: 213]
  ------------------
  414|  35.7k|                    {
  415|  35.7k|                        nbr_id_from_bl++;
  416|  35.7k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 8; /* top and top right;  8 pels per nbr bit */
  ------------------
  |  |   43|  35.7k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 35.7k]
  |  |  ------------------
  ------------------
  417|       |                        //nbr_id_from_bl += idx * 8;
  418|  35.7k|                    }
  419|  36.0k|                }
  420|       |                /* Reverse Substitution Process*/
  421|   870k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (421:20): [True: 710k, False: 159k]
  ------------------
  422|   710k|                {
  423|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  424|   710k|                    pu1_ref = pu1_dst[nbr_id_from_bl];
  425|  12.6M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (425:51): [True: 11.9M, False: 710k]
  ------------------
  426|  11.9M|                    {
  427|  11.9M|                        pu1_dst[i] = pu1_ref;
  428|  11.9M|                    }
  429|   710k|                }
  430|   870k|            }
  431|       |
  432|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  433|  7.17M|            while(nbr_id_from_bl < ((T16_4NT)+1))
  ------------------
  |  |   71|  7.17M|#define T16_4NT 64
  ------------------
  |  Branch (433:19): [True: 6.29M, False: 870k]
  ------------------
  434|  6.29M|            {
  435|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  436|       |                /* Devide by 8 to obtain the original index */
  437|  6.29M|                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|  6.29M|                if(nbr_id_from_bl == (T16_4NT / 2))
  ------------------
  |  |   71|  6.29M|#define T16_4NT 64
  ------------------
  |  Branch (440:20): [True: 834k, False: 5.46M]
  ------------------
  441|   834k|                {
  442|   834k|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|   834k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  443|       |
  444|       |                    /* only pel substitution for TL */
  445|   834k|                    if(!get_bits)
  ------------------
  |  Branch (445:24): [True: 67.1k, False: 767k]
  ------------------
  446|  67.1k|                        pu1_dst[nbr_id_from_bl] = pu1_dst[nbr_id_from_bl - 1];
  447|   834k|                }
  448|  5.46M|                else
  449|  5.46M|                {
  450|  5.46M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  5.46M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  451|  5.46M|                    if(!get_bits)
  ------------------
  |  Branch (451:24): [True: 924k, False: 4.54M]
  ------------------
  452|   924k|                    {
  453|       |                        /* 8 pel substitution (other than TL) */
  454|   924k|                        pu1_ref = pu1_dst[nbr_id_from_bl - 1];
  455|   924k|                        memset(pu1_dst + nbr_id_from_bl, pu1_ref, 8);
  456|       |
  457|       |
  458|   924k|                    }
  459|       |
  460|  5.46M|                }
  461|  6.29M|                nbr_id_from_bl += (nbr_id_from_bl == (T16_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   71|  6.29M|#define T16_4NT 64
  ------------------
  |  Branch (461:35): [True: 834k, False: 5.46M]
  ------------------
  462|  6.29M|            }
  463|       |
  464|       |
  465|   870k|        }
  466|       |
  467|  4.50M|        if(nt == 32)
  ------------------
  |  Branch (467:12): [True: 942k, False: 3.56M]
  ------------------
  468|   942k|        {
  469|       |            /* Else fill the corresponding samples */
  470|   942k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (470:16): [True: 752k, False: 189k]
  ------------------
  471|   752k|                pu1_dst[two_nt] = *pu1_top_left;
  472|   189k|            else
  473|   189k|                pu1_dst[two_nt] = 0;
  474|       |
  475|   942k|            if(nbr_flags & 0xF0)
  ------------------
  |  Branch (475:16): [True: 914k, False: 27.2k]
  ------------------
  476|   914k|            {
  477|  30.0M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (477:28): [True: 29.1M, False: 914k]
  ------------------
  478|  29.1M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  479|   914k|            }
  480|  27.2k|            else
  481|  27.2k|            {
  482|  27.2k|                memset(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  483|  27.2k|            }
  484|       |
  485|       |            /* Bottom - left availability is checked for every 8x8 TU position and set accordingly */
  486|   942k|            {
  487|   942k|                if(nbr_flags & 0x8)
  ------------------
  |  Branch (487:20): [True: 76.9k, False: 865k]
  ------------------
  488|  76.9k|                {
  489|   692k|                    for(i = nt; i < (nt + 8); i++)
  ------------------
  |  Branch (489:33): [True: 615k, False: 76.9k]
  ------------------
  490|   615k|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  491|  76.9k|                }
  492|   865k|                else
  493|   865k|                {
  494|   865k|                    memset(&pu1_dst[24], 0, 8);
  495|   865k|                }
  496|       |
  497|   942k|                if(nbr_flags & 0x4)
  ------------------
  |  Branch (497:20): [True: 76.4k, False: 865k]
  ------------------
  498|  76.4k|                {
  499|   688k|                    for(i = (nt + 8); i < (nt + 16); i++)
  ------------------
  |  Branch (499:39): [True: 611k, False: 76.4k]
  ------------------
  500|   611k|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  501|  76.4k|                }
  502|   865k|                else
  503|   865k|                {
  504|   865k|                    memset(&pu1_dst[16], 0, 8);
  505|   865k|                }
  506|       |
  507|   942k|                if(nbr_flags & 0x2)
  ------------------
  |  Branch (507:20): [True: 76.3k, False: 865k]
  ------------------
  508|  76.3k|                {
  509|   687k|                    for(i = (nt + 16); i < (nt + 24); i++)
  ------------------
  |  Branch (509:40): [True: 611k, False: 76.3k]
  ------------------
  510|   611k|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  511|  76.3k|                }
  512|   865k|                else
  513|   865k|                {
  514|   865k|                    memset(&pu1_dst[8], 0, 8);
  515|   865k|                }
  516|       |
  517|   942k|                if(nbr_flags & 0x1)
  ------------------
  |  Branch (517:20): [True: 76.3k, False: 865k]
  ------------------
  518|  76.3k|                {
  519|   687k|                    for(i = (nt + 24); i < (two_nt); i++)
  ------------------
  |  Branch (519:40): [True: 611k, False: 76.3k]
  ------------------
  520|   611k|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  521|  76.3k|                }
  522|   865k|                else
  523|   865k|                {
  524|   865k|                    memset(&pu1_dst[0], 0, 8);
  525|   865k|                }
  526|   942k|            }
  527|       |
  528|       |
  529|   942k|            if(nbr_flags & 0xF00)
  ------------------
  |  Branch (529:16): [True: 781k, False: 160k]
  ------------------
  530|   781k|            {
  531|   781k|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  532|   781k|            }
  533|   160k|            else
  534|   160k|            {
  535|   160k|                memset(&pu1_dst[two_nt + 1], 0, nt);
  536|   160k|            }
  537|       |
  538|   942k|            if(nbr_flags & 0xF000)
  ------------------
  |  Branch (538:16): [True: 502k, False: 439k]
  ------------------
  539|   502k|            {
  540|   502k|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  541|   502k|            }
  542|   439k|            else
  543|   439k|            {
  544|   439k|                memset(&pu1_dst[two_nt + 1 + nt], 0, nt);
  545|   439k|            }
  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|   942k|            {
  549|   942k|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 8; /* for below left and left */
  ------------------
  |  |   43|   942k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 27.3k, False: 914k]
  |  |  ------------------
  ------------------
  550|       |
  551|   942k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (551:20): [True: 27.3k, False: 914k]
  ------------------
  552|  27.3k|                {
  553|       |                    /* for top left : 1 pel per nbr bit */
  554|  27.3k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (554:24): [True: 27.0k, False: 266]
  ------------------
  555|  27.0k|                    {
  556|       |                        /* top left not available */
  557|  27.0k|                        nbr_id_from_bl++;
  558|       |                        /* top and top right;  8 pels per nbr bit */
  559|  27.0k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 8;
  ------------------
  |  |   43|  27.0k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 27.0k]
  |  |  ------------------
  ------------------
  560|  27.0k|                    }
  561|  27.3k|                }
  562|       |                /* Reverse Substitution Process*/
  563|   942k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (563:20): [True: 868k, False: 73.7k]
  ------------------
  564|   868k|                {
  565|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  566|   868k|                    pu1_ref = pu1_dst[nbr_id_from_bl];
  567|  29.5M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (567:51): [True: 28.6M, False: 868k]
  ------------------
  568|  28.6M|                        pu1_dst[i] = pu1_ref;
  569|   868k|                }
  570|   942k|            }
  571|       |
  572|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  573|  13.4M|            while(nbr_id_from_bl < ((T32_4NT)+1))
  ------------------
  |  |   70|  13.4M|#define T32_4NT 128
  ------------------
  |  Branch (573:19): [True: 12.4M, False: 942k]
  ------------------
  574|  12.4M|            {
  575|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  576|       |                /* Devide by 8 to obtain the original index */
  577|  12.4M|                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|  12.4M|                if(nbr_id_from_bl == (T32_4NT / 2))
  ------------------
  |  |   70|  12.4M|#define T32_4NT 128
  ------------------
  |  Branch (580:20): [True: 920k, False: 11.5M]
  ------------------
  581|   920k|                {
  582|   920k|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|   920k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  583|       |                    /* only pel substitution for TL */
  584|   920k|                    if(!get_bits)
  ------------------
  |  Branch (584:24): [True: 164k, False: 755k]
  ------------------
  585|   164k|                        pu1_dst[nbr_id_from_bl] = pu1_dst[nbr_id_from_bl - 1];
  586|   920k|                }
  587|  11.5M|                else
  588|  11.5M|                {
  589|  11.5M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  11.5M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  590|  11.5M|                    if(!get_bits)
  ------------------
  |  Branch (590:24): [True: 2.44M, False: 9.10M]
  ------------------
  591|  2.44M|                    {
  592|       |                        /* 8 pel substitution (other than TL) */
  593|  2.44M|                        pu1_ref = pu1_dst[nbr_id_from_bl - 1];
  594|  2.44M|                        memset(&pu1_dst[nbr_id_from_bl], pu1_ref, 8);
  595|       |
  596|  2.44M|                    }
  597|       |
  598|  11.5M|                }
  599|  12.4M|                nbr_id_from_bl += (nbr_id_from_bl == (T32_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   70|  12.4M|#define T32_4NT 128
  ------------------
  |  Branch (599:35): [True: 919k, False: 11.5M]
  ------------------
  600|  12.4M|            }
  601|   942k|        }
  602|       |
  603|  4.50M|    }
  604|  4.54M|}
ihevc_intra_pred_ref_filtering:
  649|  2.24M|{
  650|  2.24M|    WORD32 filter_flag;
  651|  2.24M|    WORD32 i; /* Generic indexing variable */
  652|  2.24M|    WORD32 four_nt = 4 * nt;
  653|  2.24M|    UWORD8 au1_flt[(4 * MAX_CU_SIZE) + 1];
  654|  2.24M|    WORD32 bi_linear_int_flag = 0;
  655|  2.24M|    WORD32 abs_cond_left_flag = 0;
  656|  2.24M|    WORD32 abs_cond_top_flag = 0;
  657|       |    /*WORD32 dc_val = 1 << (BIT_DEPTH - 5);*/
  658|  2.24M|    WORD32 dc_val = 1 << (8 - 5);
  659|  2.24M|    WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3);
  660|  2.24M|    WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1;
  661|       |
  662|  2.24M|    filter_flag = intra_smoothing_disabled ?
  ------------------
  |  Branch (662:19): [True: 8.07k, False: 2.23M]
  ------------------
  663|  2.23M|                    0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)));
  664|  2.24M|    if(0 == filter_flag)
  ------------------
  |  Branch (664:8): [True: 1.61M, False: 626k]
  ------------------
  665|  1.61M|    {
  666|  1.61M|        if(pu1_src == pu1_dst)
  ------------------
  |  Branch (666:12): [True: 1.62M, False: 18.4E]
  ------------------
  667|  1.62M|        {
  668|  1.62M|            return;
  669|  1.62M|        }
  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.61M|    }
  676|       |
  677|   626k|    else
  678|   626k|    {
  679|       |        /* If strong intra smoothin is enabled and transform size is 32 */
  680|   626k|        if((1 == strong_intra_smoothing_enable_flag) && (32 == nt))
  ------------------
  |  Branch (680:12): [True: 459k, False: 166k]
  |  Branch (680:57): [True: 122k, False: 337k]
  ------------------
  681|   122k|        {
  682|       |            /* Strong Intra Filtering */
  683|   122k|            abs_cond_top_flag = (ABS(pu1_src[2 * nt] + pu1_src[4 * nt]
  ------------------
  |  |   45|   122k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 27.3k, False: 94.9k]
  |  |  ------------------
  ------------------
  684|   122k|                            - (2 * pu1_src[3 * nt]))) < dc_val;
  685|   122k|            abs_cond_left_flag = (ABS(pu1_src[2 * nt] + pu1_src[0]
  ------------------
  |  |   45|   122k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 25.3k, False: 96.9k]
  |  |  ------------------
  ------------------
  686|   122k|                            - (2 * pu1_src[nt]))) < dc_val;
  687|       |
  688|   122k|            bi_linear_int_flag = ((1 == abs_cond_left_flag)
  ------------------
  |  Branch (688:35): [True: 79.5k, False: 42.7k]
  ------------------
  689|  79.5k|                            && (1 == abs_cond_top_flag));
  ------------------
  |  Branch (689:32): [True: 66.7k, False: 12.7k]
  ------------------
  690|   122k|        }
  691|       |        /* Extremities Untouched*/
  692|   626k|        au1_flt[0] = pu1_src[0];
  693|   626k|        au1_flt[4 * nt] = pu1_src[4 * nt];
  694|       |
  695|       |        /* Strong filtering of reference samples */
  696|   626k|        if(1 == bi_linear_int_flag)
  ------------------
  |  Branch (696:12): [True: 66.7k, False: 559k]
  ------------------
  697|  66.7k|        {
  698|  66.7k|            au1_flt[2 * nt] = pu1_src[2 * nt];
  699|       |
  700|  4.26M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (700:24): [True: 4.19M, False: 66.7k]
  ------------------
  701|  4.19M|                au1_flt[i] = (((2 * nt) - i) * pu1_src[0] + i * pu1_src[2 * nt] + 32) >> 6;
  702|       |
  703|  4.26M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (703:24): [True: 4.19M, False: 66.7k]
  ------------------
  704|  4.19M|                au1_flt[i + (2 * nt)] = (((2 * nt) - i) * pu1_src[2 * nt] + i * pu1_src[4 * nt] + 32) >> 6;
  705|       |
  706|  66.7k|        }
  707|   559k|        else
  708|   559k|        {
  709|       |            /* Perform bilinear filtering of Reference Samples */
  710|  43.0M|            for(i = 0; i < (four_nt - 1); i++)
  ------------------
  |  Branch (710:24): [True: 42.4M, False: 559k]
  ------------------
  711|  42.4M|            {
  712|  42.4M|                au1_flt[i + 1] = (pu1_src[i] + 2 * pu1_src[i + 1]
  713|  42.4M|                                + pu1_src[i + 2] + 2) >> 2;
  714|  42.4M|            }
  715|   559k|        }
  716|       |
  717|       |
  718|  52.7M|        for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (718:20): [True: 52.1M, False: 626k]
  ------------------
  719|  52.1M|            pu1_dst[i] = au1_flt[i];
  720|   626k|    }
  721|       |
  722|  2.24M|}
ihevc_intra_pred_luma_planar:
  769|   591k|{
  770|       |
  771|       |
  772|   591k|    WORD32 row, col;
  773|   591k|    WORD32 log2nt = 5;
  774|   591k|    WORD32 two_nt, three_nt;
  775|   591k|    UNUSED(src_strd);
  ------------------
  |  |   38|   591k|#define UNUSED(x) ((void)(x))
  ------------------
  776|   591k|    UNUSED(mode);
  ------------------
  |  |   38|   591k|#define UNUSED(x) ((void)(x))
  ------------------
  777|   591k|    switch(nt)
  778|   591k|    {
  779|   122k|        case 32:
  ------------------
  |  Branch (779:9): [True: 122k, False: 469k]
  ------------------
  780|   122k|            log2nt = 5;
  781|   122k|            break;
  782|   177k|        case 16:
  ------------------
  |  Branch (782:9): [True: 177k, False: 413k]
  ------------------
  783|   177k|            log2nt = 4;
  784|   177k|            break;
  785|  72.6k|        case 8:
  ------------------
  |  Branch (785:9): [True: 72.6k, False: 519k]
  ------------------
  786|  72.6k|            log2nt = 3;
  787|  72.6k|            break;
  788|   219k|        case 4:
  ------------------
  |  Branch (788:9): [True: 219k, False: 371k]
  ------------------
  789|   219k|            log2nt = 2;
  790|   219k|            break;
  791|      0|        default:
  ------------------
  |  Branch (791:9): [True: 0, False: 591k]
  ------------------
  792|      0|            break;
  793|   591k|    }
  794|   591k|    two_nt = 2 * nt;
  795|   591k|    three_nt = 3 * nt;
  796|       |    /* Planar filtering */
  797|  8.48M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (797:18): [True: 7.89M, False: 591k]
  ------------------
  798|  7.89M|    {
  799|   175M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (799:22): [True: 167M, False: 7.89M]
  ------------------
  800|   167M|        {
  801|   167M|            pu1_dst[row * dst_strd + col] = ((nt - 1 - col)
  802|   167M|                            * pu1_ref[two_nt - 1 - row]
  803|   167M|                            + (col + 1) * pu1_ref[three_nt + 1]
  804|   167M|                            + (nt - 1 - row) * pu1_ref[two_nt + 1 + col]
  805|   167M|                            + (row + 1) * pu1_ref[nt - 1] + nt) >> (log2nt + 1);
  806|   167M|        }
  807|  7.89M|    }
  808|   591k|}
ihevc_intra_pred_luma_dc:
  855|   281k|{
  856|       |
  857|   281k|    WORD32 acc_dc;
  858|   281k|    WORD32 dc_val, two_dc_val, three_dc_val;
  859|   281k|    WORD32 i;
  860|   281k|    WORD32 row, col;
  861|   281k|    WORD32 log2nt = 5;
  862|   281k|    WORD32 two_nt, three_nt;
  863|   281k|    UNUSED(mode);
  ------------------
  |  |   38|   281k|#define UNUSED(x) ((void)(x))
  ------------------
  864|   281k|    UNUSED(src_strd);
  ------------------
  |  |   38|   281k|#define UNUSED(x) ((void)(x))
  ------------------
  865|   281k|    switch(nt)
  866|   281k|    {
  867|  31.1k|        case 32:
  ------------------
  |  Branch (867:9): [True: 31.1k, False: 250k]
  ------------------
  868|  31.1k|            log2nt = 5;
  869|  31.1k|            break;
  870|  71.3k|        case 16:
  ------------------
  |  Branch (870:9): [True: 71.3k, False: 210k]
  ------------------
  871|  71.3k|            log2nt = 4;
  872|  71.3k|            break;
  873|  50.7k|        case 8:
  ------------------
  |  Branch (873:9): [True: 50.7k, False: 231k]
  ------------------
  874|  50.7k|            log2nt = 3;
  875|  50.7k|            break;
  876|   128k|        case 4:
  ------------------
  |  Branch (876:9): [True: 128k, False: 152k]
  ------------------
  877|   128k|            log2nt = 2;
  878|   128k|            break;
  879|      0|        default:
  ------------------
  |  Branch (879:9): [True: 0, False: 281k]
  ------------------
  880|      0|            break;
  881|   281k|    }
  882|   281k|    two_nt = 2 * nt;
  883|   281k|    three_nt = 3 * nt;
  884|       |
  885|   281k|    acc_dc = 0;
  886|       |    /* Calculate DC value for the transform block */
  887|  3.33M|    for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (887:17): [True: 3.05M, False: 281k]
  ------------------
  888|  3.05M|        acc_dc += pu1_ref[i];
  889|       |
  890|  3.33M|    for(i = (two_nt + 1); i <= three_nt; i++)
  ------------------
  |  Branch (890:27): [True: 3.05M, False: 281k]
  ------------------
  891|  3.05M|        acc_dc += pu1_ref[i];
  892|       |
  893|   281k|    dc_val = (acc_dc + nt) >> (log2nt + 1);
  894|       |
  895|   281k|    two_dc_val = 2 * dc_val;
  896|   281k|    three_dc_val = 3 * dc_val;
  897|       |
  898|       |
  899|   281k|    if(nt == 32)
  ------------------
  |  Branch (899:8): [True: 31.1k, False: 250k]
  ------------------
  900|  31.1k|    {
  901|  1.01M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (901:22): [True: 981k, False: 31.1k]
  ------------------
  902|  32.2M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (902:26): [True: 31.2M, False: 981k]
  ------------------
  903|  31.2M|                pu1_dst[(row * dst_strd) + col] = dc_val;
  904|  31.1k|    }
  905|   250k|    else
  906|   250k|    {
  907|       |        /* DC filtering for the first top row and first left column */
  908|   250k|        pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
  909|   250k|                        >> 2);
  910|       |
  911|  2.06M|        for(col = 1; col < nt; col++)
  ------------------
  |  Branch (911:22): [True: 1.80M, False: 250k]
  ------------------
  912|  1.80M|            pu1_dst[col] = (pu1_ref[two_nt + 1 + col] + three_dc_val + 2) >> 2;
  913|       |
  914|  2.06M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (914:22): [True: 1.80M, False: 250k]
  ------------------
  915|  1.80M|            pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
  916|  1.80M|                            >> 2;
  917|       |
  918|       |        /* Fill the remaining rows with DC value*/
  919|  2.05M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (919:22): [True: 1.80M, False: 250k]
  ------------------
  920|  21.4M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (920:26): [True: 19.6M, False: 1.80M]
  ------------------
  921|  19.6M|                pu1_dst[(row * dst_strd) + col] = dc_val;
  922|   250k|    }
  923|   281k|}
ihevc_intra_pred_luma_horz:
  971|  35.6k|{
  972|       |
  973|  35.6k|    WORD32 row, col;
  974|  35.6k|    WORD32 two_nt;
  975|  35.6k|    WORD16 s2_predpixel;
  976|  35.6k|    UNUSED(src_strd);
  ------------------
  |  |   38|  35.6k|#define UNUSED(x) ((void)(x))
  ------------------
  977|  35.6k|    two_nt = 2 * nt;
  978|       |
  979|  35.6k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (979:8): [True: 4.26k, False: 31.3k]
  |  Branch (979:20): [True: 1.67k, False: 29.6k]
  ------------------
  980|  5.94k|    {
  981|   149k|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (981:22): [True: 143k, False: 5.94k]
  ------------------
  982|  4.54M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (982:26): [True: 4.40M, False: 143k]
  ------------------
  983|  4.40M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];
  984|  5.94k|    }
  985|  29.6k|    else
  986|  29.6k|    {
  987|       |        /*Filtering done for the 1st row */
  988|   259k|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (988:22): [True: 229k, False: 29.6k]
  ------------------
  989|   229k|        {
  990|   229k|            s2_predpixel = pu1_ref[two_nt - 1]
  991|   229k|                            + ((pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt]) >> 1);
  992|   229k|            pu1_dst[col] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|   229k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   229k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 19.0k, False: 210k]
  |  |  |  |  |  Branch (40:53): [True: 12.0k, False: 198k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  993|   229k|        }
  994|       |
  995|       |        /* Replication to next rows*/
  996|   229k|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (996:22): [True: 199k, False: 29.6k]
  ------------------
  997|  2.47M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (997:26): [True: 2.27M, False: 199k]
  ------------------
  998|  2.27M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];
  999|  29.6k|    }
 1000|  35.6k|}
ihevc_intra_pred_luma_ver:
 1050|   285k|{
 1051|   285k|    WORD32 row, col;
 1052|   285k|    WORD16 s2_predpixel;
 1053|   285k|    WORD32 two_nt = 2 * nt;
 1054|   285k|    UNUSED(src_strd);
  ------------------
  |  |   38|   285k|#define UNUSED(x) ((void)(x))
  ------------------
 1055|       |
 1056|   285k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (1056:8): [True: 45.7k, False: 239k]
  |  Branch (1056:20): [True: 686, False: 238k]
  ------------------
 1057|  46.4k|    {
 1058|       |        /* Replication to next columns*/
 1059|  1.49M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1059:22): [True: 1.44M, False: 46.4k]
  ------------------
 1060|  47.4M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1060:26): [True: 46.0M, False: 1.44M]
  ------------------
 1061|  46.0M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt + 1 + col];
 1062|  46.4k|    }
 1063|   238k|    else
 1064|   238k|    {
 1065|       |        /*Filtering done for the 1st column */
 1066|  2.60M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1066:22): [True: 2.37M, False: 238k]
  ------------------
 1067|  2.37M|        {
 1068|  2.37M|            s2_predpixel = pu1_ref[two_nt + 1]
 1069|  2.37M|                            + ((pu1_ref[two_nt - 1 - row] - pu1_ref[two_nt]) >> 1);
 1070|  2.37M|            pu1_dst[row * dst_strd] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|  2.37M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.37M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 140k, False: 2.22M]
  |  |  |  |  |  Branch (40:53): [True: 80.4k, False: 2.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1071|  2.37M|        }
 1072|       |
 1073|       |        /* Replication to next columns*/
 1074|  2.60M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1074:22): [True: 2.36M, False: 238k]
  ------------------
 1075|  30.6M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (1075:26): [True: 28.3M, False: 2.36M]
  ------------------
 1076|  28.3M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt + 1 + col];
 1077|   238k|    }
 1078|   285k|}
ihevc_intra_pred_luma_mode2:
 1127|   128k|{
 1128|   128k|    WORD32 row, col;
 1129|   128k|    WORD32 two_nt = 2 * nt;
 1130|   128k|    WORD32 intra_pred_ang = 32;
 1131|   128k|    WORD32 idx = 0;
 1132|   128k|    UNUSED(mode);
  ------------------
  |  |   38|   128k|#define UNUSED(x) ((void)(x))
  ------------------
 1133|   128k|    UNUSED(src_strd);
  ------------------
  |  |   38|   128k|#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.56M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1136:18): [True: 1.43M, False: 128k]
  ------------------
 1137|  1.43M|    {
 1138|  1.43M|        idx = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
 1139|       |
 1140|  33.3M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1140:22): [True: 31.9M, False: 1.43M]
  ------------------
 1141|  31.9M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[two_nt - row - idx - 1];
 1142|  1.43M|    }
 1143|       |
 1144|   128k|}
ihevc_intra_pred_luma_mode_18_34:
 1191|  70.9k|{
 1192|  70.9k|    WORD32 row, col;
 1193|  70.9k|    WORD32 intra_pred_ang;
 1194|  70.9k|    WORD32 idx = 0;
 1195|  70.9k|    WORD32 two_nt = 2 * nt;
 1196|  70.9k|    UNUSED(src_strd);
  ------------------
  |  |   38|  70.9k|#define UNUSED(x) ((void)(x))
  ------------------
 1197|  70.9k|    intra_pred_ang = 32;    /*Default value*/
 1198|       |
 1199|       |    /* For mode 18, angle is -45degree */
 1200|  70.9k|    if(mode == 18)
  ------------------
  |  Branch (1200:8): [True: 31.7k, False: 39.2k]
  ------------------
 1201|  31.7k|        intra_pred_ang = -32;
 1202|       |    /* For mode 34, angle is 45degree */
 1203|  39.2k|    else if(mode == 34)
  ------------------
  |  Branch (1203:13): [True: 39.2k, False: 18.4E]
  ------------------
 1204|  39.2k|        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|   654k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1207:18): [True: 583k, False: 70.9k]
  ------------------
 1208|   583k|    {
 1209|   583k|        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|  8.96M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1216:22): [True: 8.37M, False: 583k]
  ------------------
 1217|  8.37M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[two_nt + col + idx + 1];
 1218|       |
 1219|   583k|    }
 1220|       |
 1221|  70.9k|}
ihevc_intra_pred_luma_mode_3_to_9:
 1268|   246k|{
 1269|   246k|    WORD32 row, col;
 1270|   246k|    WORD32 two_nt = 2 * nt;
 1271|   246k|    WORD32 intra_pred_ang;
 1272|   246k|    WORD32 idx, ref_main_idx;
 1273|   246k|    WORD32 pos, fract;
 1274|   246k|    UNUSED(src_strd);
  ------------------
  |  |   38|   246k|#define UNUSED(x) ((void)(x))
  ------------------
 1275|       |    /* Intra Pred Angle according to the mode */
 1276|   246k|    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.82M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1281:18): [True: 2.57M, False: 246k]
  ------------------
 1282|  2.57M|    {
 1283|  2.57M|        pos = ((col + 1) * intra_pred_ang);
 1284|  2.57M|        idx = pos >> 5;
 1285|  2.57M|        fract = pos & (31);
 1286|       |
 1287|       |        // Do linear filtering
 1288|  52.1M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1288:22): [True: 49.5M, False: 2.57M]
  ------------------
 1289|  49.5M|        {
 1290|  49.5M|            ref_main_idx = two_nt - row - idx - 1;
 1291|  49.5M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1292|  49.5M|                            * pu1_ref[ref_main_idx]
 1293|  49.5M|                            + fract * pu1_ref[ref_main_idx - 1] + 16) >> 5);
 1294|  49.5M|        }
 1295|       |
 1296|  2.57M|    }
 1297|       |
 1298|   246k|}
ihevc_intra_pred_luma_mode_11_to_17:
 1345|   188k|{
 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|   188k|    WORD32 row, col, k;
 1351|   188k|    WORD32 two_nt;
 1352|   188k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1353|   188k|    WORD32 idx, ref_main_idx, ref_idx;
 1354|   188k|    WORD32 pos, fract;
 1355|       |
 1356|   188k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 1];
 1357|   188k|    UWORD8 *ref_main;
 1358|   188k|    UNUSED(src_strd);
  ------------------
  |  |   38|   188k|#define UNUSED(x) ((void)(x))
  ------------------
 1359|   188k|    inv_ang_sum = 128;
 1360|   188k|    two_nt    = 2 * nt;
 1361|       |
 1362|   188k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1363|       |
 1364|   188k|    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|   188k|    ref_main = ref_temp + nt - 1;
 1370|  1.94M|    for(k = 0; k < nt + 1; k++)
  ------------------
  |  Branch (1370:16): [True: 1.75M, False: 188k]
  ------------------
 1371|  1.75M|        ref_temp[k + nt - 1] = pu1_ref[two_nt - k];
 1372|       |
 1373|   188k|    ref_main = ref_temp + nt - 1;
 1374|   188k|    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|   762k|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1379:17): [True: 574k, False: 188k]
  ------------------
 1380|   574k|    {
 1381|   574k|        inv_ang_sum += inv_ang;
 1382|   574k|        ref_main[k] = pu1_ref[two_nt + (inv_ang_sum >> 8)];
 1383|   574k|    }
 1384|       |
 1385|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1386|       |    /* samples dependent on distance to obtain destination sample */
 1387|  1.75M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1387:18): [True: 1.56M, False: 188k]
  ------------------
 1388|  1.56M|    {
 1389|  1.56M|        pos = ((col + 1) * intra_pred_ang);
 1390|  1.56M|        idx = pos >> 5;
 1391|  1.56M|        fract = pos & (31);
 1392|       |
 1393|       |        // Do linear filtering
 1394|  24.2M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1394:22): [True: 22.7M, False: 1.56M]
  ------------------
 1395|  22.7M|        {
 1396|  22.7M|            ref_main_idx = row + idx + 1;
 1397|  22.7M|            pu1_dst[col + (dst_strd * row)] = (UWORD8)(((32 - fract)
 1398|  22.7M|                            * ref_main[ref_main_idx]
 1399|  22.7M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5);
 1400|       |
 1401|  22.7M|        }
 1402|       |
 1403|  1.56M|    }
 1404|       |
 1405|   188k|}
ihevc_intra_pred_luma_mode_19_to_25:
 1453|   231k|{
 1454|       |
 1455|   231k|    WORD32 row, col, k;
 1456|   231k|    WORD32 two_nt, intra_pred_ang, idx;
 1457|   231k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1458|   231k|    WORD32 ref_main_idx, ref_idx;
 1459|   231k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 1];
 1460|   231k|    UWORD8 *ref_main;
 1461|   231k|    UNUSED(src_strd);
  ------------------
  |  |   38|   231k|#define UNUSED(x) ((void)(x))
  ------------------
 1462|   231k|    two_nt = 2 * nt;
 1463|   231k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1464|   231k|    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|   231k|    ref_main = ref_temp + nt - 1;
 1470|  2.46M|    for(k = 0; k < (nt + 1); k++)
  ------------------
  |  Branch (1470:16): [True: 2.23M, False: 231k]
  ------------------
 1471|  2.23M|        ref_temp[k + nt - 1] = pu1_ref[two_nt + k];
 1472|       |
 1473|   231k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1474|   231k|    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|   925k|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1479:17): [True: 694k, False: 231k]
  ------------------
 1480|   694k|    {
 1481|   694k|        inv_ang_sum += inv_ang;
 1482|   694k|        ref_main[k] = pu1_ref[two_nt - (inv_ang_sum >> 8)];
 1483|   694k|    }
 1484|       |
 1485|  2.23M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1485:18): [True: 2.00M, False: 231k]
  ------------------
 1486|  2.00M|    {
 1487|  2.00M|        pos = ((row + 1) * intra_pred_ang);
 1488|  2.00M|        idx = pos >> 5;
 1489|  2.00M|        fract = pos & (31);
 1490|       |
 1491|       |        // Do linear filtering
 1492|  30.6M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1492:22): [True: 28.6M, False: 2.00M]
  ------------------
 1493|  28.6M|        {
 1494|  28.6M|            ref_main_idx = col + idx + 1;
 1495|  28.6M|            pu1_dst[(row * dst_strd) + col] = (UWORD8)(((32 - fract)
 1496|  28.6M|                            * ref_main[ref_main_idx]
 1497|  28.6M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5);
 1498|       |
 1499|  28.6M|        }
 1500|       |
 1501|  2.00M|    }
 1502|       |
 1503|   231k|}
ihevc_intra_pred_luma_mode_27_to_33:
 1551|   223k|{
 1552|   223k|    WORD32 row, col;
 1553|   223k|    WORD32 two_nt, pos, fract;
 1554|   223k|    WORD32 intra_pred_ang;
 1555|   223k|    WORD32 idx, ref_main_idx;
 1556|   223k|    UNUSED(src_strd);
  ------------------
  |  |   38|   223k|#define UNUSED(x) ((void)(x))
  ------------------
 1557|   223k|    two_nt = 2 * nt;
 1558|   223k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1559|       |
 1560|  2.10M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1560:18): [True: 1.88M, False: 223k]
  ------------------
 1561|  1.88M|    {
 1562|  1.88M|        pos = ((row + 1) * intra_pred_ang);
 1563|  1.88M|        idx = pos >> 5;
 1564|  1.88M|        fract = pos & (31);
 1565|       |
 1566|       |        // Do linear filtering
 1567|  30.0M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1567:22): [True: 28.1M, False: 1.88M]
  ------------------
 1568|  28.1M|        {
 1569|  28.1M|            ref_main_idx = two_nt + col + idx + 1;
 1570|  28.1M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1571|  28.1M|                            * pu1_ref[ref_main_idx]
 1572|  28.1M|                            + fract * pu1_ref[ref_main_idx + 1] + 16) >> 5);
 1573|  28.1M|        }
 1574|       |
 1575|  1.88M|    }
 1576|       |
 1577|   223k|}

ihevc_itrans_recon_4x4_ttype1:
  107|   401k|{
  108|   401k|    WORD32 i, c[4];
  109|   401k|    WORD32 add;
  110|   401k|    WORD32 shift;
  111|   401k|    WORD16 *pi2_tmp_orig;
  112|   401k|    WORD32 trans_size;
  113|   401k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   401k|#define UNUSED(x) ((void)(x))
  ------------------
  114|   401k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   401k|#define TRANS_SIZE_4   4
  ------------------
  115|       |
  116|   401k|    pi2_tmp_orig = pi2_tmp;
  117|       |
  118|       |    /* Inverse Transform 1st stage */
  119|   401k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   401k|#define IT_SHIFT_STAGE_1 7
  ------------------
  120|   401k|    add = 1 << (shift - 1);
  121|       |
  122|  2.00M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (122:16): [True: 1.60M, False: 401k]
  ------------------
  123|  1.60M|    {
  124|       |        /* Checking for Zero Cols */
  125|  1.60M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (125:12): [True: 524k, False: 1.08M]
  ------------------
  126|   524k|        {
  127|   524k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  128|   524k|        }
  129|  1.08M|        else
  130|  1.08M|        {
  131|       |            // Intermediate Variables
  132|  1.08M|            c[0] = pi2_src[0] + pi2_src[2 * src_strd];
  133|  1.08M|            c[1] = pi2_src[2 * src_strd] + pi2_src[3 * src_strd];
  134|  1.08M|            c[2] = pi2_src[0] - pi2_src[3 * src_strd];
  135|  1.08M|            c[3] = 74 * pi2_src[src_strd];
  136|       |
  137|  1.08M|            pi2_tmp[0] =
  138|  1.08M|                            CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|  1.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 23.9k, False: 1.05M]
  |  |  |  |  |  Branch (40:53): [True: 10.7k, False: 1.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|  1.08M|            pi2_tmp[1] =
  140|  1.08M|                            CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|  1.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 22.7k, False: 1.05M]
  |  |  |  |  |  Branch (40:53): [True: 19.7k, False: 1.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|  1.08M|            pi2_tmp[2] =
  142|  1.08M|                            CLIP_S16((74 * (pi2_src[0] - pi2_src[2 * src_strd] + pi2_src[3 * src_strd]) + add) >> shift);
  ------------------
  |  |   53|  1.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 20.8k, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 21.9k, False: 1.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|  1.08M|            pi2_tmp[3] =
  144|  1.08M|                            CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift);
  ------------------
  |  |   53|  1.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 33.0k, False: 1.04M]
  |  |  |  |  |  Branch (40:53): [True: 33.4k, False: 1.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  1.08M|        }
  146|  1.60M|        pi2_src++;
  147|  1.60M|        pi2_tmp += trans_size;
  148|  1.60M|        zero_cols = zero_cols >> 1;
  149|  1.60M|    }
  150|       |
  151|   401k|    pi2_tmp = pi2_tmp_orig;
  152|       |
  153|       |    /* Inverse Transform 2nd stage */
  154|   401k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   401k|#define IT_SHIFT_STAGE_2 12
  ------------------
  155|   401k|    add = 1 << (shift - 1);
  156|       |
  157|  2.00M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (157:16): [True: 1.60M, False: 401k]
  ------------------
  158|  1.60M|    {
  159|  1.60M|        WORD32 itrans_out;
  160|       |        // Intermediate Variables
  161|  1.60M|        c[0] = pi2_tmp[0] + pi2_tmp[2 * trans_size];
  162|  1.60M|        c[1] = pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size];
  163|  1.60M|        c[2] = pi2_tmp[0] - pi2_tmp[3 * trans_size];
  164|  1.60M|        c[3] = 74 * pi2_tmp[trans_size];
  165|       |
  166|  1.60M|        itrans_out =
  167|  1.60M|                        CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|  1.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  1.60M|        pu1_dst[0] = CLIP_U8((itrans_out + pu1_pred[0]));
  ------------------
  |  |   40|  1.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 484k, False: 1.11M]
  |  |  |  |  |  Branch (40:53): [True: 311k, False: 807k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  1.60M|        itrans_out =
  170|  1.60M|                        CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|  1.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|  1.60M|        pu1_dst[1] = CLIP_U8((itrans_out + pu1_pred[1]));
  ------------------
  |  |   40|  1.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 414k, False: 1.18M]
  |  |  |  |  |  Branch (40:53): [True: 366k, False: 821k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|  1.60M|        itrans_out =
  173|  1.60M|                        CLIP_S16((74 * (pi2_tmp[0] - pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size]) + add) >> shift);
  ------------------
  |  |   53|  1.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  174|  1.60M|        pu1_dst[2] = CLIP_U8((itrans_out + pu1_pred[2]));
  ------------------
  |  |   40|  1.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 455k, False: 1.14M]
  |  |  |  |  |  Branch (40:53): [True: 369k, False: 778k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|  1.60M|        itrans_out =
  176|  1.60M|                        CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift);
  ------------------
  |  |   53|  1.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  1.60M|        pu1_dst[3] = CLIP_U8((itrans_out + pu1_pred[3]));
  ------------------
  |  |   40|  1.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 476k, False: 1.12M]
  |  |  |  |  |  Branch (40:53): [True: 392k, False: 733k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  1.60M|        pi2_tmp++;
  179|  1.60M|        pu1_pred += pred_strd;
  180|  1.60M|        pu1_dst += dst_strd;
  181|  1.60M|    }
  182|   401k|}
ihevc_itrans_recon_4x4:
  243|  15.4k|{
  244|  15.4k|    WORD32 j;
  245|  15.4k|    WORD32 e[2], o[2];
  246|  15.4k|    WORD32 add;
  247|  15.4k|    WORD32 shift;
  248|  15.4k|    WORD16 *pi2_tmp_orig;
  249|  15.4k|    WORD32 trans_size;
  250|  15.4k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  15.4k|#define UNUSED(x) ((void)(x))
  ------------------
  251|  15.4k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  15.4k|#define TRANS_SIZE_4   4
  ------------------
  252|       |
  253|  15.4k|    pi2_tmp_orig = pi2_tmp;
  254|       |
  255|       |    /* Inverse Transform 1st stage */
  256|  15.4k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  15.4k|#define IT_SHIFT_STAGE_1 7
  ------------------
  257|  15.4k|    add = 1 << (shift - 1);
  258|       |
  259|  77.1k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (259:16): [True: 61.7k, False: 15.4k]
  ------------------
  260|  61.7k|    {
  261|       |        /* Checking for Zero Cols */
  262|  61.7k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (262:12): [True: 20.3k, False: 41.3k]
  ------------------
  263|  20.3k|        {
  264|  20.3k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  265|  20.3k|        }
  266|  41.3k|        else
  267|  41.3k|        {
  268|       |
  269|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  270|  41.3k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  271|  41.3k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  272|  41.3k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  273|  41.3k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  274|  41.3k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  275|  41.3k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  276|  41.3k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  277|  41.3k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  278|       |
  279|  41.3k|            pi2_tmp[0] =
  280|  41.3k|                            CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  41.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  41.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.54k, False: 36.8k]
  |  |  |  |  |  Branch (40:53): [True: 634, False: 36.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|  41.3k|            pi2_tmp[1] =
  282|  41.3k|                            CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  41.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  41.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 740, False: 40.6k]
  |  |  |  |  |  Branch (40:53): [True: 1.41k, False: 39.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  41.3k|            pi2_tmp[2] =
  284|  41.3k|                            CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  41.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  41.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 851, False: 40.5k]
  |  |  |  |  |  Branch (40:53): [True: 728, False: 39.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|  41.3k|            pi2_tmp[3] =
  286|  41.3k|                            CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  41.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  41.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 695, False: 40.6k]
  |  |  |  |  |  Branch (40:53): [True: 1.08k, False: 39.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|       |
  288|  41.3k|        }
  289|  61.7k|        pi2_src++;
  290|  61.7k|        pi2_tmp += trans_size;
  291|  61.7k|        zero_cols = zero_cols >> 1;
  292|  61.7k|    }
  293|       |
  294|  15.4k|    pi2_tmp = pi2_tmp_orig;
  295|       |
  296|       |    /* Inverse Transform 2nd stage */
  297|  15.4k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  15.4k|#define IT_SHIFT_STAGE_2 12
  ------------------
  298|  15.4k|    add = 1 << (shift - 1);
  299|       |
  300|  77.1k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (300:16): [True: 61.7k, False: 15.4k]
  ------------------
  301|  61.7k|    {
  302|  61.7k|        WORD32 itrans_out;
  303|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  304|  61.7k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  305|  61.7k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  306|  61.7k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  307|  61.7k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  308|  61.7k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  309|  61.7k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  310|  61.7k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  311|  61.7k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  312|       |
  313|  61.7k|        itrans_out =
  314|  61.7k|                        CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  61.7k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 61.7k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 61.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|  61.7k|        pu1_dst[0] = CLIP_U8((itrans_out + pu1_pred[0]));
  ------------------
  |  |   40|  61.7k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.8k, False: 46.8k]
  |  |  |  |  |  Branch (40:53): [True: 16.7k, False: 30.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  61.7k|        itrans_out =
  317|  61.7k|                        CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  61.7k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 61.7k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 61.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  61.7k|        pu1_dst[1] = CLIP_U8((itrans_out + pu1_pred[1]));
  ------------------
  |  |   40|  61.7k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.6k, False: 50.0k]
  |  |  |  |  |  Branch (40:53): [True: 18.6k, False: 31.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|  61.7k|        itrans_out =
  320|  61.7k|                        CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  61.7k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 61.7k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 61.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  61.7k|        pu1_dst[2] = CLIP_U8((itrans_out + pu1_pred[2]));
  ------------------
  |  |   40|  61.7k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.8k, False: 49.8k]
  |  |  |  |  |  Branch (40:53): [True: 17.5k, False: 32.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|  61.7k|        itrans_out =
  323|  61.7k|                        CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  61.7k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 61.7k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 61.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  324|  61.7k|        pu1_dst[3] = CLIP_U8((itrans_out + pu1_pred[3]));
  ------------------
  |  |   40|  61.7k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  61.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 12.2k, False: 49.4k]
  |  |  |  |  |  Branch (40:53): [True: 18.2k, False: 31.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  325|       |
  326|  61.7k|        pi2_tmp++;
  327|  61.7k|        pu1_pred += pred_strd;
  328|  61.7k|        pu1_dst += dst_strd;
  329|       |
  330|  61.7k|    }
  331|  15.4k|}

ihevc_itrans_recon_16x16:
  106|   379k|{
  107|   379k|    WORD32 j, k;
  108|   379k|    WORD32 e[8], o[8];
  109|   379k|    WORD32 ee[4], eo[4];
  110|   379k|    WORD32 eee[2], eeo[2];
  111|   379k|    WORD32 add;
  112|   379k|    WORD32 shift;
  113|   379k|    WORD16 *pi2_tmp_orig;
  114|   379k|    WORD32 trans_size;
  115|   379k|    WORD32 zero_rows_2nd_stage = zero_cols;
  116|   379k|    WORD32 row_limit_2nd_stage;
  117|       |
  118|   379k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (118:8): [True: 213k, False: 166k]
  ------------------
  119|   213k|        row_limit_2nd_stage = 4;
  120|   166k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (120:13): [True: 76.4k, False: 89.7k]
  ------------------
  121|  76.4k|        row_limit_2nd_stage = 8;
  122|  89.7k|    else
  123|  89.7k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  89.7k|#define TRANS_SIZE_16 16
  ------------------
  124|       |
  125|   379k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   379k|#define TRANS_SIZE_16 16
  ------------------
  126|   379k|    pi2_tmp_orig = pi2_tmp;
  127|   379k|    if((zero_rows & 0xFFF0) == 0xFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (127:8): [True: 168k, False: 211k]
  ------------------
  128|   168k|    {
  129|       |        /* Inverse Transform 1st stage */
  130|       |        /************************************************************************************************/
  131|       |        /**********************************START - IT_RECON_16x16****************************************/
  132|       |        /************************************************************************************************/
  133|       |
  134|   168k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   168k|#define IT_SHIFT_STAGE_1 7
  ------------------
  135|   168k|        add = 1 << (shift - 1);
  136|       |
  137|  1.44M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (137:20): [True: 1.27M, False: 168k]
  ------------------
  138|  1.27M|        {
  139|       |            /* Checking for Zero Cols */
  140|  1.27M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (140:16): [True: 802k, False: 475k]
  ------------------
  141|   802k|            {
  142|   802k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  143|   802k|            }
  144|   475k|            else
  145|   475k|            {
  146|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  147|  4.31M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (147:28): [True: 3.84M, False: 475k]
  ------------------
  148|  3.84M|                {
  149|  3.84M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  150|  3.84M|                                    + g_ai2_ihevc_trans_16[3][k]
  151|  3.84M|                                                    * pi2_src[3 * src_strd];
  152|  3.84M|                }
  153|  2.39M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (153:28): [True: 1.92M, False: 475k]
  ------------------
  154|  1.92M|                {
  155|  1.92M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  156|  1.92M|                }
  157|   475k|                eeo[0] = 0;
  158|   475k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  159|   475k|                eeo[1] = 0;
  160|   475k|                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.43M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (163:28): [True: 962k, False: 475k]
  ------------------
  164|   962k|                {
  165|   962k|                    ee[k] = eee[k] + eeo[k];
  166|   962k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  167|   962k|                }
  168|  2.40M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (168:28): [True: 1.92M, False: 475k]
  ------------------
  169|  1.92M|                {
  170|  1.92M|                    e[k] = ee[k] + eo[k];
  171|  1.92M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  172|  1.92M|                }
  173|  4.32M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (173:28): [True: 3.85M, False: 475k]
  ------------------
  174|  3.85M|                {
  175|  3.85M|                    pi2_tmp[k] =
  176|  3.85M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.85M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.85M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.94k, False: 3.84M]
  |  |  |  |  |  Branch (40:53): [True: 6.48k, False: 3.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  3.85M|                    pi2_tmp[k + 8] =
  178|  3.85M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.85M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.85M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.13k, False: 3.84M]
  |  |  |  |  |  Branch (40:53): [True: 5.58k, False: 3.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|  3.85M|                }
  180|   475k|            }
  181|  1.27M|            pi2_src++;
  182|  1.27M|            pi2_tmp += trans_size;
  183|  1.27M|            zero_cols = zero_cols >> 1;
  184|  1.27M|        }
  185|       |
  186|   168k|        pi2_tmp = pi2_tmp_orig;
  187|       |
  188|       |        /* Inverse Transform 2nd stage */
  189|   168k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   168k|#define IT_SHIFT_STAGE_2 12
  ------------------
  190|   168k|        add = 1 << (shift - 1);
  191|       |
  192|   168k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (192:12): [True: 90.8k, False: 77.2k]
  ------------------
  193|  90.8k|        {
  194|  1.50M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (194:24): [True: 1.40M, False: 90.8k]
  ------------------
  195|  1.40M|            {
  196|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  197|  12.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (197:28): [True: 11.2M, False: 1.40M]
  ------------------
  198|  11.2M|                {
  199|  11.2M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  200|  11.2M|                                    + g_ai2_ihevc_trans_16[3][k]
  201|  11.2M|                                                    * pi2_tmp[3 * trans_size];
  202|  11.2M|                }
  203|  7.04M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (203:28): [True: 5.63M, False: 1.40M]
  ------------------
  204|  5.63M|                {
  205|  5.63M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  206|  5.63M|                }
  207|  1.40M|                eeo[0] = 0;
  208|  1.40M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  209|  1.40M|                eeo[1] = 0;
  210|  1.40M|                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|  4.23M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (213:28): [True: 2.82M, False: 1.40M]
  ------------------
  214|  2.82M|                {
  215|  2.82M|                    ee[k] = eee[k] + eeo[k];
  216|  2.82M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  217|  2.82M|                }
  218|  7.06M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (218:28): [True: 5.65M, False: 1.40M]
  ------------------
  219|  5.65M|                {
  220|  5.65M|                    e[k] = ee[k] + eo[k];
  221|  5.65M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  222|  5.65M|                }
  223|  12.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (223:28): [True: 11.1M, False: 1.40M]
  ------------------
  224|  11.1M|                {
  225|  11.1M|                    WORD32 itrans_out;
  226|  11.1M|                    itrans_out =
  227|  11.1M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  11.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 11.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 11.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  11.1M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  11.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.23M, False: 8.95M]
  |  |  |  |  |  Branch (40:53): [True: 855k, False: 8.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|  11.1M|                    itrans_out =
  230|  11.1M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  11.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 11.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 11.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|  11.1M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  11.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.08M, False: 9.10M]
  |  |  |  |  |  Branch (40:53): [True: 872k, False: 8.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|  11.1M|                }
  233|  1.40M|                pi2_tmp++;
  234|  1.40M|                pu1_pred += pred_strd;
  235|  1.40M|                pu1_dst += dst_strd;
  236|  1.40M|            }
  237|  90.8k|        }
  238|  77.2k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (238:17): [True: 39.2k, False: 38.0k]
  ------------------
  239|  39.2k|        {
  240|   649k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (240:24): [True: 610k, False: 39.2k]
  ------------------
  241|   610k|            {
  242|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  243|  5.47M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (243:28): [True: 4.86M, False: 610k]
  ------------------
  244|  4.86M|                {
  245|  4.86M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  246|  4.86M|                                    + g_ai2_ihevc_trans_16[3][k]
  247|  4.86M|                                                    * pi2_tmp[3 * trans_size]
  248|  4.86M|                                    + g_ai2_ihevc_trans_16[5][k]
  249|  4.86M|                                                    * pi2_tmp[5 * trans_size]
  250|  4.86M|                                    + g_ai2_ihevc_trans_16[7][k]
  251|  4.86M|                                                    * pi2_tmp[7 * trans_size];
  252|  4.86M|                }
  253|  3.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (253:28): [True: 2.44M, False: 610k]
  ------------------
  254|  2.44M|                {
  255|  2.44M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  256|  2.44M|                                    + g_ai2_ihevc_trans_16[6][k]
  257|  2.44M|                                                    * pi2_tmp[6 * trans_size];
  258|  2.44M|                }
  259|   610k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  260|   610k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  261|   610k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  262|   610k|                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|  1.83M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (265:28): [True: 1.22M, False: 610k]
  ------------------
  266|  1.22M|                {
  267|  1.22M|                    ee[k] = eee[k] + eeo[k];
  268|  1.22M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  269|  1.22M|                }
  270|  3.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (270:28): [True: 2.44M, False: 610k]
  ------------------
  271|  2.44M|                {
  272|  2.44M|                    e[k] = ee[k] + eo[k];
  273|  2.44M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  274|  2.44M|                }
  275|  5.44M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (275:28): [True: 4.83M, False: 610k]
  ------------------
  276|  4.83M|                {
  277|  4.83M|                    WORD32 itrans_out;
  278|  4.83M|                    itrans_out =
  279|  4.83M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.83M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.83M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.83M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  280|  4.83M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  4.83M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.83M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 685k, False: 4.14M]
  |  |  |  |  |  Branch (40:53): [True: 292k, False: 3.85M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|  4.83M|                    itrans_out =
  282|  4.83M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  4.83M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.83M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.83M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  4.83M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  4.83M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.83M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 615k, False: 4.21M]
  |  |  |  |  |  Branch (40:53): [True: 304k, False: 3.91M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|  4.83M|                }
  285|   610k|                pi2_tmp++;
  286|   610k|                pu1_pred += pred_strd;
  287|   610k|                pu1_dst += dst_strd;
  288|   610k|            }
  289|  39.2k|        }
  290|  38.0k|        else /* All rows of output of 1st stage are non-zero */
  291|  38.0k|        {
  292|   603k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (292:24): [True: 565k, False: 38.0k]
  ------------------
  293|   565k|            {
  294|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  295|  5.05M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (295:28): [True: 4.49M, False: 565k]
  ------------------
  296|  4.49M|                {
  297|  4.49M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  298|  4.49M|                                    + g_ai2_ihevc_trans_16[3][k]
  299|  4.49M|                                                    * pi2_tmp[3 * trans_size]
  300|  4.49M|                                    + g_ai2_ihevc_trans_16[5][k]
  301|  4.49M|                                                    * pi2_tmp[5 * trans_size]
  302|  4.49M|                                    + g_ai2_ihevc_trans_16[7][k]
  303|  4.49M|                                                    * pi2_tmp[7 * trans_size]
  304|  4.49M|                                    + g_ai2_ihevc_trans_16[9][k]
  305|  4.49M|                                                    * pi2_tmp[9 * trans_size]
  306|  4.49M|                                    + g_ai2_ihevc_trans_16[11][k]
  307|  4.49M|                                                    * pi2_tmp[11 * trans_size]
  308|  4.49M|                                    + g_ai2_ihevc_trans_16[13][k]
  309|  4.49M|                                                    * pi2_tmp[13 * trans_size]
  310|  4.49M|                                    + g_ai2_ihevc_trans_16[15][k]
  311|  4.49M|                                                    * pi2_tmp[15 * trans_size];
  312|  4.49M|                }
  313|  2.85M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (313:28): [True: 2.28M, False: 565k]
  ------------------
  314|  2.28M|                {
  315|  2.28M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  316|  2.28M|                                    + g_ai2_ihevc_trans_16[6][k]
  317|  2.28M|                                                    * pi2_tmp[6 * trans_size]
  318|  2.28M|                                    + g_ai2_ihevc_trans_16[10][k]
  319|  2.28M|                                                    * pi2_tmp[10 * trans_size]
  320|  2.28M|                                    + g_ai2_ihevc_trans_16[14][k]
  321|  2.28M|                                                    * pi2_tmp[14 * trans_size];
  322|  2.28M|                }
  323|   565k|                eeo[0] =
  324|   565k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  325|   565k|                                                + g_ai2_ihevc_trans_16[12][0]
  326|   565k|                                                                * pi2_tmp[12
  327|   565k|                                                                                * trans_size];
  328|   565k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  329|   565k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  330|   565k|                eeo[1] =
  331|   565k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  332|   565k|                                                + g_ai2_ihevc_trans_16[12][1]
  333|   565k|                                                                * pi2_tmp[12
  334|   565k|                                                                                * trans_size];
  335|   565k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  336|   565k|                                + 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|  1.69M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (339:28): [True: 1.13M, False: 565k]
  ------------------
  340|  1.13M|                {
  341|  1.13M|                    ee[k] = eee[k] + eeo[k];
  342|  1.13M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  343|  1.13M|                }
  344|  2.84M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (344:28): [True: 2.27M, False: 565k]
  ------------------
  345|  2.27M|                {
  346|  2.27M|                    e[k] = ee[k] + eo[k];
  347|  2.27M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  348|  2.27M|                }
  349|  5.01M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (349:28): [True: 4.44M, False: 565k]
  ------------------
  350|  4.44M|                {
  351|  4.44M|                    WORD32 itrans_out;
  352|  4.44M|                    itrans_out =
  353|  4.44M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|  4.44M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  4.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.33M, False: 3.11M]
  |  |  |  |  |  Branch (40:53): [True: 166k, False: 2.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|  4.44M|                    itrans_out =
  356|  4.44M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  4.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|  4.44M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  4.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 817k, False: 3.62M]
  |  |  |  |  |  Branch (40:53): [True: 154k, False: 3.47M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|  4.44M|                }
  359|   565k|                pi2_tmp++;
  360|   565k|                pu1_pred += pred_strd;
  361|   565k|                pu1_dst += dst_strd;
  362|   565k|            }
  363|  38.0k|        }
  364|       |        /************************************************************************************************/
  365|       |        /************************************END - IT_RECON_16x16****************************************/
  366|       |        /************************************************************************************************/
  367|   168k|    }
  368|   211k|    else if((zero_rows & 0xFF00) == 0xFF00)  /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (368:13): [True: 97.4k, False: 114k]
  ------------------
  369|  97.4k|    {
  370|       |        /* Inverse Transform 1st stage */
  371|       |        /************************************************************************************************/
  372|       |        /**********************************START - IT_RECON_16x16****************************************/
  373|       |        /************************************************************************************************/
  374|       |
  375|  97.4k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  97.4k|#define IT_SHIFT_STAGE_1 7
  ------------------
  376|  97.4k|        add = 1 << (shift - 1);
  377|       |
  378|   802k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (378:20): [True: 705k, False: 97.4k]
  ------------------
  379|   705k|        {
  380|       |            /* Checking for Zero Cols */
  381|   705k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (381:16): [True: 368k, False: 336k]
  ------------------
  382|   368k|            {
  383|   368k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  384|   368k|            }
  385|   336k|            else
  386|   336k|            {
  387|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  388|  3.05M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (388:28): [True: 2.71M, False: 336k]
  ------------------
  389|  2.71M|                {
  390|  2.71M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  391|  2.71M|                                    + g_ai2_ihevc_trans_16[3][k]
  392|  2.71M|                                                    * pi2_src[3 * src_strd]
  393|  2.71M|                                    + g_ai2_ihevc_trans_16[5][k]
  394|  2.71M|                                                    * pi2_src[5 * src_strd]
  395|  2.71M|                                    + g_ai2_ihevc_trans_16[7][k]
  396|  2.71M|                                                    * pi2_src[7 * src_strd];
  397|  2.71M|                }
  398|  1.69M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (398:28): [True: 1.35M, False: 336k]
  ------------------
  399|  1.35M|                {
  400|  1.35M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  401|  1.35M|                                    + g_ai2_ihevc_trans_16[6][k]
  402|  1.35M|                                                    * pi2_src[6 * src_strd];
  403|  1.35M|                }
  404|   336k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  405|   336k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  406|   336k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  407|   336k|                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|  1.01M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (410:28): [True: 678k, False: 336k]
  ------------------
  411|   678k|                {
  412|   678k|                    ee[k] = eee[k] + eeo[k];
  413|   678k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  414|   678k|                }
  415|  1.69M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (415:28): [True: 1.35M, False: 336k]
  ------------------
  416|  1.35M|                {
  417|  1.35M|                    e[k] = ee[k] + eo[k];
  418|  1.35M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  419|  1.35M|                }
  420|  3.05M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (420:28): [True: 2.71M, False: 336k]
  ------------------
  421|  2.71M|                {
  422|  2.71M|                    pi2_tmp[k] =
  423|  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: 33.1k, False: 2.68M]
  |  |  |  |  |  Branch (40:53): [True: 31.2k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  2.71M|                    pi2_tmp[k + 8] =
  425|  2.71M|                                    CLIP_S16(((e[7 - k] - o[7 - 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: 32.0k, False: 2.68M]
  |  |  |  |  |  Branch (40:53): [True: 31.3k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  426|  2.71M|                }
  427|   336k|            }
  428|   705k|            pi2_src++;
  429|   705k|            pi2_tmp += trans_size;
  430|   705k|            zero_cols = zero_cols >> 1;
  431|   705k|        }
  432|       |
  433|  97.4k|        pi2_tmp = pi2_tmp_orig;
  434|       |
  435|       |        /* Inverse Transform 2nd stage */
  436|  97.4k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  97.4k|#define IT_SHIFT_STAGE_2 12
  ------------------
  437|  97.4k|        add = 1 << (shift - 1);
  438|       |
  439|  97.4k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (439:12): [True: 59.3k, False: 38.0k]
  ------------------
  440|  59.3k|        {
  441|   982k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (441:24): [True: 923k, False: 59.3k]
  ------------------
  442|   923k|            {
  443|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  444|  8.30M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (444:28): [True: 7.37M, False: 923k]
  ------------------
  445|  7.37M|                {
  446|  7.37M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  447|  7.37M|                                    + g_ai2_ihevc_trans_16[3][k]
  448|  7.37M|                                                    * pi2_tmp[3 * trans_size];
  449|  7.37M|                }
  450|  4.61M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (450:28): [True: 3.69M, False: 923k]
  ------------------
  451|  3.69M|                {
  452|  3.69M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  453|  3.69M|                }
  454|   923k|                eeo[0] = 0;
  455|   923k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  456|   923k|                eeo[1] = 0;
  457|   923k|                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|  2.77M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (460:28): [True: 1.85M, False: 923k]
  ------------------
  461|  1.85M|                {
  462|  1.85M|                    ee[k] = eee[k] + eeo[k];
  463|  1.85M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  464|  1.85M|                }
  465|  4.63M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (465:28): [True: 3.70M, False: 923k]
  ------------------
  466|  3.70M|                {
  467|  3.70M|                    e[k] = ee[k] + eo[k];
  468|  3.70M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  469|  3.70M|                }
  470|  8.24M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (470:28): [True: 7.32M, False: 923k]
  ------------------
  471|  7.32M|                {
  472|  7.32M|                    WORD32 itrans_out;
  473|  7.32M|                    itrans_out =
  474|  7.32M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  7.32M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.32M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  475|  7.32M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  7.32M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.93M, False: 5.38M]
  |  |  |  |  |  Branch (40:53): [True: 1.21M, False: 4.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|  7.32M|                    itrans_out =
  477|  7.32M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  7.32M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.32M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  7.32M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  7.32M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.90M, False: 5.42M]
  |  |  |  |  |  Branch (40:53): [True: 1.25M, False: 4.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  479|  7.32M|                }
  480|   923k|                pi2_tmp++;
  481|   923k|                pu1_pred += pred_strd;
  482|   923k|                pu1_dst += dst_strd;
  483|   923k|            }
  484|  59.3k|        }
  485|  38.0k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (485:17): [True: 17.3k, False: 20.6k]
  ------------------
  486|  17.3k|        {
  487|   290k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (487:24): [True: 272k, False: 17.3k]
  ------------------
  488|   272k|            {
  489|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  490|  2.44M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (490:28): [True: 2.17M, False: 272k]
  ------------------
  491|  2.17M|                {
  492|  2.17M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  493|  2.17M|                                    + g_ai2_ihevc_trans_16[3][k]
  494|  2.17M|                                                    * pi2_tmp[3 * trans_size]
  495|  2.17M|                                    + g_ai2_ihevc_trans_16[5][k]
  496|  2.17M|                                                    * pi2_tmp[5 * trans_size]
  497|  2.17M|                                    + g_ai2_ihevc_trans_16[7][k]
  498|  2.17M|                                                    * pi2_tmp[7 * trans_size];
  499|  2.17M|                }
  500|  1.36M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (500:28): [True: 1.09M, False: 272k]
  ------------------
  501|  1.09M|                {
  502|  1.09M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  503|  1.09M|                                    + g_ai2_ihevc_trans_16[6][k]
  504|  1.09M|                                                    * pi2_tmp[6 * trans_size];
  505|  1.09M|                }
  506|   272k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  507|   272k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  508|   272k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  509|   272k|                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|   818k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (512:28): [True: 546k, False: 272k]
  ------------------
  513|   546k|                {
  514|   546k|                    ee[k] = eee[k] + eeo[k];
  515|   546k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  516|   546k|                }
  517|  1.36M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (517:28): [True: 1.09M, False: 272k]
  ------------------
  518|  1.09M|                {
  519|  1.09M|                    e[k] = ee[k] + eo[k];
  520|  1.09M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  521|  1.09M|                }
  522|  2.43M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (522:28): [True: 2.15M, False: 272k]
  ------------------
  523|  2.15M|                {
  524|  2.15M|                    WORD32 itrans_out;
  525|  2.15M|                    itrans_out =
  526|  2.15M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.15M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.15M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  527|  2.15M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  2.15M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 391k, False: 1.76M]
  |  |  |  |  |  Branch (40:53): [True: 277k, False: 1.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|  2.15M|                    itrans_out =
  529|  2.15M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.15M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.15M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  530|  2.15M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  2.15M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.15M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 372k, False: 1.78M]
  |  |  |  |  |  Branch (40:53): [True: 275k, False: 1.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  531|  2.15M|                }
  532|   272k|                pi2_tmp++;
  533|   272k|                pu1_pred += pred_strd;
  534|   272k|                pu1_dst += dst_strd;
  535|   272k|            }
  536|  17.3k|        }
  537|  20.6k|        else /* All rows of output of 1st stage are non-zero */
  538|  20.6k|        {
  539|   339k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (539:24): [True: 318k, False: 20.6k]
  ------------------
  540|   318k|            {
  541|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  542|  2.85M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (542:28): [True: 2.53M, False: 318k]
  ------------------
  543|  2.53M|                {
  544|  2.53M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  545|  2.53M|                                    + g_ai2_ihevc_trans_16[3][k]
  546|  2.53M|                                                    * pi2_tmp[3 * trans_size]
  547|  2.53M|                                    + g_ai2_ihevc_trans_16[5][k]
  548|  2.53M|                                                    * pi2_tmp[5 * trans_size]
  549|  2.53M|                                    + g_ai2_ihevc_trans_16[7][k]
  550|  2.53M|                                                    * pi2_tmp[7 * trans_size]
  551|  2.53M|                                    + g_ai2_ihevc_trans_16[9][k]
  552|  2.53M|                                                    * pi2_tmp[9 * trans_size]
  553|  2.53M|                                    + g_ai2_ihevc_trans_16[11][k]
  554|  2.53M|                                                    * pi2_tmp[11 * trans_size]
  555|  2.53M|                                    + g_ai2_ihevc_trans_16[13][k]
  556|  2.53M|                                                    * pi2_tmp[13 * trans_size]
  557|  2.53M|                                    + g_ai2_ihevc_trans_16[15][k]
  558|  2.53M|                                                    * pi2_tmp[15 * trans_size];
  559|  2.53M|                }
  560|  1.59M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (560:28): [True: 1.27M, False: 318k]
  ------------------
  561|  1.27M|                {
  562|  1.27M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  563|  1.27M|                                    + g_ai2_ihevc_trans_16[6][k]
  564|  1.27M|                                                    * pi2_tmp[6 * trans_size]
  565|  1.27M|                                    + g_ai2_ihevc_trans_16[10][k]
  566|  1.27M|                                                    * pi2_tmp[10 * trans_size]
  567|  1.27M|                                    + g_ai2_ihevc_trans_16[14][k]
  568|  1.27M|                                                    * pi2_tmp[14 * trans_size];
  569|  1.27M|                }
  570|   318k|                eeo[0] =
  571|   318k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  572|   318k|                                                + g_ai2_ihevc_trans_16[12][0]
  573|   318k|                                                                * pi2_tmp[12
  574|   318k|                                                                                * trans_size];
  575|   318k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  576|   318k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  577|   318k|                eeo[1] =
  578|   318k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  579|   318k|                                                + g_ai2_ihevc_trans_16[12][1]
  580|   318k|                                                                * pi2_tmp[12
  581|   318k|                                                                                * trans_size];
  582|   318k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  583|   318k|                                + 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|   956k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (586:28): [True: 637k, False: 318k]
  ------------------
  587|   637k|                {
  588|   637k|                    ee[k] = eee[k] + eeo[k];
  589|   637k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  590|   637k|                }
  591|  1.59M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (591:28): [True: 1.27M, False: 318k]
  ------------------
  592|  1.27M|                {
  593|  1.27M|                    e[k] = ee[k] + eo[k];
  594|  1.27M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  595|  1.27M|                }
  596|  2.83M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (596:28): [True: 2.51M, False: 318k]
  ------------------
  597|  2.51M|                {
  598|  2.51M|                    WORD32 itrans_out;
  599|  2.51M|                    itrans_out =
  600|  2.51M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.51M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.51M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|  2.51M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  2.51M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 853k, False: 1.66M]
  |  |  |  |  |  Branch (40:53): [True: 309k, False: 1.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|  2.51M|                    itrans_out =
  603|  2.51M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.51M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.51M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|  2.51M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  2.51M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 848k, False: 1.66M]
  |  |  |  |  |  Branch (40:53): [True: 287k, False: 1.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  2.51M|                }
  606|   318k|                pi2_tmp++;
  607|   318k|                pu1_pred += pred_strd;
  608|   318k|                pu1_dst += dst_strd;
  609|   318k|            }
  610|  20.6k|        }
  611|       |        /************************************************************************************************/
  612|       |        /************************************END - IT_RECON_16x16****************************************/
  613|       |        /************************************************************************************************/
  614|  97.4k|    }
  615|   114k|    else  /* All rows of input are non-zero */
  616|   114k|    {
  617|       |        /* Inverse Transform 1st stage */
  618|       |        /************************************************************************************************/
  619|       |        /**********************************START - IT_RECON_16x16****************************************/
  620|       |        /************************************************************************************************/
  621|       |
  622|   114k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   114k|#define IT_SHIFT_STAGE_1 7
  ------------------
  623|   114k|        add = 1 << (shift - 1);
  624|       |
  625|  1.01M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (625:20): [True: 900k, False: 114k]
  ------------------
  626|   900k|        {
  627|       |            /* Checking for Zero Cols */
  628|   900k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (628:16): [True: 323k, False: 577k]
  ------------------
  629|   323k|            {
  630|   323k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  631|   323k|            }
  632|   577k|            else
  633|   577k|            {
  634|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  635|  5.23M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (635:28): [True: 4.65M, False: 577k]
  ------------------
  636|  4.65M|                {
  637|  4.65M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  638|  4.65M|                                    + g_ai2_ihevc_trans_16[3][k]
  639|  4.65M|                                                    * pi2_src[3 * src_strd]
  640|  4.65M|                                    + g_ai2_ihevc_trans_16[5][k]
  641|  4.65M|                                                    * pi2_src[5 * src_strd]
  642|  4.65M|                                    + g_ai2_ihevc_trans_16[7][k]
  643|  4.65M|                                                    * pi2_src[7 * src_strd]
  644|  4.65M|                                    + g_ai2_ihevc_trans_16[9][k]
  645|  4.65M|                                                    * pi2_src[9 * src_strd]
  646|  4.65M|                                    + g_ai2_ihevc_trans_16[11][k]
  647|  4.65M|                                                    * pi2_src[11 * src_strd]
  648|  4.65M|                                    + g_ai2_ihevc_trans_16[13][k]
  649|  4.65M|                                                    * pi2_src[13 * src_strd]
  650|  4.65M|                                    + g_ai2_ihevc_trans_16[15][k]
  651|  4.65M|                                                    * pi2_src[15 * src_strd];
  652|  4.65M|                }
  653|  2.90M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (653:28): [True: 2.32M, False: 577k]
  ------------------
  654|  2.32M|                {
  655|  2.32M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  656|  2.32M|                                    + g_ai2_ihevc_trans_16[6][k]
  657|  2.32M|                                                    * pi2_src[6 * src_strd]
  658|  2.32M|                                    + g_ai2_ihevc_trans_16[10][k]
  659|  2.32M|                                                    * pi2_src[10 * src_strd]
  660|  2.32M|                                    + g_ai2_ihevc_trans_16[14][k]
  661|  2.32M|                                                    * pi2_src[14 * src_strd];
  662|  2.32M|                }
  663|   577k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  664|   577k|                                + g_ai2_ihevc_trans_16[12][0]
  665|   577k|                                                * pi2_src[12 * src_strd];
  666|   577k|                eee[0] =
  667|   577k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  668|   577k|                                                + g_ai2_ihevc_trans_16[8][0]
  669|   577k|                                                                * pi2_src[8
  670|   577k|                                                                                * src_strd];
  671|   577k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  672|   577k|                                + g_ai2_ihevc_trans_16[12][1]
  673|   577k|                                                * pi2_src[12 * src_strd];
  674|   577k|                eee[1] =
  675|   577k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  676|   577k|                                                + g_ai2_ihevc_trans_16[8][1]
  677|   577k|                                                                * pi2_src[8
  678|   577k|                                                                                * src_strd];
  679|       |
  680|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  681|  1.74M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (681:28): [True: 1.16M, False: 577k]
  ------------------
  682|  1.16M|                {
  683|  1.16M|                    ee[k] = eee[k] + eeo[k];
  684|  1.16M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  685|  1.16M|                }
  686|  2.90M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (686:28): [True: 2.33M, False: 577k]
  ------------------
  687|  2.33M|                {
  688|  2.33M|                    e[k] = ee[k] + eo[k];
  689|  2.33M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  690|  2.33M|                }
  691|  5.23M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (691:28): [True: 4.65M, False: 577k]
  ------------------
  692|  4.65M|                {
  693|  4.65M|                    pi2_tmp[k] =
  694|  4.65M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 98.1k, False: 4.55M]
  |  |  |  |  |  Branch (40:53): [True: 100k, False: 4.45M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|  4.65M|                    pi2_tmp[k + 8] =
  696|  4.65M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  4.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 91.1k, False: 4.56M]
  |  |  |  |  |  Branch (40:53): [True: 90.6k, False: 4.47M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  697|  4.65M|                }
  698|   577k|            }
  699|   900k|            pi2_src++;
  700|   900k|            pi2_tmp += trans_size;
  701|   900k|            zero_cols = zero_cols >> 1;
  702|   900k|        }
  703|       |
  704|   114k|        pi2_tmp = pi2_tmp_orig;
  705|       |
  706|       |        /* Inverse Transform 2nd stage */
  707|   114k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   114k|#define IT_SHIFT_STAGE_2 12
  ------------------
  708|   114k|        add = 1 << (shift - 1);
  709|       |
  710|   114k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (710:12): [True: 63.8k, False: 50.4k]
  ------------------
  711|  63.8k|        {
  712|  1.05M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (712:24): [True: 988k, False: 63.8k]
  ------------------
  713|   988k|            {
  714|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  715|  8.88M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (715:28): [True: 7.89M, False: 988k]
  ------------------
  716|  7.89M|                {
  717|  7.89M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  718|  7.89M|                                    + g_ai2_ihevc_trans_16[3][k]
  719|  7.89M|                                                    * pi2_tmp[3 * trans_size];
  720|  7.89M|                }
  721|  4.94M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (721:28): [True: 3.95M, False: 988k]
  ------------------
  722|  3.95M|                {
  723|  3.95M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  724|  3.95M|                }
  725|   988k|                eeo[0] = 0;
  726|   988k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  727|   988k|                eeo[1] = 0;
  728|   988k|                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|  2.97M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (731:28): [True: 1.98M, False: 988k]
  ------------------
  732|  1.98M|                {
  733|  1.98M|                    ee[k] = eee[k] + eeo[k];
  734|  1.98M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  735|  1.98M|                }
  736|  4.95M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (736:28): [True: 3.96M, False: 988k]
  ------------------
  737|  3.96M|                {
  738|  3.96M|                    e[k] = ee[k] + eo[k];
  739|  3.96M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  740|  3.96M|                }
  741|  8.83M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (741:28): [True: 7.84M, False: 988k]
  ------------------
  742|  7.84M|                {
  743|  7.84M|                    WORD32 itrans_out;
  744|  7.84M|                    itrans_out =
  745|  7.84M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  7.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|  7.84M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  7.84M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.95M, False: 5.88M]
  |  |  |  |  |  Branch (40:53): [True: 1.46M, False: 4.42M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  7.84M|                    itrans_out =
  748|  7.84M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  7.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|  7.84M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  7.84M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.84M, False: 6.00M]
  |  |  |  |  |  Branch (40:53): [True: 1.56M, False: 4.43M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  750|  7.84M|                }
  751|   988k|                pi2_tmp++;
  752|   988k|                pu1_pred += pred_strd;
  753|   988k|                pu1_dst += dst_strd;
  754|   988k|            }
  755|  63.8k|        }
  756|  50.4k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (756:17): [True: 20.0k, False: 30.4k]
  ------------------
  757|  20.0k|        {
  758|   322k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (758:24): [True: 302k, False: 20.0k]
  ------------------
  759|   302k|            {
  760|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  761|  2.72M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (761:28): [True: 2.42M, False: 302k]
  ------------------
  762|  2.42M|                {
  763|  2.42M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  764|  2.42M|                                    + g_ai2_ihevc_trans_16[3][k]
  765|  2.42M|                                                    * pi2_tmp[3 * trans_size]
  766|  2.42M|                                    + g_ai2_ihevc_trans_16[5][k]
  767|  2.42M|                                                    * pi2_tmp[5 * trans_size]
  768|  2.42M|                                    + g_ai2_ihevc_trans_16[7][k]
  769|  2.42M|                                                    * pi2_tmp[7 * trans_size];
  770|  2.42M|                }
  771|  1.51M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (771:28): [True: 1.21M, False: 302k]
  ------------------
  772|  1.21M|                {
  773|  1.21M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  774|  1.21M|                                    + g_ai2_ihevc_trans_16[6][k]
  775|  1.21M|                                                    * pi2_tmp[6 * trans_size];
  776|  1.21M|                }
  777|   302k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  778|   302k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  779|   302k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  780|   302k|                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|   911k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (783:28): [True: 608k, False: 302k]
  ------------------
  784|   608k|                {
  785|   608k|                    ee[k] = eee[k] + eeo[k];
  786|   608k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  787|   608k|                }
  788|  1.52M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (788:28): [True: 1.22M, False: 302k]
  ------------------
  789|  1.22M|                {
  790|  1.22M|                    e[k] = ee[k] + eo[k];
  791|  1.22M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  792|  1.22M|                }
  793|  2.70M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (793:28): [True: 2.39M, False: 302k]
  ------------------
  794|  2.39M|                {
  795|  2.39M|                    WORD32 itrans_out;
  796|  2.39M|                    itrans_out =
  797|  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  798|  2.39M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  2.39M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 725k, False: 1.67M]
  |  |  |  |  |  Branch (40:53): [True: 749k, False: 925k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|  2.39M|                    itrans_out =
  800|  2.39M|                                    CLIP_S16(((e[7 - k] - o[7 - 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  801|  2.39M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  2.39M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 742k, False: 1.65M]
  |  |  |  |  |  Branch (40:53): [True: 739k, False: 917k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  802|  2.39M|                }
  803|   302k|                pi2_tmp++;
  804|   302k|                pu1_pred += pred_strd;
  805|   302k|                pu1_dst += dst_strd;
  806|   302k|            }
  807|  20.0k|        }
  808|  30.4k|        else /* All rows of output of 1st stage are non-zero */
  809|  30.4k|        {
  810|   514k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (810:24): [True: 483k, False: 30.4k]
  ------------------
  811|   483k|            {
  812|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  813|  4.35M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (813:28): [True: 3.86M, False: 483k]
  ------------------
  814|  3.86M|                {
  815|  3.86M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  816|  3.86M|                                    + g_ai2_ihevc_trans_16[3][k]
  817|  3.86M|                                                    * pi2_tmp[3 * trans_size]
  818|  3.86M|                                    + g_ai2_ihevc_trans_16[5][k]
  819|  3.86M|                                                    * pi2_tmp[5 * trans_size]
  820|  3.86M|                                    + g_ai2_ihevc_trans_16[7][k]
  821|  3.86M|                                                    * pi2_tmp[7 * trans_size]
  822|  3.86M|                                    + g_ai2_ihevc_trans_16[9][k]
  823|  3.86M|                                                    * pi2_tmp[9 * trans_size]
  824|  3.86M|                                    + g_ai2_ihevc_trans_16[11][k]
  825|  3.86M|                                                    * pi2_tmp[11 * trans_size]
  826|  3.86M|                                    + g_ai2_ihevc_trans_16[13][k]
  827|  3.86M|                                                    * pi2_tmp[13 * trans_size]
  828|  3.86M|                                    + g_ai2_ihevc_trans_16[15][k]
  829|  3.86M|                                                    * pi2_tmp[15 * trans_size];
  830|  3.86M|                }
  831|  2.42M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (831:28): [True: 1.93M, False: 483k]
  ------------------
  832|  1.93M|                {
  833|  1.93M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  834|  1.93M|                                    + g_ai2_ihevc_trans_16[6][k]
  835|  1.93M|                                                    * pi2_tmp[6 * trans_size]
  836|  1.93M|                                    + g_ai2_ihevc_trans_16[10][k]
  837|  1.93M|                                                    * pi2_tmp[10 * trans_size]
  838|  1.93M|                                    + g_ai2_ihevc_trans_16[14][k]
  839|  1.93M|                                                    * pi2_tmp[14 * trans_size];
  840|  1.93M|                }
  841|   483k|                eeo[0] =
  842|   483k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  843|   483k|                                                + g_ai2_ihevc_trans_16[12][0]
  844|   483k|                                                                * pi2_tmp[12
  845|   483k|                                                                                * trans_size];
  846|   483k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  847|   483k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  848|   483k|                eeo[1] =
  849|   483k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  850|   483k|                                                + g_ai2_ihevc_trans_16[12][1]
  851|   483k|                                                                * pi2_tmp[12
  852|   483k|                                                                                * trans_size];
  853|   483k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  854|   483k|                                + 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.45M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (857:28): [True: 970k, False: 483k]
  ------------------
  858|   970k|                {
  859|   970k|                    ee[k] = eee[k] + eeo[k];
  860|   970k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  861|   970k|                }
  862|  2.42M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (862:28): [True: 1.94M, False: 483k]
  ------------------
  863|  1.94M|                {
  864|  1.94M|                    e[k] = ee[k] + eo[k];
  865|  1.94M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  866|  1.94M|                }
  867|  4.33M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (867:28): [True: 3.84M, False: 483k]
  ------------------
  868|  3.84M|                {
  869|  3.84M|                    WORD32 itrans_out;
  870|  3.84M|                    itrans_out =
  871|  3.84M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  872|  3.84M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  3.84M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.18M, False: 2.66M]
  |  |  |  |  |  Branch (40:53): [True: 1.16M, False: 1.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  873|  3.84M|                    itrans_out =
  874|  3.84M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|  3.84M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  3.84M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.12M, False: 2.72M]
  |  |  |  |  |  Branch (40:53): [True: 1.21M, False: 1.50M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  876|  3.84M|                }
  877|   483k|                pi2_tmp++;
  878|   483k|                pu1_pred += pred_strd;
  879|   483k|                pu1_dst += dst_strd;
  880|   483k|            }
  881|  30.4k|        }
  882|       |        /************************************************************************************************/
  883|       |        /************************************END - IT_RECON_16x16****************************************/
  884|       |        /************************************************************************************************/
  885|   114k|    }
  886|       |
  887|   379k|}

ihevc_itrans_recon_32x32:
  107|   166k|{
  108|   166k|    WORD32 j, k;
  109|   166k|    WORD32 e[16], o[16];
  110|   166k|    WORD32 ee[8], eo[8];
  111|   166k|    WORD32 eee[4], eeo[4];
  112|   166k|    WORD32 eeee[2], eeeo[2];
  113|   166k|    WORD32 add;
  114|   166k|    WORD32 shift;
  115|   166k|    WORD16 *pi2_tmp_orig;
  116|   166k|    WORD32 trans_size;
  117|   166k|    WORD32 zero_rows_2nd_stage = zero_cols;
  118|   166k|    WORD32 row_limit_2nd_stage;
  119|       |
  120|   166k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|   166k|#define TRANS_SIZE_32 32
  ------------------
  121|   166k|    pi2_tmp_orig = pi2_tmp;
  122|       |
  123|   166k|    if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0)
  ------------------
  |  Branch (123:8): [True: 74.9k, False: 91.0k]
  ------------------
  124|  74.9k|        row_limit_2nd_stage = 4;
  125|  91.0k|    else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00)
  ------------------
  |  Branch (125:13): [True: 36.9k, False: 54.1k]
  ------------------
  126|  36.9k|        row_limit_2nd_stage = 8;
  127|  54.1k|    else
  128|  54.1k|        row_limit_2nd_stage = TRANS_SIZE_32;
  ------------------
  |  |  432|  54.1k|#define TRANS_SIZE_32 32
  ------------------
  129|       |
  130|   166k|    if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (130:8): [True: 65.3k, False: 100k]
  ------------------
  131|  65.3k|    {
  132|       |        /************************************************************************************************/
  133|       |        /**********************************START - IT_RECON_32x32****************************************/
  134|       |        /************************************************************************************************/
  135|       |        /* Inverse Transform 1st stage */
  136|  65.3k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  65.3k|#define IT_SHIFT_STAGE_1 7
  ------------------
  137|  65.3k|        add = 1 << (shift - 1);
  138|       |
  139|   762k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (139:20): [True: 697k, False: 65.3k]
  ------------------
  140|   697k|        {
  141|       |            /* Checking for Zero Cols */
  142|   697k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (142:16): [True: 539k, False: 157k]
  ------------------
  143|   539k|            {
  144|   539k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  145|   539k|            }
  146|   157k|            else
  147|   157k|            {
  148|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  149|  2.68M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (149:28): [True: 2.52M, False: 157k]
  ------------------
  150|  2.52M|                {
  151|  2.52M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  152|  2.52M|                                    + g_ai2_ihevc_trans_32[3][k]
  153|  2.52M|                                                    * pi2_src[3 * src_strd];
  154|  2.52M|                }
  155|  1.42M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (155:28): [True: 1.26M, False: 157k]
  ------------------
  156|  1.26M|                {
  157|  1.26M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd];
  158|  1.26M|                }
  159|       |//                for(k = 0; k < 4; k++)
  160|   157k|                {
  161|   157k|                    eeo[0] = 0;
  162|   157k|                    eeo[1] = 0;
  163|   157k|                    eeo[2] = 0;
  164|   157k|                    eeo[3] = 0;
  165|   157k|                }
  166|   157k|                eeeo[0] = 0;
  167|   157k|                eeeo[1] = 0;
  168|   157k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  169|   157k|                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|   157k|                eee[0] = eeee[0] + eeeo[0];
  173|   157k|                eee[3] = eeee[0] - eeeo[0];
  174|   157k|                eee[1] = eeee[1] + eeeo[1];
  175|   157k|                eee[2] = eeee[1] - eeeo[1];
  176|   789k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (176:28): [True: 631k, False: 157k]
  ------------------
  177|   631k|                {
  178|   631k|                    ee[k] = eee[k] + eeo[k];
  179|   631k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  180|   631k|                }
  181|  1.42M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (181:28): [True: 1.26M, False: 157k]
  ------------------
  182|  1.26M|                {
  183|  1.26M|                    e[k] = ee[k] + eo[k];
  184|  1.26M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  185|  1.26M|                }
  186|  2.68M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (186:28): [True: 2.52M, False: 157k]
  ------------------
  187|  2.52M|                {
  188|  2.52M|                    pi2_tmp[k] =
  189|  2.52M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.52M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.01k, False: 2.52M]
  |  |  |  |  |  Branch (40:53): [True: 3.68k, False: 2.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  2.52M|                    pi2_tmp[k + 16] =
  191|  2.52M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  2.52M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.62k, False: 2.52M]
  |  |  |  |  |  Branch (40:53): [True: 2.32k, False: 2.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  2.52M|                }
  193|   157k|            }
  194|   697k|            pi2_src++;
  195|   697k|            pi2_tmp += trans_size;
  196|   697k|            zero_cols = zero_cols >> 1;
  197|   697k|        }
  198|       |
  199|  65.3k|        pi2_tmp = pi2_tmp_orig;
  200|       |
  201|       |        /* Inverse Transform 2nd stage */
  202|  65.3k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  65.3k|#define IT_SHIFT_STAGE_2 12
  ------------------
  203|  65.3k|        add = 1 << (shift - 1);
  204|  65.3k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (204:12): [True: 39.7k, False: 25.6k]
  ------------------
  205|  39.7k|        {
  206|  1.28M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (206:24): [True: 1.24M, False: 39.7k]
  ------------------
  207|  1.24M|            {
  208|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  209|  20.9M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (209:28): [True: 19.6M, False: 1.24M]
  ------------------
  210|  19.6M|                {
  211|  19.6M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  212|  19.6M|                                    + g_ai2_ihevc_trans_32[3][k]
  213|  19.6M|                                                    * pi2_tmp[3 * trans_size];
  214|  19.6M|                }
  215|  11.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (215:28): [True: 9.91M, False: 1.24M]
  ------------------
  216|  9.91M|                {
  217|  9.91M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  218|  9.91M|                }
  219|       |//                for(k = 0; k < 4; k++)
  220|  1.24M|                {
  221|  1.24M|                    eeo[0] = 0;
  222|  1.24M|                    eeo[1] = 0;
  223|  1.24M|                    eeo[2] = 0;
  224|  1.24M|                    eeo[3] = 0;
  225|  1.24M|                }
  226|  1.24M|                eeeo[0] = 0;
  227|  1.24M|                eeeo[1] = 0;
  228|  1.24M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  229|  1.24M|                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.24M|                eee[0] = eeee[0] + eeeo[0];
  233|  1.24M|                eee[3] = eeee[0] - eeeo[0];
  234|  1.24M|                eee[1] = eeee[1] + eeeo[1];
  235|  1.24M|                eee[2] = eeee[1] - eeeo[1];
  236|  6.19M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (236:28): [True: 4.94M, False: 1.24M]
  ------------------
  237|  4.94M|                {
  238|  4.94M|                    ee[k] = eee[k] + eeo[k];
  239|  4.94M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  240|  4.94M|                }
  241|  11.0M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (241:28): [True: 9.85M, False: 1.24M]
  ------------------
  242|  9.85M|                {
  243|  9.85M|                    e[k] = ee[k] + eo[k];
  244|  9.85M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  245|  9.85M|                }
  246|  20.7M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (246:28): [True: 19.5M, False: 1.24M]
  ------------------
  247|  19.5M|                {
  248|  19.5M|                    WORD32 itrans_out;
  249|  19.5M|                    itrans_out =
  250|  19.5M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  19.5M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  19.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 19.5M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 19.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  19.5M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  19.5M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  19.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 878k, False: 18.6M]
  |  |  |  |  |  Branch (40:53): [True: 1.28M, False: 17.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  19.5M|                    itrans_out =
  253|  19.5M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  19.5M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  19.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 19.5M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 19.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  19.5M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  19.5M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  19.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.04M, False: 18.4M]
  |  |  |  |  |  Branch (40:53): [True: 1.21M, False: 17.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|  19.5M|                }
  256|  1.24M|                pi2_tmp++;
  257|  1.24M|                pu1_pred += pred_strd;
  258|  1.24M|                pu1_dst += dst_strd;
  259|  1.24M|            }
  260|  39.7k|        }
  261|  25.6k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (261:17): [True: 11.7k, False: 13.8k]
  ------------------
  262|  11.7k|        {
  263|   372k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (263:24): [True: 360k, False: 11.7k]
  ------------------
  264|   360k|            {
  265|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  266|  6.05M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (266:28): [True: 5.69M, False: 360k]
  ------------------
  267|  5.69M|                {
  268|  5.69M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  269|  5.69M|                                    + g_ai2_ihevc_trans_32[3][k]
  270|  5.69M|                                                    * pi2_tmp[3 * trans_size]
  271|  5.69M|                                    + g_ai2_ihevc_trans_32[5][k]
  272|  5.69M|                                                    * pi2_tmp[5 * trans_size]
  273|  5.69M|                                    + g_ai2_ihevc_trans_32[7][k]
  274|  5.69M|                                                    * pi2_tmp[7 * trans_size];
  275|  5.69M|                }
  276|  3.24M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (276:28): [True: 2.88M, False: 360k]
  ------------------
  277|  2.88M|                {
  278|  2.88M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  279|  2.88M|                                    + g_ai2_ihevc_trans_32[6][k]
  280|  2.88M|                                                    * pi2_tmp[6 * trans_size];
  281|  2.88M|                }
  282|  1.81M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (282:28): [True: 1.44M, False: 360k]
  ------------------
  283|  1.44M|                {
  284|  1.44M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  285|  1.44M|                }
  286|   360k|                eeeo[0] = 0;
  287|   360k|                eeeo[1] = 0;
  288|   360k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  289|   360k|                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|   360k|                eee[0] = eeee[0] + eeeo[0];
  293|   360k|                eee[3] = eeee[0] - eeeo[0];
  294|   360k|                eee[1] = eeee[1] + eeeo[1];
  295|   360k|                eee[2] = eeee[1] - eeeo[1];
  296|  1.81M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (296:28): [True: 1.45M, False: 360k]
  ------------------
  297|  1.45M|                {
  298|  1.45M|                    ee[k] = eee[k] + eeo[k];
  299|  1.45M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  300|  1.45M|                }
  301|  3.27M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (301:28): [True: 2.91M, False: 360k]
  ------------------
  302|  2.91M|                {
  303|  2.91M|                    e[k] = ee[k] + eo[k];
  304|  2.91M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  305|  2.91M|                }
  306|  6.08M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (306:28): [True: 5.72M, False: 360k]
  ------------------
  307|  5.72M|                {
  308|  5.72M|                    WORD32 itrans_out;
  309|  5.72M|                    itrans_out =
  310|  5.72M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.72M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.72M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.72M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.72M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|  5.72M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  5.72M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.72M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 229k, False: 5.49M]
  |  |  |  |  |  Branch (40:53): [True: 528k, False: 4.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  312|  5.72M|                    itrans_out =
  313|  5.72M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  5.72M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.72M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.72M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.72M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|  5.72M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  5.72M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.72M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 222k, False: 5.49M]
  |  |  |  |  |  Branch (40:53): [True: 526k, False: 4.97M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|  5.72M|                }
  316|   360k|                pi2_tmp++;
  317|   360k|                pu1_pred += pred_strd;
  318|   360k|                pu1_dst += dst_strd;
  319|   360k|            }
  320|  11.7k|        }
  321|  13.8k|        else /* All rows of output of 1st stage are non-zero */
  322|  13.8k|        {
  323|   432k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (323:24): [True: 418k, False: 13.8k]
  ------------------
  324|   418k|            {
  325|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  326|  7.07M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (326:28): [True: 6.66M, False: 418k]
  ------------------
  327|  6.66M|                {
  328|  6.66M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  329|  6.66M|                                    + g_ai2_ihevc_trans_32[3][k]
  330|  6.66M|                                                    * pi2_tmp[3 * trans_size]
  331|  6.66M|                                    + g_ai2_ihevc_trans_32[5][k]
  332|  6.66M|                                                    * pi2_tmp[5 * trans_size]
  333|  6.66M|                                    + g_ai2_ihevc_trans_32[7][k]
  334|  6.66M|                                                    * pi2_tmp[7 * trans_size]
  335|  6.66M|                                    + g_ai2_ihevc_trans_32[9][k]
  336|  6.66M|                                                    * pi2_tmp[9 * trans_size]
  337|  6.66M|                                    + g_ai2_ihevc_trans_32[11][k]
  338|  6.66M|                                                    * pi2_tmp[11 * trans_size]
  339|  6.66M|                                    + g_ai2_ihevc_trans_32[13][k]
  340|  6.66M|                                                    * pi2_tmp[13 * trans_size]
  341|  6.66M|                                    + g_ai2_ihevc_trans_32[15][k]
  342|  6.66M|                                                    * pi2_tmp[15 * trans_size]
  343|  6.66M|                                    + g_ai2_ihevc_trans_32[17][k]
  344|  6.66M|                                                    * pi2_tmp[17 * trans_size]
  345|  6.66M|                                    + g_ai2_ihevc_trans_32[19][k]
  346|  6.66M|                                                    * pi2_tmp[19 * trans_size]
  347|  6.66M|                                    + g_ai2_ihevc_trans_32[21][k]
  348|  6.66M|                                                    * pi2_tmp[21 * trans_size]
  349|  6.66M|                                    + g_ai2_ihevc_trans_32[23][k]
  350|  6.66M|                                                    * pi2_tmp[23 * trans_size]
  351|  6.66M|                                    + g_ai2_ihevc_trans_32[25][k]
  352|  6.66M|                                                    * pi2_tmp[25 * trans_size]
  353|  6.66M|                                    + g_ai2_ihevc_trans_32[27][k]
  354|  6.66M|                                                    * pi2_tmp[27 * trans_size]
  355|  6.66M|                                    + g_ai2_ihevc_trans_32[29][k]
  356|  6.66M|                                                    * pi2_tmp[29 * trans_size]
  357|  6.66M|                                    + g_ai2_ihevc_trans_32[31][k]
  358|  6.66M|                                                    * pi2_tmp[31 * trans_size];
  359|  6.66M|                }
  360|  3.80M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (360:28): [True: 3.39M, False: 418k]
  ------------------
  361|  3.39M|                {
  362|  3.39M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  363|  3.39M|                                    + g_ai2_ihevc_trans_32[6][k]
  364|  3.39M|                                                    * pi2_tmp[6 * trans_size]
  365|  3.39M|                                    + g_ai2_ihevc_trans_32[10][k]
  366|  3.39M|                                                    * pi2_tmp[10 * trans_size]
  367|  3.39M|                                    + g_ai2_ihevc_trans_32[14][k]
  368|  3.39M|                                                    * pi2_tmp[14 * trans_size]
  369|  3.39M|                                    + g_ai2_ihevc_trans_32[18][k]
  370|  3.39M|                                                    * pi2_tmp[18 * trans_size]
  371|  3.39M|                                    + g_ai2_ihevc_trans_32[22][k]
  372|  3.39M|                                                    * pi2_tmp[22 * trans_size]
  373|  3.39M|                                    + g_ai2_ihevc_trans_32[26][k]
  374|  3.39M|                                                    * pi2_tmp[26 * trans_size]
  375|  3.39M|                                    + g_ai2_ihevc_trans_32[30][k]
  376|  3.39M|                                                    * pi2_tmp[30 * trans_size];
  377|  3.39M|                }
  378|  2.14M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (378:28): [True: 1.72M, False: 418k]
  ------------------
  379|  1.72M|                {
  380|  1.72M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  381|  1.72M|                                    + g_ai2_ihevc_trans_32[12][k]
  382|  1.72M|                                                    * pi2_tmp[12 * trans_size]
  383|  1.72M|                                    + g_ai2_ihevc_trans_32[20][k]
  384|  1.72M|                                                    * pi2_tmp[20 * trans_size]
  385|  1.72M|                                    + g_ai2_ihevc_trans_32[28][k]
  386|  1.72M|                                                    * pi2_tmp[28 * trans_size];
  387|  1.72M|                }
  388|   418k|                eeeo[0] =
  389|   418k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  390|   418k|                                                + g_ai2_ihevc_trans_32[24][0]
  391|   418k|                                                                * pi2_tmp[24
  392|   418k|                                                                                * trans_size];
  393|   418k|                eeeo[1] =
  394|   418k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  395|   418k|                                                + g_ai2_ihevc_trans_32[24][1]
  396|   418k|                                                                * pi2_tmp[24
  397|   418k|                                                                                * trans_size];
  398|   418k|                eeee[0] =
  399|   418k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  400|   418k|                                                + g_ai2_ihevc_trans_32[16][0]
  401|   418k|                                                                * pi2_tmp[16
  402|   418k|                                                                                * trans_size];
  403|   418k|                eeee[1] =
  404|   418k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  405|   418k|                                                + g_ai2_ihevc_trans_32[16][1]
  406|   418k|                                                                * pi2_tmp[16
  407|   418k|                                                                                * trans_size];
  408|       |
  409|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  410|   418k|                eee[0] = eeee[0] + eeeo[0];
  411|   418k|                eee[3] = eeee[0] - eeeo[0];
  412|   418k|                eee[1] = eeee[1] + eeeo[1];
  413|   418k|                eee[2] = eeee[1] - eeeo[1];
  414|  2.13M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (414:28): [True: 1.72M, False: 418k]
  ------------------
  415|  1.72M|                {
  416|  1.72M|                    ee[k] = eee[k] + eeo[k];
  417|  1.72M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  418|  1.72M|                }
  419|  3.84M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (419:28): [True: 3.42M, False: 418k]
  ------------------
  420|  3.42M|                {
  421|  3.42M|                    e[k] = ee[k] + eo[k];
  422|  3.42M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  423|  3.42M|                }
  424|  7.04M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (424:28): [True: 6.62M, False: 418k]
  ------------------
  425|  6.62M|                {
  426|  6.62M|                    WORD32 itrans_out;
  427|  6.62M|                    itrans_out =
  428|  6.62M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  6.62M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.62M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.62M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|  6.62M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  6.62M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 945k, False: 5.67M]
  |  |  |  |  |  Branch (40:53): [True: 291k, False: 5.38M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|  6.62M|                    itrans_out =
  431|  6.62M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  6.62M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.62M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.62M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|  6.62M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  6.62M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.29M, False: 5.32M]
  |  |  |  |  |  Branch (40:53): [True: 246k, False: 5.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  6.62M|                }
  434|   418k|                pi2_tmp++;
  435|   418k|                pu1_pred += pred_strd;
  436|   418k|                pu1_dst += dst_strd;
  437|   418k|            }
  438|  13.8k|        }
  439|       |        /************************************************************************************************/
  440|       |        /************************************END - IT_RECON_32x32****************************************/
  441|       |        /************************************************************************************************/
  442|  65.3k|    }
  443|   100k|    else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (443:13): [True: 48.9k, False: 51.7k]
  ------------------
  444|  48.9k|    {
  445|       |        /************************************************************************************************/
  446|       |        /**********************************START - IT_RECON_32x32****************************************/
  447|       |        /************************************************************************************************/
  448|       |        /* Inverse Transform 1st stage */
  449|  48.9k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  48.9k|#define IT_SHIFT_STAGE_1 7
  ------------------
  450|  48.9k|        add = 1 << (shift - 1);
  451|       |
  452|   687k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (452:20): [True: 638k, False: 48.9k]
  ------------------
  453|   638k|        {
  454|       |            /* Checking for Zero Cols */
  455|   638k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (455:16): [True: 541k, False: 96.9k]
  ------------------
  456|   541k|            {
  457|   541k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  458|   541k|            }
  459|  96.9k|            else
  460|  96.9k|            {
  461|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  462|  1.65M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (462:28): [True: 1.55M, False: 96.9k]
  ------------------
  463|  1.55M|                {
  464|  1.55M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  465|  1.55M|                                    + g_ai2_ihevc_trans_32[3][k]
  466|  1.55M|                                                    * pi2_src[3 * src_strd]
  467|  1.55M|                                    + g_ai2_ihevc_trans_32[5][k]
  468|  1.55M|                                                    * pi2_src[5 * src_strd]
  469|  1.55M|                                    + g_ai2_ihevc_trans_32[7][k]
  470|  1.55M|                                                    * pi2_src[7 * src_strd];
  471|  1.55M|                }
  472|   875k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (472:28): [True: 778k, False: 96.9k]
  ------------------
  473|   778k|                {
  474|   778k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  475|   778k|                                    + g_ai2_ihevc_trans_32[6][k]
  476|   778k|                                                    * pi2_src[6 * src_strd];
  477|   778k|                }
  478|   486k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (478:28): [True: 389k, False: 96.9k]
  ------------------
  479|   389k|                {
  480|   389k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd];
  481|   389k|                }
  482|  96.9k|                eeeo[0] = 0;
  483|  96.9k|                eeeo[1] = 0;
  484|  96.9k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  485|  96.9k|                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|  96.9k|                eee[0] = eeee[0] + eeeo[0];
  489|  96.9k|                eee[3] = eeee[0] - eeeo[0];
  490|  96.9k|                eee[1] = eeee[1] + eeeo[1];
  491|  96.9k|                eee[2] = eeee[1] - eeeo[1];
  492|   486k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (492:28): [True: 389k, False: 96.9k]
  ------------------
  493|   389k|                {
  494|   389k|                    ee[k] = eee[k] + eeo[k];
  495|   389k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  496|   389k|                }
  497|   875k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (497:28): [True: 778k, False: 96.9k]
  ------------------
  498|   778k|                {
  499|   778k|                    e[k] = ee[k] + eo[k];
  500|   778k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  501|   778k|                }
  502|  1.65M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (502:28): [True: 1.55M, False: 96.9k]
  ------------------
  503|  1.55M|                {
  504|  1.55M|                    pi2_tmp[k] =
  505|  1.55M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.55M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.70k, False: 1.55M]
  |  |  |  |  |  Branch (40:53): [True: 3.85k, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  1.55M|                    pi2_tmp[k + 16] =
  507|  1.55M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  1.55M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.50k, False: 1.55M]
  |  |  |  |  |  Branch (40:53): [True: 5.17k, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  508|  1.55M|                }
  509|  96.9k|            }
  510|   638k|            pi2_src++;
  511|   638k|            pi2_tmp += trans_size;
  512|   638k|            zero_cols = zero_cols >> 1;
  513|   638k|        }
  514|       |
  515|  48.9k|        pi2_tmp = pi2_tmp_orig;
  516|       |
  517|       |        /* Inverse Transform 2nd stage */
  518|  48.9k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  48.9k|#define IT_SHIFT_STAGE_2 12
  ------------------
  519|  48.9k|        add = 1 << (shift - 1);
  520|  48.9k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (520:12): [True: 21.2k, False: 27.6k]
  ------------------
  521|  21.2k|        {
  522|   678k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (522:24): [True: 657k, False: 21.2k]
  ------------------
  523|   657k|            {
  524|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  525|  11.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (525:28): [True: 10.4M, False: 657k]
  ------------------
  526|  10.4M|                {
  527|  10.4M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  528|  10.4M|                                    + g_ai2_ihevc_trans_32[3][k]
  529|  10.4M|                                                    * pi2_tmp[3 * trans_size];
  530|  10.4M|                }
  531|  5.94M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (531:28): [True: 5.28M, False: 657k]
  ------------------
  532|  5.28M|                {
  533|  5.28M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  534|  5.28M|                }
  535|       |//                for(k = 0; k < 4; k++)
  536|   657k|                {
  537|   657k|                    eeo[0] = 0;
  538|   657k|                    eeo[1] = 0;
  539|   657k|                    eeo[2] = 0;
  540|   657k|                    eeo[3] = 0;
  541|   657k|                }
  542|   657k|                eeeo[0] = 0;
  543|   657k|                eeeo[1] = 0;
  544|   657k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  545|   657k|                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|   657k|                eee[0] = eeee[0] + eeeo[0];
  549|   657k|                eee[3] = eeee[0] - eeeo[0];
  550|   657k|                eee[1] = eeee[1] + eeeo[1];
  551|   657k|                eee[2] = eeee[1] - eeeo[1];
  552|  3.29M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (552:28): [True: 2.64M, False: 657k]
  ------------------
  553|  2.64M|                {
  554|  2.64M|                    ee[k] = eee[k] + eeo[k];
  555|  2.64M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  556|  2.64M|                }
  557|  5.93M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (557:28): [True: 5.28M, False: 657k]
  ------------------
  558|  5.28M|                {
  559|  5.28M|                    e[k] = ee[k] + eo[k];
  560|  5.28M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  561|  5.28M|                }
  562|  11.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (562:28): [True: 10.4M, False: 657k]
  ------------------
  563|  10.4M|                {
  564|  10.4M|                    WORD32 itrans_out;
  565|  10.4M|                    itrans_out =
  566|  10.4M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  10.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  10.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 10.4M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 10.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  567|  10.4M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  10.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  10.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.10M, False: 9.33M]
  |  |  |  |  |  Branch (40:53): [True: 375k, False: 8.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|  10.4M|                    itrans_out =
  569|  10.4M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  10.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  10.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 10.4M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 10.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  10.4M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  10.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  10.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.05M, False: 9.38M]
  |  |  |  |  |  Branch (40:53): [True: 388k, False: 8.99M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  571|  10.4M|                }
  572|   657k|                pi2_tmp++;
  573|   657k|                pu1_pred += pred_strd;
  574|   657k|                pu1_dst += dst_strd;
  575|   657k|            }
  576|  21.2k|        }
  577|  27.6k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (577:17): [True: 13.8k, False: 13.8k]
  ------------------
  578|  13.8k|        {
  579|   413k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (579:24): [True: 399k, False: 13.8k]
  ------------------
  580|   399k|            {
  581|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  582|  6.73M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (582:28): [True: 6.34M, False: 399k]
  ------------------
  583|  6.34M|                {
  584|  6.34M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  585|  6.34M|                                    + g_ai2_ihevc_trans_32[3][k]
  586|  6.34M|                                                    * pi2_tmp[3 * trans_size]
  587|  6.34M|                                    + g_ai2_ihevc_trans_32[5][k]
  588|  6.34M|                                                    * pi2_tmp[5 * trans_size]
  589|  6.34M|                                    + g_ai2_ihevc_trans_32[7][k]
  590|  6.34M|                                                    * pi2_tmp[7 * trans_size];
  591|  6.34M|                }
  592|  3.68M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (592:28): [True: 3.29M, False: 399k]
  ------------------
  593|  3.29M|                {
  594|  3.29M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  595|  3.29M|                                    + g_ai2_ihevc_trans_32[6][k]
  596|  3.29M|                                                    * pi2_tmp[6 * trans_size];
  597|  3.29M|                }
  598|  2.06M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (598:28): [True: 1.66M, False: 399k]
  ------------------
  599|  1.66M|                {
  600|  1.66M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  601|  1.66M|                }
  602|   399k|                eeeo[0] = 0;
  603|   399k|                eeeo[1] = 0;
  604|   399k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  605|   399k|                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|   399k|                eee[0] = eeee[0] + eeeo[0];
  609|   399k|                eee[3] = eeee[0] - eeeo[0];
  610|   399k|                eee[1] = eeee[1] + eeeo[1];
  611|   399k|                eee[2] = eeee[1] - eeeo[1];
  612|  2.06M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (612:28): [True: 1.66M, False: 399k]
  ------------------
  613|  1.66M|                {
  614|  1.66M|                    ee[k] = eee[k] + eeo[k];
  615|  1.66M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  616|  1.66M|                }
  617|  3.70M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (617:28): [True: 3.30M, False: 399k]
  ------------------
  618|  3.30M|                {
  619|  3.30M|                    e[k] = ee[k] + eo[k];
  620|  3.30M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  621|  3.30M|                }
  622|  6.61M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (622:28): [True: 6.21M, False: 399k]
  ------------------
  623|  6.21M|                {
  624|  6.21M|                    WORD32 itrans_out;
  625|  6.21M|                    itrans_out =
  626|  6.21M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  6.21M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.21M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|  6.21M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  6.21M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 130k, False: 6.08M]
  |  |  |  |  |  Branch (40:53): [True: 1.18M, False: 4.90M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|  6.21M|                    itrans_out =
  629|  6.21M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  6.21M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.21M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  630|  6.21M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  6.21M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 118k, False: 6.10M]
  |  |  |  |  |  Branch (40:53): [True: 1.18M, False: 4.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  631|  6.21M|                }
  632|   399k|                pi2_tmp++;
  633|   399k|                pu1_pred += pred_strd;
  634|   399k|                pu1_dst += dst_strd;
  635|   399k|            }
  636|  13.8k|        }
  637|  13.8k|        else /* All rows of output of 1st stage are non-zero */
  638|  13.8k|        {
  639|   442k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (639:24): [True: 428k, False: 13.8k]
  ------------------
  640|   428k|            {
  641|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  642|  7.08M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (642:28): [True: 6.65M, False: 428k]
  ------------------
  643|  6.65M|                {
  644|  6.65M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  645|  6.65M|                                    + g_ai2_ihevc_trans_32[3][k]
  646|  6.65M|                                                    * pi2_tmp[3 * trans_size]
  647|  6.65M|                                    + g_ai2_ihevc_trans_32[5][k]
  648|  6.65M|                                                    * pi2_tmp[5 * trans_size]
  649|  6.65M|                                    + g_ai2_ihevc_trans_32[7][k]
  650|  6.65M|                                                    * pi2_tmp[7 * trans_size]
  651|  6.65M|                                    + g_ai2_ihevc_trans_32[9][k]
  652|  6.65M|                                                    * pi2_tmp[9 * trans_size]
  653|  6.65M|                                    + g_ai2_ihevc_trans_32[11][k]
  654|  6.65M|                                                    * pi2_tmp[11 * trans_size]
  655|  6.65M|                                    + g_ai2_ihevc_trans_32[13][k]
  656|  6.65M|                                                    * pi2_tmp[13 * trans_size]
  657|  6.65M|                                    + g_ai2_ihevc_trans_32[15][k]
  658|  6.65M|                                                    * pi2_tmp[15 * trans_size]
  659|  6.65M|                                    + g_ai2_ihevc_trans_32[17][k]
  660|  6.65M|                                                    * pi2_tmp[17 * trans_size]
  661|  6.65M|                                    + g_ai2_ihevc_trans_32[19][k]
  662|  6.65M|                                                    * pi2_tmp[19 * trans_size]
  663|  6.65M|                                    + g_ai2_ihevc_trans_32[21][k]
  664|  6.65M|                                                    * pi2_tmp[21 * trans_size]
  665|  6.65M|                                    + g_ai2_ihevc_trans_32[23][k]
  666|  6.65M|                                                    * pi2_tmp[23 * trans_size]
  667|  6.65M|                                    + g_ai2_ihevc_trans_32[25][k]
  668|  6.65M|                                                    * pi2_tmp[25 * trans_size]
  669|  6.65M|                                    + g_ai2_ihevc_trans_32[27][k]
  670|  6.65M|                                                    * pi2_tmp[27 * trans_size]
  671|  6.65M|                                    + g_ai2_ihevc_trans_32[29][k]
  672|  6.65M|                                                    * pi2_tmp[29 * trans_size]
  673|  6.65M|                                    + g_ai2_ihevc_trans_32[31][k]
  674|  6.65M|                                                    * pi2_tmp[31 * trans_size];
  675|  6.65M|                }
  676|  3.82M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (676:28): [True: 3.39M, False: 428k]
  ------------------
  677|  3.39M|                {
  678|  3.39M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  679|  3.39M|                                    + g_ai2_ihevc_trans_32[6][k]
  680|  3.39M|                                                    * pi2_tmp[6 * trans_size]
  681|  3.39M|                                    + g_ai2_ihevc_trans_32[10][k]
  682|  3.39M|                                                    * pi2_tmp[10 * trans_size]
  683|  3.39M|                                    + g_ai2_ihevc_trans_32[14][k]
  684|  3.39M|                                                    * pi2_tmp[14 * trans_size]
  685|  3.39M|                                    + g_ai2_ihevc_trans_32[18][k]
  686|  3.39M|                                                    * pi2_tmp[18 * trans_size]
  687|  3.39M|                                    + g_ai2_ihevc_trans_32[22][k]
  688|  3.39M|                                                    * pi2_tmp[22 * trans_size]
  689|  3.39M|                                    + g_ai2_ihevc_trans_32[26][k]
  690|  3.39M|                                                    * pi2_tmp[26 * trans_size]
  691|  3.39M|                                    + g_ai2_ihevc_trans_32[30][k]
  692|  3.39M|                                                    * pi2_tmp[30 * trans_size];
  693|  3.39M|                }
  694|  2.17M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (694:28): [True: 1.74M, False: 428k]
  ------------------
  695|  1.74M|                {
  696|  1.74M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  697|  1.74M|                                    + g_ai2_ihevc_trans_32[12][k]
  698|  1.74M|                                                    * pi2_tmp[12 * trans_size]
  699|  1.74M|                                    + g_ai2_ihevc_trans_32[20][k]
  700|  1.74M|                                                    * pi2_tmp[20 * trans_size]
  701|  1.74M|                                    + g_ai2_ihevc_trans_32[28][k]
  702|  1.74M|                                                    * pi2_tmp[28 * trans_size];
  703|  1.74M|                }
  704|   428k|                eeeo[0] =
  705|   428k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  706|   428k|                                                + g_ai2_ihevc_trans_32[24][0]
  707|   428k|                                                                * pi2_tmp[24
  708|   428k|                                                                                * trans_size];
  709|   428k|                eeeo[1] =
  710|   428k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  711|   428k|                                                + g_ai2_ihevc_trans_32[24][1]
  712|   428k|                                                                * pi2_tmp[24
  713|   428k|                                                                                * trans_size];
  714|   428k|                eeee[0] =
  715|   428k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  716|   428k|                                                + g_ai2_ihevc_trans_32[16][0]
  717|   428k|                                                                * pi2_tmp[16
  718|   428k|                                                                                * trans_size];
  719|   428k|                eeee[1] =
  720|   428k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  721|   428k|                                                + g_ai2_ihevc_trans_32[16][1]
  722|   428k|                                                                * pi2_tmp[16
  723|   428k|                                                                                * trans_size];
  724|       |
  725|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  726|   428k|                eee[0] = eeee[0] + eeeo[0];
  727|   428k|                eee[3] = eeee[0] - eeeo[0];
  728|   428k|                eee[1] = eeee[1] + eeeo[1];
  729|   428k|                eee[2] = eeee[1] - eeeo[1];
  730|  2.12M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (730:28): [True: 1.69M, False: 428k]
  ------------------
  731|  1.69M|                {
  732|  1.69M|                    ee[k] = eee[k] + eeo[k];
  733|  1.69M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  734|  1.69M|                }
  735|  3.80M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (735:28): [True: 3.37M, False: 428k]
  ------------------
  736|  3.37M|                {
  737|  3.37M|                    e[k] = ee[k] + eo[k];
  738|  3.37M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  739|  3.37M|                }
  740|  7.03M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (740:28): [True: 6.60M, False: 428k]
  ------------------
  741|  6.60M|                {
  742|  6.60M|                    WORD32 itrans_out;
  743|  6.60M|                    itrans_out =
  744|  6.60M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  6.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  6.60M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  6.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 363k, False: 6.24M]
  |  |  |  |  |  Branch (40:53): [True: 211k, False: 6.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|  6.60M|                    itrans_out =
  747|  6.60M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  6.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|  6.60M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  6.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 368k, False: 6.23M]
  |  |  |  |  |  Branch (40:53): [True: 214k, False: 6.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|  6.60M|                }
  750|   428k|                pi2_tmp++;
  751|   428k|                pu1_pred += pred_strd;
  752|   428k|                pu1_dst += dst_strd;
  753|   428k|            }
  754|  13.8k|        }
  755|       |        /************************************************************************************************/
  756|       |        /************************************END - IT_RECON_32x32****************************************/
  757|       |        /************************************************************************************************/
  758|  48.9k|    }
  759|  51.7k|    else  /* All rows of input are non-zero */
  760|  51.7k|    {
  761|       |        /************************************************************************************************/
  762|       |        /**********************************START - IT_RECON_32x32****************************************/
  763|       |        /************************************************************************************************/
  764|       |        /* Inverse Transform 1st stage */
  765|  51.7k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  51.7k|#define IT_SHIFT_STAGE_1 7
  ------------------
  766|  51.7k|        add = 1 << (shift - 1);
  767|       |
  768|  1.03M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (768:20): [True: 986k, False: 51.7k]
  ------------------
  769|   986k|        {
  770|       |            /* Checking for Zero Cols */
  771|   986k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (771:16): [True: 669k, False: 317k]
  ------------------
  772|   669k|            {
  773|   669k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  774|   669k|            }
  775|   317k|            else
  776|   317k|            {
  777|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  778|  5.40M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (778:28): [True: 5.08M, False: 317k]
  ------------------
  779|  5.08M|                {
  780|  5.08M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  781|  5.08M|                                    + g_ai2_ihevc_trans_32[3][k]
  782|  5.08M|                                                    * pi2_src[3 * src_strd]
  783|  5.08M|                                    + g_ai2_ihevc_trans_32[5][k]
  784|  5.08M|                                                    * pi2_src[5 * src_strd]
  785|  5.08M|                                    + g_ai2_ihevc_trans_32[7][k]
  786|  5.08M|                                                    * pi2_src[7 * src_strd]
  787|  5.08M|                                    + g_ai2_ihevc_trans_32[9][k]
  788|  5.08M|                                                    * pi2_src[9 * src_strd]
  789|  5.08M|                                    + g_ai2_ihevc_trans_32[11][k]
  790|  5.08M|                                                    * pi2_src[11 * src_strd]
  791|  5.08M|                                    + g_ai2_ihevc_trans_32[13][k]
  792|  5.08M|                                                    * pi2_src[13 * src_strd]
  793|  5.08M|                                    + g_ai2_ihevc_trans_32[15][k]
  794|  5.08M|                                                    * pi2_src[15 * src_strd]
  795|  5.08M|                                    + g_ai2_ihevc_trans_32[17][k]
  796|  5.08M|                                                    * pi2_src[17 * src_strd]
  797|  5.08M|                                    + g_ai2_ihevc_trans_32[19][k]
  798|  5.08M|                                                    * pi2_src[19 * src_strd]
  799|  5.08M|                                    + g_ai2_ihevc_trans_32[21][k]
  800|  5.08M|                                                    * pi2_src[21 * src_strd]
  801|  5.08M|                                    + g_ai2_ihevc_trans_32[23][k]
  802|  5.08M|                                                    * pi2_src[23 * src_strd]
  803|  5.08M|                                    + g_ai2_ihevc_trans_32[25][k]
  804|  5.08M|                                                    * pi2_src[25 * src_strd]
  805|  5.08M|                                    + g_ai2_ihevc_trans_32[27][k]
  806|  5.08M|                                                    * pi2_src[27 * src_strd]
  807|  5.08M|                                    + g_ai2_ihevc_trans_32[29][k]
  808|  5.08M|                                                    * pi2_src[29 * src_strd]
  809|  5.08M|                                    + g_ai2_ihevc_trans_32[31][k]
  810|  5.08M|                                                    * pi2_src[31 * src_strd];
  811|  5.08M|                }
  812|  2.87M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (812:28): [True: 2.55M, False: 317k]
  ------------------
  813|  2.55M|                {
  814|  2.55M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  815|  2.55M|                                    + g_ai2_ihevc_trans_32[6][k]
  816|  2.55M|                                                    * pi2_src[6 * src_strd]
  817|  2.55M|                                    + g_ai2_ihevc_trans_32[10][k]
  818|  2.55M|                                                    * pi2_src[10 * src_strd]
  819|  2.55M|                                    + g_ai2_ihevc_trans_32[14][k]
  820|  2.55M|                                                    * pi2_src[14 * src_strd]
  821|  2.55M|                                    + g_ai2_ihevc_trans_32[18][k]
  822|  2.55M|                                                    * pi2_src[18 * src_strd]
  823|  2.55M|                                    + g_ai2_ihevc_trans_32[22][k]
  824|  2.55M|                                                    * pi2_src[22 * src_strd]
  825|  2.55M|                                    + g_ai2_ihevc_trans_32[26][k]
  826|  2.55M|                                                    * pi2_src[26 * src_strd]
  827|  2.55M|                                    + g_ai2_ihevc_trans_32[30][k]
  828|  2.55M|                                                    * pi2_src[30 * src_strd];
  829|  2.55M|                }
  830|  1.59M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (830:28): [True: 1.27M, False: 317k]
  ------------------
  831|  1.27M|                {
  832|  1.27M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]
  833|  1.27M|                                    + g_ai2_ihevc_trans_32[12][k]
  834|  1.27M|                                                    * pi2_src[12 * src_strd]
  835|  1.27M|                                    + g_ai2_ihevc_trans_32[20][k]
  836|  1.27M|                                                    * pi2_src[20 * src_strd]
  837|  1.27M|                                    + g_ai2_ihevc_trans_32[28][k]
  838|  1.27M|                                                    * pi2_src[28 * src_strd];
  839|  1.27M|                }
  840|   317k|                eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd]
  841|   317k|                                + g_ai2_ihevc_trans_32[24][0]
  842|   317k|                                                * pi2_src[24 * src_strd];
  843|   317k|                eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd]
  844|   317k|                                + g_ai2_ihevc_trans_32[24][1]
  845|   317k|                                                * pi2_src[24 * src_strd];
  846|   317k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]
  847|   317k|                                + g_ai2_ihevc_trans_32[16][0]
  848|   317k|                                                * pi2_src[16 * src_strd];
  849|   317k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]
  850|   317k|                                + g_ai2_ihevc_trans_32[16][1]
  851|   317k|                                                * pi2_src[16 * src_strd];
  852|       |
  853|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  854|   317k|                eee[0] = eeee[0] + eeeo[0];
  855|   317k|                eee[3] = eeee[0] - eeeo[0];
  856|   317k|                eee[1] = eeee[1] + eeeo[1];
  857|   317k|                eee[2] = eeee[1] - eeeo[1];
  858|  1.59M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (858:28): [True: 1.27M, False: 317k]
  ------------------
  859|  1.27M|                {
  860|  1.27M|                    ee[k] = eee[k] + eeo[k];
  861|  1.27M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  862|  1.27M|                }
  863|  2.86M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (863:28): [True: 2.55M, False: 317k]
  ------------------
  864|  2.55M|                {
  865|  2.55M|                    e[k] = ee[k] + eo[k];
  866|  2.55M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  867|  2.55M|                }
  868|  5.40M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (868:28): [True: 5.09M, False: 317k]
  ------------------
  869|  5.09M|                {
  870|  5.09M|                    pi2_tmp[k] =
  871|  5.09M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.09M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 39.5k, False: 5.05M]
  |  |  |  |  |  Branch (40:53): [True: 39.6k, False: 5.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  872|  5.09M|                    pi2_tmp[k + 16] =
  873|  5.09M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  5.09M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 40.9k, False: 5.04M]
  |  |  |  |  |  Branch (40:53): [True: 39.5k, False: 5.00M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  874|  5.09M|                }
  875|   317k|            }
  876|   986k|            pi2_src++;
  877|   986k|            pi2_tmp += trans_size;
  878|   986k|            zero_cols = zero_cols >> 1;
  879|   986k|        }
  880|       |
  881|  51.7k|        pi2_tmp = pi2_tmp_orig;
  882|       |
  883|       |        /* Inverse Transform 2nd stage */
  884|  51.7k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  51.7k|#define IT_SHIFT_STAGE_2 12
  ------------------
  885|  51.7k|        add = 1 << (shift - 1);
  886|  51.7k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (886:12): [True: 13.9k, False: 37.7k]
  ------------------
  887|  13.9k|        {
  888|   454k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (888:24): [True: 440k, False: 13.9k]
  ------------------
  889|   440k|            {
  890|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  891|  7.48M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (891:28): [True: 7.04M, False: 440k]
  ------------------
  892|  7.04M|                {
  893|  7.04M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  894|  7.04M|                                    + g_ai2_ihevc_trans_32[3][k]
  895|  7.04M|                                                    * pi2_tmp[3 * trans_size];
  896|  7.04M|                }
  897|  3.98M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (897:28): [True: 3.54M, False: 440k]
  ------------------
  898|  3.54M|                {
  899|  3.54M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  900|  3.54M|                }
  901|       |//                for(k = 0; k < 4; k++)
  902|   440k|                {
  903|   440k|                    eeo[0] = 0;
  904|   440k|                    eeo[1] = 0;
  905|   440k|                    eeo[2] = 0;
  906|   440k|                    eeo[3] = 0;
  907|   440k|                }
  908|   440k|                eeeo[0] = 0;
  909|   440k|                eeeo[1] = 0;
  910|   440k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  911|   440k|                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|   440k|                eee[0] = eeee[0] + eeeo[0];
  915|   440k|                eee[3] = eeee[0] - eeeo[0];
  916|   440k|                eee[1] = eeee[1] + eeeo[1];
  917|   440k|                eee[2] = eeee[1] - eeeo[1];
  918|  2.19M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (918:28): [True: 1.75M, False: 440k]
  ------------------
  919|  1.75M|                {
  920|  1.75M|                    ee[k] = eee[k] + eeo[k];
  921|  1.75M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  922|  1.75M|                }
  923|  3.99M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (923:28): [True: 3.55M, False: 440k]
  ------------------
  924|  3.55M|                {
  925|  3.55M|                    e[k] = ee[k] + eo[k];
  926|  3.55M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  927|  3.55M|                }
  928|  7.36M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (928:28): [True: 6.92M, False: 440k]
  ------------------
  929|  6.92M|                {
  930|  6.92M|                    WORD32 itrans_out;
  931|  6.92M|                    itrans_out =
  932|  6.92M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  6.92M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.92M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  933|  6.92M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  6.92M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.14M, False: 5.77M]
  |  |  |  |  |  Branch (40:53): [True: 254k, False: 5.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  934|  6.92M|                    itrans_out =
  935|  6.92M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  6.92M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.92M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  936|  6.92M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  6.92M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.10M, False: 5.81M]
  |  |  |  |  |  Branch (40:53): [True: 268k, False: 5.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|  6.92M|                }
  938|   440k|                pi2_tmp++;
  939|   440k|                pu1_pred += pred_strd;
  940|   440k|                pu1_dst += dst_strd;
  941|   440k|            }
  942|  13.9k|        }
  943|  37.7k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (943:17): [True: 11.4k, False: 26.3k]
  ------------------
  944|  11.4k|        {
  945|   368k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (945:24): [True: 357k, False: 11.4k]
  ------------------
  946|   357k|            {
  947|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  948|  6.06M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (948:28): [True: 5.71M, False: 357k]
  ------------------
  949|  5.71M|                {
  950|  5.71M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  951|  5.71M|                                    + g_ai2_ihevc_trans_32[3][k]
  952|  5.71M|                                                    * pi2_tmp[3 * trans_size]
  953|  5.71M|                                    + g_ai2_ihevc_trans_32[5][k]
  954|  5.71M|                                                    * pi2_tmp[5 * trans_size]
  955|  5.71M|                                    + g_ai2_ihevc_trans_32[7][k]
  956|  5.71M|                                                    * pi2_tmp[7 * trans_size];
  957|  5.71M|                }
  958|  3.23M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (958:28): [True: 2.87M, False: 357k]
  ------------------
  959|  2.87M|                {
  960|  2.87M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  961|  2.87M|                                    + g_ai2_ihevc_trans_32[6][k]
  962|  2.87M|                                                    * pi2_tmp[6 * trans_size];
  963|  2.87M|                }
  964|  1.80M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (964:28): [True: 1.44M, False: 357k]
  ------------------
  965|  1.44M|                {
  966|  1.44M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  967|  1.44M|                }
  968|   357k|                eeeo[0] = 0;
  969|   357k|                eeeo[1] = 0;
  970|   357k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  971|   357k|                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|   357k|                eee[0] = eeee[0] + eeeo[0];
  975|   357k|                eee[3] = eeee[0] - eeeo[0];
  976|   357k|                eee[1] = eeee[1] + eeeo[1];
  977|   357k|                eee[2] = eeee[1] - eeeo[1];
  978|  1.80M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (978:28): [True: 1.44M, False: 357k]
  ------------------
  979|  1.44M|                {
  980|  1.44M|                    ee[k] = eee[k] + eeo[k];
  981|  1.44M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  982|  1.44M|                }
  983|  3.24M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (983:28): [True: 2.89M, False: 357k]
  ------------------
  984|  2.89M|                {
  985|  2.89M|                    e[k] = ee[k] + eo[k];
  986|  2.89M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  987|  2.89M|                }
  988|  5.99M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (988:28): [True: 5.63M, False: 357k]
  ------------------
  989|  5.63M|                {
  990|  5.63M|                    WORD32 itrans_out;
  991|  5.63M|                    itrans_out =
  992|  5.63M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.63M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.63M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.63M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  993|  5.63M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  5.63M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 468k, False: 5.16M]
  |  |  |  |  |  Branch (40:53): [True: 415k, False: 4.75M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|  5.63M|                    itrans_out =
  995|  5.63M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  5.63M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.63M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.63M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  996|  5.63M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  5.63M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.63M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 512k, False: 5.12M]
  |  |  |  |  |  Branch (40:53): [True: 405k, False: 4.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  997|  5.63M|                }
  998|   357k|                pi2_tmp++;
  999|   357k|                pu1_pred += pred_strd;
 1000|   357k|                pu1_dst += dst_strd;
 1001|   357k|            }
 1002|  11.4k|        }
 1003|  26.3k|        else /* All rows of output of 1st stage are non-zero */
 1004|  26.3k|        {
 1005|   831k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1005:24): [True: 805k, False: 26.3k]
  ------------------
 1006|   805k|            {
 1007|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1008|  13.5M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1008:28): [True: 12.7M, False: 805k]
  ------------------
 1009|  12.7M|                {
 1010|  12.7M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1011|  12.7M|                                    + g_ai2_ihevc_trans_32[3][k]
 1012|  12.7M|                                                    * pi2_tmp[3 * trans_size]
 1013|  12.7M|                                    + g_ai2_ihevc_trans_32[5][k]
 1014|  12.7M|                                                    * pi2_tmp[5 * trans_size]
 1015|  12.7M|                                    + g_ai2_ihevc_trans_32[7][k]
 1016|  12.7M|                                                    * pi2_tmp[7 * trans_size]
 1017|  12.7M|                                    + g_ai2_ihevc_trans_32[9][k]
 1018|  12.7M|                                                    * pi2_tmp[9 * trans_size]
 1019|  12.7M|                                    + g_ai2_ihevc_trans_32[11][k]
 1020|  12.7M|                                                    * pi2_tmp[11 * trans_size]
 1021|  12.7M|                                    + g_ai2_ihevc_trans_32[13][k]
 1022|  12.7M|                                                    * pi2_tmp[13 * trans_size]
 1023|  12.7M|                                    + g_ai2_ihevc_trans_32[15][k]
 1024|  12.7M|                                                    * pi2_tmp[15 * trans_size]
 1025|  12.7M|                                    + g_ai2_ihevc_trans_32[17][k]
 1026|  12.7M|                                                    * pi2_tmp[17 * trans_size]
 1027|  12.7M|                                    + g_ai2_ihevc_trans_32[19][k]
 1028|  12.7M|                                                    * pi2_tmp[19 * trans_size]
 1029|  12.7M|                                    + g_ai2_ihevc_trans_32[21][k]
 1030|  12.7M|                                                    * pi2_tmp[21 * trans_size]
 1031|  12.7M|                                    + g_ai2_ihevc_trans_32[23][k]
 1032|  12.7M|                                                    * pi2_tmp[23 * trans_size]
 1033|  12.7M|                                    + g_ai2_ihevc_trans_32[25][k]
 1034|  12.7M|                                                    * pi2_tmp[25 * trans_size]
 1035|  12.7M|                                    + g_ai2_ihevc_trans_32[27][k]
 1036|  12.7M|                                                    * pi2_tmp[27 * trans_size]
 1037|  12.7M|                                    + g_ai2_ihevc_trans_32[29][k]
 1038|  12.7M|                                                    * pi2_tmp[29 * trans_size]
 1039|  12.7M|                                    + g_ai2_ihevc_trans_32[31][k]
 1040|  12.7M|                                                    * pi2_tmp[31 * trans_size];
 1041|  12.7M|                }
 1042|  7.33M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1042:28): [True: 6.52M, False: 805k]
  ------------------
 1043|  6.52M|                {
 1044|  6.52M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1045|  6.52M|                                    + g_ai2_ihevc_trans_32[6][k]
 1046|  6.52M|                                                    * pi2_tmp[6 * trans_size]
 1047|  6.52M|                                    + g_ai2_ihevc_trans_32[10][k]
 1048|  6.52M|                                                    * pi2_tmp[10 * trans_size]
 1049|  6.52M|                                    + g_ai2_ihevc_trans_32[14][k]
 1050|  6.52M|                                                    * pi2_tmp[14 * trans_size]
 1051|  6.52M|                                    + g_ai2_ihevc_trans_32[18][k]
 1052|  6.52M|                                                    * pi2_tmp[18 * trans_size]
 1053|  6.52M|                                    + g_ai2_ihevc_trans_32[22][k]
 1054|  6.52M|                                                    * pi2_tmp[22 * trans_size]
 1055|  6.52M|                                    + g_ai2_ihevc_trans_32[26][k]
 1056|  6.52M|                                                    * pi2_tmp[26 * trans_size]
 1057|  6.52M|                                    + g_ai2_ihevc_trans_32[30][k]
 1058|  6.52M|                                                    * pi2_tmp[30 * trans_size];
 1059|  6.52M|                }
 1060|  4.12M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1060:28): [True: 3.32M, False: 805k]
  ------------------
 1061|  3.32M|                {
 1062|  3.32M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 1063|  3.32M|                                    + g_ai2_ihevc_trans_32[12][k]
 1064|  3.32M|                                                    * pi2_tmp[12 * trans_size]
 1065|  3.32M|                                    + g_ai2_ihevc_trans_32[20][k]
 1066|  3.32M|                                                    * pi2_tmp[20 * trans_size]
 1067|  3.32M|                                    + g_ai2_ihevc_trans_32[28][k]
 1068|  3.32M|                                                    * pi2_tmp[28 * trans_size];
 1069|  3.32M|                }
 1070|   805k|                eeeo[0] =
 1071|   805k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 1072|   805k|                                                + g_ai2_ihevc_trans_32[24][0]
 1073|   805k|                                                                * pi2_tmp[24
 1074|   805k|                                                                                * trans_size];
 1075|   805k|                eeeo[1] =
 1076|   805k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 1077|   805k|                                                + g_ai2_ihevc_trans_32[24][1]
 1078|   805k|                                                                * pi2_tmp[24
 1079|   805k|                                                                                * trans_size];
 1080|   805k|                eeee[0] =
 1081|   805k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 1082|   805k|                                                + g_ai2_ihevc_trans_32[16][0]
 1083|   805k|                                                                * pi2_tmp[16
 1084|   805k|                                                                                * trans_size];
 1085|   805k|                eeee[1] =
 1086|   805k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 1087|   805k|                                                + g_ai2_ihevc_trans_32[16][1]
 1088|   805k|                                                                * pi2_tmp[16
 1089|   805k|                                                                                * trans_size];
 1090|       |
 1091|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1092|   805k|                eee[0] = eeee[0] + eeeo[0];
 1093|   805k|                eee[3] = eeee[0] - eeeo[0];
 1094|   805k|                eee[1] = eeee[1] + eeeo[1];
 1095|   805k|                eee[2] = eeee[1] - eeeo[1];
 1096|  4.12M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1096:28): [True: 3.31M, False: 805k]
  ------------------
 1097|  3.31M|                {
 1098|  3.31M|                    ee[k] = eee[k] + eeo[k];
 1099|  3.31M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1100|  3.31M|                }
 1101|  7.40M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1101:28): [True: 6.59M, False: 805k]
  ------------------
 1102|  6.59M|                {
 1103|  6.59M|                    e[k] = ee[k] + eo[k];
 1104|  6.59M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1105|  6.59M|                }
 1106|  13.5M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1106:28): [True: 12.7M, False: 805k]
  ------------------
 1107|  12.7M|                {
 1108|  12.7M|                    WORD32 itrans_out;
 1109|  12.7M|                    itrans_out =
 1110|  12.7M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  12.7M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  12.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 12.7M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 12.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1111|  12.7M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  12.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  12.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.24M, False: 8.52M]
  |  |  |  |  |  Branch (40:53): [True: 1.00M, False: 7.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|  12.7M|                    itrans_out =
 1113|  12.7M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  12.7M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  12.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 12.7M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 12.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1114|  12.7M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  12.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  12.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.54M, False: 9.22M]
  |  |  |  |  |  Branch (40:53): [True: 982k, False: 8.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1115|  12.7M|                }
 1116|   805k|                pi2_tmp++;
 1117|   805k|                pu1_pred += pred_strd;
 1118|   805k|                pu1_dst += dst_strd;
 1119|   805k|            }
 1120|  26.3k|        }
 1121|       |        /************************************************************************************************/
 1122|       |        /************************************END - IT_RECON_32x32****************************************/
 1123|       |        /************************************************************************************************/
 1124|  51.7k|    }
 1125|   166k|}

ihevc_itrans_recon_8x8:
  106|   211k|{
  107|   211k|    WORD32 j, k;
  108|   211k|    WORD32 e[4], o[4];
  109|   211k|    WORD32 ee[2], eo[2];
  110|   211k|    WORD32 add;
  111|   211k|    WORD32 shift;
  112|   211k|    WORD16 *pi2_tmp_orig;
  113|   211k|    WORD32 trans_size;
  114|   211k|    WORD32 zero_rows_2nd_stage = zero_cols;
  115|   211k|    WORD32 row_limit_2nd_stage;
  116|       |
  117|   211k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   211k|#define TRANS_SIZE_8   8
  ------------------
  118|       |
  119|   211k|    pi2_tmp_orig = pi2_tmp;
  120|       |
  121|   211k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (121:8): [True: 145k, False: 65.8k]
  ------------------
  122|   145k|        row_limit_2nd_stage = 4;
  123|  65.8k|    else
  124|  65.8k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  65.8k|#define TRANS_SIZE_8   8
  ------------------
  125|       |
  126|       |
  127|   211k|    if((zero_rows & 0xF0) == 0xF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (127:8): [True: 160k, False: 50.9k]
  ------------------
  128|   160k|    {
  129|       |        /************************************************************************************************/
  130|       |        /**********************************START - IT_RECON_8x8******************************************/
  131|       |        /************************************************************************************************/
  132|       |
  133|       |        /* Inverse Transform 1st stage */
  134|   160k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   160k|#define IT_SHIFT_STAGE_1 7
  ------------------
  135|   160k|        add = 1 << (shift - 1);
  136|       |
  137|   995k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (137:20): [True: 834k, False: 160k]
  ------------------
  138|   834k|        {
  139|       |            /* Checking for Zero Cols */
  140|   834k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (140:16): [True: 317k, False: 517k]
  ------------------
  141|   317k|            {
  142|   317k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  143|   317k|            }
  144|   517k|            else
  145|   517k|            {
  146|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  147|  2.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (147:28): [True: 2.08M, False: 517k]
  ------------------
  148|  2.08M|                {
  149|  2.08M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  150|  2.08M|                                    + g_ai2_ihevc_trans_8[3][k]
  151|  2.08M|                                                    * pi2_src[3 * src_strd];
  152|  2.08M|                }
  153|   517k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd];
  154|   517k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd];
  155|   517k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0];
  156|   517k|                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|   517k|                e[0] = ee[0] + eo[0];
  160|   517k|                e[3] = ee[0] - eo[0];
  161|   517k|                e[1] = ee[1] + eo[1];
  162|   517k|                e[2] = ee[1] - eo[1];
  163|  2.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (163:28): [True: 2.08M, False: 517k]
  ------------------
  164|  2.08M|                {
  165|  2.08M|                    pi2_tmp[k] =
  166|  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: 115k, False: 1.96M]
  |  |  |  |  |  Branch (40:53): [True: 41.4k, False: 1.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|  2.08M|                    pi2_tmp[k + 4] =
  168|  2.08M|                                    CLIP_S16(((e[3 - k] - o[3 - 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: 42.7k, False: 2.04M]
  |  |  |  |  |  Branch (40:53): [True: 37.4k, False: 2.00M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  2.08M|                }
  170|   517k|            }
  171|   834k|            pi2_src++;
  172|   834k|            pi2_tmp += trans_size;
  173|   834k|            zero_cols = zero_cols >> 1;
  174|   834k|        }
  175|       |
  176|   160k|        pi2_tmp = pi2_tmp_orig;
  177|       |
  178|       |        /* Inverse Transform 2nd stage */
  179|   160k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   160k|#define IT_SHIFT_STAGE_2 12
  ------------------
  180|   160k|        add = 1 << (shift - 1);
  181|   160k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (181:12): [True: 111k, False: 49.4k]
  ------------------
  182|   111k|        {
  183|   994k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (183:24): [True: 882k, False: 111k]
  ------------------
  184|   882k|            {
  185|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  186|  4.41M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (186:28): [True: 3.53M, False: 882k]
  ------------------
  187|  3.53M|                {
  188|  3.53M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  189|  3.53M|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  190|  3.53M|                }
  191|   882k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  192|   882k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  193|   882k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  194|   882k|                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|   882k|                e[0] = ee[0] + eo[0];
  198|   882k|                e[3] = ee[0] - eo[0];
  199|   882k|                e[1] = ee[1] + eo[1];
  200|   882k|                e[2] = ee[1] - eo[1];
  201|  4.40M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (201:28): [True: 3.52M, False: 882k]
  ------------------
  202|  3.52M|                {
  203|  3.52M|                    WORD32 itrans_out;
  204|  3.52M|                    itrans_out =
  205|  3.52M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.52M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.52M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|  3.52M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  3.52M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 805k, False: 2.72M]
  |  |  |  |  |  Branch (40:53): [True: 732k, False: 1.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  3.52M|                    itrans_out =
  208|  3.52M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  3.52M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.52M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  3.52M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  3.52M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 800k, False: 2.72M]
  |  |  |  |  |  Branch (40:53): [True: 732k, False: 1.99M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  3.52M|                }
  211|   882k|                pi2_tmp++;
  212|   882k|                pu1_pred += pred_strd;
  213|   882k|                pu1_dst += dst_strd;
  214|   882k|            }
  215|   111k|        }
  216|  49.4k|        else /* All rows of output of 1st stage are non-zero */
  217|  49.4k|        {
  218|   440k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (218:24): [True: 391k, False: 49.4k]
  ------------------
  219|   391k|            {
  220|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  221|  1.95M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (221:28): [True: 1.56M, False: 391k]
  ------------------
  222|  1.56M|                {
  223|  1.56M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  224|  1.56M|                                    + g_ai2_ihevc_trans_8[3][k]
  225|  1.56M|                                                    * pi2_tmp[3 * trans_size]
  226|  1.56M|                                    + g_ai2_ihevc_trans_8[5][k]
  227|  1.56M|                                                    * pi2_tmp[5 * trans_size]
  228|  1.56M|                                    + g_ai2_ihevc_trans_8[7][k]
  229|  1.56M|                                                    * pi2_tmp[7 * trans_size];
  230|  1.56M|                }
  231|       |
  232|   391k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  233|   391k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  234|   391k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  235|   391k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  236|   391k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  237|   391k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  238|   391k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  239|   391k|                                + 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|   391k|                e[0] = ee[0] + eo[0];
  243|   391k|                e[3] = ee[0] - eo[0];
  244|   391k|                e[1] = ee[1] + eo[1];
  245|   391k|                e[2] = ee[1] - eo[1];
  246|  1.95M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (246:28): [True: 1.56M, False: 391k]
  ------------------
  247|  1.56M|                {
  248|  1.56M|                    WORD32 itrans_out;
  249|  1.56M|                    itrans_out =
  250|  1.56M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.56M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.56M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  1.56M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  1.56M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 517k, False: 1.04M]
  |  |  |  |  |  Branch (40:53): [True: 397k, False: 647k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  1.56M|                    itrans_out =
  253|  1.56M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  1.56M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.56M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  1.56M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  1.56M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 557k, False: 1.00M]
  |  |  |  |  |  Branch (40:53): [True: 401k, False: 603k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|  1.56M|                }
  256|   391k|                pi2_tmp++;
  257|   391k|                pu1_pred += pred_strd;
  258|   391k|                pu1_dst += dst_strd;
  259|   391k|            }
  260|  49.4k|        }
  261|       |        /************************************************************************************************/
  262|       |        /************************************END - IT_RECON_8x8******************************************/
  263|       |        /************************************************************************************************/
  264|   160k|    }
  265|  50.9k|    else /* All rows of input are non-zero */
  266|  50.9k|    {
  267|       |        /************************************************************************************************/
  268|       |        /**********************************START - IT_RECON_8x8******************************************/
  269|       |        /************************************************************************************************/
  270|       |
  271|       |        /* Inverse Transform 1st stage */
  272|  50.9k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  50.9k|#define IT_SHIFT_STAGE_1 7
  ------------------
  273|  50.9k|        add = 1 << (shift - 1);
  274|       |
  275|   322k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (275:20): [True: 271k, False: 50.9k]
  ------------------
  276|   271k|        {
  277|       |            /* Checking for Zero Cols */
  278|   271k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (278:16): [True: 92.5k, False: 178k]
  ------------------
  279|  92.5k|            {
  280|  92.5k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  281|  92.5k|            }
  282|   178k|            else
  283|   178k|            {
  284|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  285|   894k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (285:28): [True: 716k, False: 178k]
  ------------------
  286|   716k|                {
  287|   716k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  288|   716k|                                    + g_ai2_ihevc_trans_8[3][k]
  289|   716k|                                                    * pi2_src[3 * src_strd]
  290|   716k|                                    + g_ai2_ihevc_trans_8[5][k]
  291|   716k|                                                    * pi2_src[5 * src_strd]
  292|   716k|                                    + g_ai2_ihevc_trans_8[7][k]
  293|   716k|                                                    * pi2_src[7 * src_strd];
  294|   716k|                }
  295|       |
  296|   178k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  297|   178k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  298|   178k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  299|   178k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  300|   178k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  301|   178k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  302|   178k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  303|   178k|                                + 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|   178k|                e[0] = ee[0] + eo[0];
  307|   178k|                e[3] = ee[0] - eo[0];
  308|   178k|                e[1] = ee[1] + eo[1];
  309|   178k|                e[2] = ee[1] - eo[1];
  310|   894k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (310:28): [True: 716k, False: 178k]
  ------------------
  311|   716k|                {
  312|   716k|                    pi2_tmp[k] =
  313|   716k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   716k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   716k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 20.2k, False: 695k]
  |  |  |  |  |  Branch (40:53): [True: 20.0k, False: 675k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|   716k|                    pi2_tmp[k + 4] =
  315|   716k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   716k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   716k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 16.4k, False: 699k]
  |  |  |  |  |  Branch (40:53): [True: 18.0k, False: 681k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|   716k|                }
  317|   178k|            }
  318|   271k|            pi2_src++;
  319|   271k|            pi2_tmp += trans_size;
  320|   271k|            zero_cols = zero_cols >> 1;
  321|   271k|        }
  322|       |
  323|  50.9k|        pi2_tmp = pi2_tmp_orig;
  324|       |
  325|       |        /* Inverse Transform 2nd stage */
  326|  50.9k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  50.9k|#define IT_SHIFT_STAGE_2 12
  ------------------
  327|  50.9k|        add = 1 << (shift - 1);
  328|  50.9k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (328:12): [True: 34.6k, False: 16.2k]
  ------------------
  329|  34.6k|        {
  330|   310k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (330:24): [True: 275k, False: 34.6k]
  ------------------
  331|   275k|            {
  332|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  333|  1.37M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (333:28): [True: 1.10M, False: 275k]
  ------------------
  334|  1.10M|                {
  335|  1.10M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  336|  1.10M|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  337|  1.10M|                }
  338|   275k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  339|   275k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  340|   275k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  341|   275k|                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|   275k|                e[0] = ee[0] + eo[0];
  345|   275k|                e[3] = ee[0] - eo[0];
  346|   275k|                e[1] = ee[1] + eo[1];
  347|   275k|                e[2] = ee[1] - eo[1];
  348|  1.37M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (348:28): [True: 1.10M, False: 275k]
  ------------------
  349|  1.10M|                {
  350|  1.10M|                    WORD32 itrans_out;
  351|  1.10M|                    itrans_out =
  352|  1.10M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.10M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.10M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|  1.10M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  1.10M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 286k, False: 815k]
  |  |  |  |  |  Branch (40:53): [True: 283k, False: 531k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|  1.10M|                    itrans_out =
  355|  1.10M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  1.10M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.10M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|  1.10M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  1.10M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 281k, False: 820k]
  |  |  |  |  |  Branch (40:53): [True: 277k, False: 543k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|  1.10M|                }
  358|   275k|                pi2_tmp++;
  359|   275k|                pu1_pred += pred_strd;
  360|   275k|                pu1_dst += dst_strd;
  361|   275k|            }
  362|  34.6k|        }
  363|  16.2k|        else /* All rows of output of 1st stage are non-zero */
  364|  16.2k|        {
  365|   149k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (365:24): [True: 133k, False: 16.2k]
  ------------------
  366|   133k|            {
  367|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  368|   665k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (368:28): [True: 532k, False: 133k]
  ------------------
  369|   532k|                {
  370|   532k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  371|   532k|                                    + g_ai2_ihevc_trans_8[3][k]
  372|   532k|                                                    * pi2_tmp[3 * trans_size]
  373|   532k|                                    + g_ai2_ihevc_trans_8[5][k]
  374|   532k|                                                    * pi2_tmp[5 * trans_size]
  375|   532k|                                    + g_ai2_ihevc_trans_8[7][k]
  376|   532k|                                                    * pi2_tmp[7 * trans_size];
  377|   532k|                }
  378|       |
  379|   133k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  380|   133k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  381|   133k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  382|   133k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  383|   133k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  384|   133k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  385|   133k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  386|   133k|                                + 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|   133k|                e[0] = ee[0] + eo[0];
  390|   133k|                e[3] = ee[0] - eo[0];
  391|   133k|                e[1] = ee[1] + eo[1];
  392|   133k|                e[2] = ee[1] - eo[1];
  393|   665k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (393:28): [True: 532k, False: 133k]
  ------------------
  394|   532k|                {
  395|   532k|                    WORD32 itrans_out;
  396|   532k|                    itrans_out =
  397|   532k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   532k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   532k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 532k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 532k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  398|   532k|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|   532k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   532k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 90.2k, False: 441k]
  |  |  |  |  |  Branch (40:53): [True: 81.8k, False: 360k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|   532k|                    itrans_out =
  400|   532k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   532k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   532k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 532k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 532k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|   532k|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|   532k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   532k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 84.2k, False: 447k]
  |  |  |  |  |  Branch (40:53): [True: 83.1k, False: 364k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|   532k|                }
  403|   133k|                pi2_tmp++;
  404|   133k|                pu1_pred += pred_strd;
  405|   133k|                pu1_dst += dst_strd;
  406|   133k|            }
  407|  16.2k|        }
  408|       |        /************************************************************************************************/
  409|       |        /************************************END - IT_RECON_8x8******************************************/
  410|       |        /************************************************************************************************/
  411|  50.9k|    }
  412|   211k|}

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

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

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

ihevc_recon_4x4_ttype1:
  100|   636k|{
  101|   636k|    WORD32 i, j;
  102|   636k|    WORD32 trans_size;
  103|       |
  104|   636k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   636k|#define TRANS_SIZE_4   4
  ------------------
  105|       |
  106|       |    /* Reconstruction */
  107|       |
  108|  3.18M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (108:16): [True: 2.54M, False: 636k]
  ------------------
  109|  2.54M|    {
  110|       |        /* Checking for Zero Cols */
  111|  2.54M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (111:12): [True: 634k, False: 1.91M]
  ------------------
  112|   634k|        {
  113|  3.17M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (113:24): [True: 2.53M, False: 634k]
  ------------------
  114|  2.53M|            {
  115|  2.53M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  116|  2.53M|            }
  117|   634k|        }
  118|  1.91M|        else
  119|  1.91M|        {
  120|  9.55M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (120:24): [True: 7.64M, False: 1.91M]
  ------------------
  121|  7.64M|            {
  122|  7.64M|                pu1_dst[j * dst_strd] =
  123|  7.64M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  7.64M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.64M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.12M, False: 6.52M]
  |  |  |  |  |  Branch (40:53): [True: 242k, False: 6.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|  7.64M|            }
  125|  1.91M|        }
  126|  2.54M|        pi2_src++;
  127|  2.54M|        pu1_dst++;
  128|  2.54M|        pu1_pred++;
  129|  2.54M|        zero_cols = zero_cols >> 1;
  130|  2.54M|    }
  131|   636k|}
ihevc_recon_4x4:
  182|  45.8k|{
  183|  45.8k|    WORD32 i, j;
  184|  45.8k|    WORD32 trans_size;
  185|       |
  186|  45.8k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  45.8k|#define TRANS_SIZE_4   4
  ------------------
  187|       |
  188|       |    /* Reconstruction */
  189|       |
  190|   229k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (190:16): [True: 183k, False: 45.8k]
  ------------------
  191|   183k|    {
  192|       |        /* Checking for Zero Cols */
  193|   183k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (193:12): [True: 78.5k, False: 104k]
  ------------------
  194|  78.5k|        {
  195|   392k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (195:24): [True: 314k, False: 78.5k]
  ------------------
  196|   314k|            {
  197|   314k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  198|   314k|            }
  199|  78.5k|        }
  200|   104k|        else
  201|   104k|        {
  202|   523k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (202:24): [True: 418k, False: 104k]
  ------------------
  203|   418k|            {
  204|   418k|                pu1_dst[j * dst_strd] =
  205|   418k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|   418k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   418k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 15.6k, False: 402k]
  |  |  |  |  |  Branch (40:53): [True: 34.2k, False: 368k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|   418k|            }
  207|   104k|        }
  208|   183k|        pi2_src++;
  209|   183k|        pu1_dst++;
  210|   183k|        pu1_pred++;
  211|   183k|        zero_cols = zero_cols >> 1;
  212|   183k|    }
  213|  45.8k|}
ihevc_recon_8x8:
  264|   128k|{
  265|   128k|    WORD32 i, j;
  266|   128k|    WORD32 trans_size;
  267|       |
  268|   128k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   128k|#define TRANS_SIZE_8   8
  ------------------
  269|       |
  270|       |    /* Reconstruction */
  271|       |
  272|  1.15M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (272:16): [True: 1.02M, False: 128k]
  ------------------
  273|  1.02M|    {
  274|       |        /* Checking for Zero Cols */
  275|  1.02M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (275:12): [True: 123k, False: 905k]
  ------------------
  276|   123k|        {
  277|  1.10M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (277:24): [True: 984k, False: 123k]
  ------------------
  278|   984k|            {
  279|   984k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  280|   984k|            }
  281|   123k|        }
  282|   905k|        else
  283|   905k|        {
  284|  8.14M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (284:24): [True: 7.24M, False: 905k]
  ------------------
  285|  7.24M|            {
  286|  7.24M|                pu1_dst[j * dst_strd] =
  287|  7.24M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  7.24M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.24M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 298k, False: 6.94M]
  |  |  |  |  |  Branch (40:53): [True: 321k, False: 6.61M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  7.24M|            }
  289|   905k|        }
  290|  1.02M|        pi2_src++;
  291|  1.02M|        pu1_dst++;
  292|  1.02M|        pu1_pred++;
  293|  1.02M|        zero_cols = zero_cols >> 1;
  294|  1.02M|    }
  295|   128k|}
ihevc_recon_16x16:
  346|  75.3k|{
  347|  75.3k|    WORD32 i, j;
  348|  75.3k|    WORD32 trans_size;
  349|       |
  350|  75.3k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  75.3k|#define TRANS_SIZE_16 16
  ------------------
  351|       |
  352|       |    /* Reconstruction */
  353|       |
  354|  1.27M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (354:16): [True: 1.19M, False: 75.3k]
  ------------------
  355|  1.19M|    {
  356|       |        /* Checking for Zero Cols */
  357|  1.19M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (357:12): [True: 144k, False: 1.05M]
  ------------------
  358|   144k|        {
  359|  2.45M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (359:24): [True: 2.30M, False: 144k]
  ------------------
  360|  2.30M|            {
  361|  2.30M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  362|  2.30M|            }
  363|   144k|        }
  364|  1.05M|        else
  365|  1.05M|        {
  366|  17.9M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (366:24): [True: 16.8M, False: 1.05M]
  ------------------
  367|  16.8M|            {
  368|  16.8M|                pu1_dst[j * dst_strd] =
  369|  16.8M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  16.8M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  16.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 575k, False: 16.2M]
  |  |  |  |  |  Branch (40:53): [True: 345k, False: 15.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  370|  16.8M|            }
  371|  1.05M|        }
  372|  1.19M|        pi2_src++;
  373|  1.19M|        pu1_dst++;
  374|  1.19M|        pu1_pred++;
  375|  1.19M|        zero_cols = zero_cols >> 1;
  376|  1.19M|    }
  377|  75.3k|}
ihevc_recon_32x32:
  428|  24.1k|{
  429|  24.1k|    WORD32 i, j;
  430|  24.1k|    WORD32 trans_size;
  431|       |
  432|  24.1k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|  24.1k|#define TRANS_SIZE_32 32
  ------------------
  433|       |
  434|       |    /* Reconstruction */
  435|       |
  436|   788k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (436:16): [True: 764k, False: 24.1k]
  ------------------
  437|   764k|    {
  438|       |        /* Checking for Zero Cols */
  439|   764k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (439:12): [True: 191k, False: 573k]
  ------------------
  440|   191k|        {
  441|  6.31M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (441:24): [True: 6.11M, False: 191k]
  ------------------
  442|  6.11M|            {
  443|  6.11M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  444|  6.11M|            }
  445|   191k|        }
  446|   573k|        else
  447|   573k|        {
  448|  18.8M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (448:24): [True: 18.3M, False: 573k]
  ------------------
  449|  18.3M|            {
  450|  18.3M|                pu1_dst[j * dst_strd] =
  451|  18.3M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  18.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  18.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.33M, False: 16.9M]
  |  |  |  |  |  Branch (40:53): [True: 1.64M, False: 15.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  452|  18.3M|            }
  453|   573k|        }
  454|   764k|        pi2_src++;
  455|   764k|        pu1_dst++;
  456|   764k|        pu1_pred++;
  457|   764k|        zero_cols = zero_cols >> 1;
  458|   764k|    }
  459|  24.1k|}

ihevc_sao_band_offset_luma:
   80|   134k|{
   81|   134k|    WORD32 band_shift;
   82|   134k|    WORD32 band_table[NUM_BAND_TABLE];
   83|   134k|    WORD32 i;
   84|   134k|    WORD32 row, col;
   85|       |
   86|       |    /* Updating left and top and top-left */
   87|  3.87M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (87:18): [True: 3.74M, False: 134k]
  ------------------
   88|  3.74M|    {
   89|  3.74M|        pu1_src_left[row] = pu1_src[row * src_strd + (wd - 1)];
   90|  3.74M|    }
   91|   134k|    pu1_src_top_left[0] = pu1_src_top[wd - 1];
   92|  3.94M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (92:18): [True: 3.81M, False: 134k]
  ------------------
   93|  3.81M|    {
   94|  3.81M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
   95|  3.81M|    }
   96|       |
   97|   134k|    band_shift = BIT_DEPTH_LUMA - 5;
  ------------------
  |  |  273|   134k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|   134k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
   98|  4.43M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   55|  4.43M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (98:16): [True: 4.30M, False: 134k]
  ------------------
   99|  4.30M|    {
  100|  4.30M|        band_table[i] = 0;
  101|  4.30M|    }
  102|   672k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (102:16): [True: 537k, False: 134k]
  ------------------
  103|   537k|    {
  104|   537k|        band_table[(i + sao_band_pos) & 31] = i + 1;
  105|   537k|    }
  106|       |
  107|  3.85M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (107:18): [True: 3.72M, False: 134k]
  ------------------
  108|  3.72M|    {
  109|   117M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (109:22): [True: 113M, False: 3.72M]
  ------------------
  110|   113M|        {
  111|   113M|            WORD32 band_idx;
  112|       |
  113|   113M|            band_idx = band_table[pu1_src[col] >> band_shift];
  114|   113M|            pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|   113M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 215k, False: 113M]
  |  |  |  Branch (40:53): [True: 793k, False: 112M]
  |  |  ------------------
  ------------------
  115|   113M|        }
  116|  3.72M|        pu1_src += src_strd;
  117|  3.72M|    }
  118|   134k|}
ihevc_sao_band_offset_chroma:
  134|   102k|{
  135|   102k|    WORD32 band_shift;
  136|   102k|    WORD32 band_table_u[NUM_BAND_TABLE];
  137|   102k|    WORD32 band_table_v[NUM_BAND_TABLE];
  138|   102k|    WORD32 i;
  139|   102k|    WORD32 row, col;
  140|       |
  141|       |    /* Updating left and top and top-left */
  142|  1.60M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (142:18): [True: 1.50M, False: 102k]
  ------------------
  143|  1.50M|    {
  144|  1.50M|        pu1_src_left[2 * row] = pu1_src[row * src_strd + (wd - 2)];
  145|  1.50M|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + (wd - 1)];
  146|  1.50M|    }
  147|   102k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  148|   102k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  149|  3.18M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (149:18): [True: 3.08M, False: 102k]
  ------------------
  150|  3.08M|    {
  151|  3.08M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  152|  3.08M|    }
  153|       |
  154|       |
  155|   102k|    band_shift = BIT_DEPTH_CHROMA - 5;
  ------------------
  |  |  274|   102k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|   102k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  156|  3.36M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   55|  3.36M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (156:16): [True: 3.26M, False: 102k]
  ------------------
  157|  3.26M|    {
  158|  3.26M|        band_table_u[i] = 0;
  159|  3.26M|        band_table_v[i] = 0;
  160|  3.26M|    }
  161|   509k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (161:16): [True: 407k, False: 102k]
  ------------------
  162|   407k|    {
  163|   407k|        band_table_u[(i + sao_band_pos_u) & 31] = i + 1;
  164|   407k|        band_table_v[(i + sao_band_pos_v) & 31] = i + 1;
  165|   407k|    }
  166|       |
  167|  1.59M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (167:18): [True: 1.49M, False: 102k]
  ------------------
  168|  1.49M|    {
  169|  48.4M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (169:22): [True: 46.9M, False: 1.49M]
  ------------------
  170|  46.9M|        {
  171|  46.9M|            WORD32 band_idx;
  172|  46.9M|            WORD8 *pi1_sao_offset;
  173|       |
  174|  46.9M|            pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (174:30): [True: 23.4M, False: 23.4M]
  ------------------
  175|  46.9M|            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: 23.4M, False: 23.4M]
  ------------------
  176|  46.9M|            pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|  46.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 32.5k, False: 46.8M]
  |  |  |  Branch (40:53): [True: 244k, False: 46.6M]
  |  |  ------------------
  ------------------
  177|  46.9M|        }
  178|  1.49M|        pu1_src += src_strd;
  179|  1.49M|    }
  180|   102k|}
ihevc_sao_edge_offset_class0:
  196|  33.8k|{
  197|  33.8k|    WORD32 row, col;
  198|  33.8k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  199|  33.8k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE];
  200|  33.8k|    WORD8 u1_sign_left, u1_sign_right;
  201|  33.8k|    WORD32 bit_depth;
  202|  33.8k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  33.8k|#define UNUSED(x) ((void)(x))
  ------------------
  203|  33.8k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  33.8k|#define UNUSED(x) ((void)(x))
  ------------------
  204|  33.8k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  33.8k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  33.8k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  205|       |
  206|       |    /* Initialize the mask values */
  207|  33.8k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  33.8k|#define MAX_CTB_SIZE        64
  ------------------
  208|       |
  209|       |    /* Update top and top-left arrays */
  210|  33.8k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  211|   898k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (211:18): [True: 865k, False: 33.8k]
  ------------------
  212|   865k|    {
  213|   865k|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
  214|   865k|    }
  215|   907k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (215:18): [True: 873k, False: 33.8k]
  ------------------
  216|   873k|    {
  217|   873k|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  218|   873k|    }
  219|       |
  220|       |    /* Update masks based on the availability flags */
  221|  33.8k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (221:8): [True: 3.11k, False: 30.6k]
  ------------------
  222|  3.11k|    {
  223|  3.11k|        au1_mask[0] = 0;
  224|  3.11k|    }
  225|  33.8k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (225:8): [True: 2.78k, False: 31.0k]
  ------------------
  226|  2.78k|    {
  227|  2.78k|        au1_mask[wd - 1] = 0;
  228|  2.78k|    }
  229|       |
  230|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  231|  33.8k|    {
  232|   887k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (232:22): [True: 853k, False: 33.8k]
  ------------------
  233|   853k|        {
  234|   853k|            u1_sign_left = SIGN(pu1_src[0] - pu1_src_left[row]);
  ------------------
  |  |   44|   853k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 675k, False: 178k]
  |  |  |  Branch (44:34): [True: 209k, False: 466k]
  |  |  ------------------
  ------------------
  235|  25.0M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (235:26): [True: 24.2M, False: 853k]
  ------------------
  236|  24.2M|            {
  237|  24.2M|                WORD32 edge_idx;
  238|       |
  239|  24.2M|                u1_sign_right = SIGN(pu1_src[col] - pu1_src[col + 1]);
  ------------------
  |  |   44|  24.2M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 19.6M, False: 4.58M]
  |  |  |  Branch (44:34): [True: 4.59M, False: 15.0M]
  |  |  ------------------
  ------------------
  240|  24.2M|                edge_idx = 2 + u1_sign_left + u1_sign_right;
  241|  24.2M|                u1_sign_left = -u1_sign_right;
  242|       |
  243|  24.2M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  244|       |
  245|  24.2M|                if(0 != edge_idx)
  ------------------
  |  Branch (245:20): [True: 5.04M, False: 19.2M]
  ------------------
  246|  5.04M|                {
  247|  5.04M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  5.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.01k, False: 5.03M]
  |  |  |  Branch (40:53): [True: 6.72k, False: 5.03M]
  |  |  ------------------
  ------------------
  248|  5.04M|                }
  249|  24.2M|            }
  250|       |
  251|   853k|            pu1_src += src_strd;
  252|   853k|        }
  253|  33.8k|    }
  254|       |
  255|       |    /* Update left array */
  256|   898k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (256:18): [True: 864k, False: 33.8k]
  ------------------
  257|   864k|    {
  258|   864k|        pu1_src_left[row] = au1_src_left_tmp[row];
  259|   864k|    }
  260|       |
  261|  33.8k|}
ihevc_sao_edge_offset_class0_chroma:
  279|  23.7k|{
  280|  23.7k|    WORD32 row, col;
  281|  23.7k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  282|  23.7k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE];
  283|  23.7k|    WORD8 u1_sign_left_u, u1_sign_right_u;
  284|  23.7k|    WORD8 u1_sign_left_v, u1_sign_right_v;
  285|  23.7k|    WORD32 bit_depth;
  286|  23.7k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  23.7k|#define UNUSED(x) ((void)(x))
  ------------------
  287|  23.7k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  23.7k|#define UNUSED(x) ((void)(x))
  ------------------
  288|  23.7k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  23.7k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  23.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  289|       |
  290|       |    /* Initialize the mask values */
  291|  23.7k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  23.7k|#define MAX_CTB_SIZE        64
  ------------------
  292|       |
  293|       |    /* Update left, top and top-left arrays */
  294|  23.7k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  295|  23.7k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  296|   361k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (296:18): [True: 337k, False: 23.7k]
  ------------------
  297|   337k|    {
  298|   337k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
  299|   337k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  300|   337k|    }
  301|   721k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (301:18): [True: 697k, False: 23.7k]
  ------------------
  302|   697k|    {
  303|   697k|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  304|   697k|    }
  305|       |
  306|       |    /* Update masks based on the availability flags */
  307|  23.7k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (307:8): [True: 2.34k, False: 21.4k]
  ------------------
  308|  2.34k|    {
  309|  2.34k|        au1_mask[0] = 0;
  310|  2.34k|    }
  311|  23.7k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (311:8): [True: 1.83k, False: 21.9k]
  ------------------
  312|  1.83k|    {
  313|  1.83k|        au1_mask[(wd - 1) >> 1] = 0;
  314|  1.83k|    }
  315|       |
  316|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  317|  23.7k|    {
  318|   360k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (318:22): [True: 337k, False: 23.7k]
  ------------------
  319|   337k|        {
  320|   337k|            u1_sign_left_u = SIGN(pu1_src[0] - pu1_src_left[2 * row]);
  ------------------
  |  |   44|   337k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 272k, False: 64.3k]
  |  |  |  Branch (44:34): [True: 67.4k, False: 205k]
  |  |  ------------------
  ------------------
  321|   337k|            u1_sign_left_v = SIGN(pu1_src[1] - pu1_src_left[2 * row + 1]);
  ------------------
  |  |   44|   337k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 289k, False: 48.0k]
  |  |  |  Branch (44:34): [True: 65.7k, False: 223k]
  |  |  ------------------
  ------------------
  322|  10.7M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (322:26): [True: 10.4M, False: 337k]
  ------------------
  323|  10.4M|            {
  324|  10.4M|                WORD32 edge_idx;
  325|  10.4M|                WORD8 *pi1_sao_offset;
  326|       |
  327|  10.4M|                if(0 == col % 2)
  ------------------
  |  Branch (327:20): [True: 5.21M, False: 5.21M]
  ------------------
  328|  5.21M|                {
  329|  5.21M|                    pi1_sao_offset = pi1_sao_offset_u;
  330|  5.21M|                    u1_sign_right_u = SIGN(pu1_src[col] - pu1_src[col + 2]);
  ------------------
  |  |   44|  5.21M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 4.58M, False: 633k]
  |  |  |  Branch (44:34): [True: 680k, False: 3.89M]
  |  |  ------------------
  ------------------
  331|  5.21M|                    edge_idx = 2 + u1_sign_left_u + u1_sign_right_u;
  332|  5.21M|                    u1_sign_left_u = -u1_sign_right_u;
  333|  5.21M|                }
  334|  5.21M|                else
  335|  5.21M|                {
  336|  5.21M|                    pi1_sao_offset = pi1_sao_offset_v;
  337|  5.21M|                    u1_sign_right_v = SIGN(pu1_src[col] - pu1_src[col + 2]);
  ------------------
  |  |   44|  5.21M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 4.68M, False: 529k]
  |  |  |  Branch (44:34): [True: 568k, False: 4.11M]
  |  |  ------------------
  ------------------
  338|  5.21M|                    edge_idx = 2 + u1_sign_left_v + u1_sign_right_v;
  339|  5.21M|                    u1_sign_left_v = -u1_sign_right_v;
  340|  5.21M|                }
  341|       |
  342|  10.4M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  343|       |
  344|  10.4M|                if(0 != edge_idx)
  ------------------
  |  Branch (344:20): [True: 1.24M, False: 9.18M]
  ------------------
  345|  1.24M|                {
  346|  1.24M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  1.24M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 851, False: 1.24M]
  |  |  |  Branch (40:53): [True: 2.52k, False: 1.24M]
  |  |  ------------------
  ------------------
  347|  1.24M|                }
  348|  10.4M|            }
  349|       |
  350|   337k|            pu1_src += src_strd;
  351|   337k|        }
  352|  23.7k|    }
  353|       |
  354|   699k|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (354:18): [True: 675k, False: 23.7k]
  ------------------
  355|   675k|    {
  356|   675k|        pu1_src_left[row] = au1_src_left_tmp[row];
  357|   675k|    }
  358|       |
  359|  23.7k|}
ihevc_sao_edge_offset_class1:
  375|  24.0k|{
  376|  24.0k|    WORD32 row, col;
  377|  24.0k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  378|  24.0k|    UWORD8 au1_src_top_tmp[MAX_CTB_SIZE];
  379|  24.0k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  380|  24.0k|    WORD8 u1_sign_down;
  381|  24.0k|    WORD32 bit_depth;
  382|  24.0k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  24.0k|#define UNUSED(x) ((void)(x))
  ------------------
  383|  24.0k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  24.0k|#define UNUSED(x) ((void)(x))
  ------------------
  384|       |
  385|  24.0k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  24.0k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  24.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  386|       |
  387|       |    /* Initialize the mask values */
  388|  24.0k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  24.0k|#define MAX_CTB_SIZE        64
  ------------------
  389|       |
  390|       |    /* Update left, top and top-left arrays */
  391|  24.0k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  392|   614k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (392:18): [True: 590k, False: 24.0k]
  ------------------
  393|   590k|    {
  394|   590k|        pu1_src_left[row] = pu1_src[row * src_strd + wd - 1];
  395|   590k|    }
  396|   631k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (396:18): [True: 607k, False: 24.0k]
  ------------------
  397|   607k|    {
  398|   607k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  399|   607k|    }
  400|       |
  401|       |    /* Update height and source pointers based on the availability flags */
  402|  24.0k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (402:8): [True: 5.04k, False: 18.9k]
  ------------------
  403|  5.04k|    {
  404|  5.04k|        pu1_src += src_strd;
  405|  5.04k|        ht--;
  406|  97.2k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (406:22): [True: 92.1k, False: 5.04k]
  ------------------
  407|  92.1k|        {
  408|  92.1k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - src_strd]);
  ------------------
  |  |   44|  92.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 67.0k, False: 25.0k]
  |  |  |  Branch (44:34): [True: 10.8k, False: 56.1k]
  |  |  ------------------
  ------------------
  409|  92.1k|        }
  410|  5.04k|    }
  411|  18.9k|    else
  412|  18.9k|    {
  413|   534k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (413:22): [True: 515k, False: 18.9k]
  ------------------
  414|   515k|        {
  415|   515k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col]);
  ------------------
  |  |   44|   515k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 407k, False: 107k]
  |  |  |  Branch (44:34): [True: 110k, False: 297k]
  |  |  ------------------
  ------------------
  416|   515k|        }
  417|  18.9k|    }
  418|  24.0k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (418:8): [True: 4.15k, False: 19.8k]
  ------------------
  419|  4.15k|    {
  420|  4.15k|        ht--;
  421|  4.15k|    }
  422|       |
  423|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  424|  24.0k|    {
  425|   604k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (425:22): [True: 580k, False: 24.0k]
  ------------------
  426|   580k|        {
  427|  18.0M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (427:26): [True: 17.5M, False: 580k]
  ------------------
  428|  17.5M|            {
  429|  17.5M|                WORD32 edge_idx;
  430|       |
  431|  17.5M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + src_strd]);
  ------------------
  |  |   44|  17.5M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 14.5M, False: 3.00M]
  |  |  |  Branch (44:34): [True: 2.96M, False: 11.5M]
  |  |  ------------------
  ------------------
  432|  17.5M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  433|  17.5M|                au1_sign_up[col] = -u1_sign_down;
  434|       |
  435|  17.5M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  436|       |
  437|  17.5M|                if(0 != edge_idx)
  ------------------
  |  Branch (437:20): [True: 3.90M, False: 13.6M]
  ------------------
  438|  3.90M|                {
  439|  3.90M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  3.90M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.28k, False: 3.90M]
  |  |  |  Branch (40:53): [True: 14.0k, False: 3.88M]
  |  |  ------------------
  ------------------
  440|  3.90M|                }
  441|  17.5M|            }
  442|       |
  443|   580k|            pu1_src += src_strd;
  444|   580k|        }
  445|  24.0k|    }
  446|       |
  447|   631k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (447:18): [True: 607k, False: 24.0k]
  ------------------
  448|   607k|    {
  449|   607k|        pu1_src_top[col] = au1_src_top_tmp[col];
  450|   607k|    }
  451|       |
  452|  24.0k|}
ihevc_sao_edge_offset_class1_chroma:
  469|  26.5k|{
  470|  26.5k|    WORD32 row, col;
  471|  26.5k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  472|  26.5k|    UWORD8 au1_src_top_tmp[2 * MAX_CTB_SIZE];
  473|  26.5k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
  474|  26.5k|    WORD8 u1_sign_down;
  475|  26.5k|    WORD32 bit_depth;
  476|  26.5k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  26.5k|#define UNUSED(x) ((void)(x))
  ------------------
  477|  26.5k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  26.5k|#define UNUSED(x) ((void)(x))
  ------------------
  478|       |
  479|  26.5k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  26.5k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  26.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  480|       |
  481|       |    /* Initialize the mask values */
  482|  26.5k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  26.5k|#define MAX_CTB_SIZE        64
  ------------------
  483|       |
  484|       |    /* Update left, top and top-left arrays */
  485|  26.5k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  486|  26.5k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  487|   397k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (487:18): [True: 371k, False: 26.5k]
  ------------------
  488|   371k|    {
  489|   371k|        pu1_src_left[2 * row] = pu1_src[row * src_strd + wd - 2];
  490|   371k|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  491|   371k|    }
  492|   783k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (492:18): [True: 756k, False: 26.5k]
  ------------------
  493|   756k|    {
  494|   756k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  495|   756k|    }
  496|       |
  497|       |    /* Update height and source pointers based on the availability flags */
  498|  26.5k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (498:8): [True: 5.56k, False: 20.9k]
  ------------------
  499|  5.56k|    {
  500|  5.56k|        pu1_src += src_strd;
  501|  5.56k|        ht--;
  502|   142k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (502:22): [True: 136k, False: 5.56k]
  ------------------
  503|   136k|        {
  504|   136k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - src_strd]);
  ------------------
  |  |   44|   136k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 112k, False: 24.5k]
  |  |  |  Branch (44:34): [True: 8.99k, False: 103k]
  |  |  ------------------
  ------------------
  505|   136k|        }
  506|  5.56k|    }
  507|  20.9k|    else
  508|  20.9k|    {
  509|   638k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (509:22): [True: 617k, False: 20.9k]
  ------------------
  510|   617k|        {
  511|   617k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col]);
  ------------------
  |  |   44|   617k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 524k, False: 93.1k]
  |  |  |  Branch (44:34): [True: 96.3k, False: 427k]
  |  |  ------------------
  ------------------
  512|   617k|        }
  513|  20.9k|    }
  514|  26.5k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (514:8): [True: 3.11k, False: 23.4k]
  ------------------
  515|  3.11k|    {
  516|  3.11k|        ht--;
  517|  3.11k|    }
  518|       |
  519|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  520|  26.5k|    {
  521|   385k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (521:22): [True: 359k, False: 26.5k]
  ------------------
  522|   359k|        {
  523|  11.2M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (523:26): [True: 10.8M, False: 359k]
  ------------------
  524|  10.8M|            {
  525|  10.8M|                WORD32 edge_idx;
  526|  10.8M|                WORD8 *pi1_sao_offset;
  527|       |
  528|  10.8M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (528:34): [True: 5.44M, False: 5.44M]
  ------------------
  529|       |
  530|  10.8M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + src_strd]);
  ------------------
  |  |   44|  10.8M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 9.76M, False: 1.12M]
  |  |  |  Branch (44:34): [True: 1.22M, False: 8.53M]
  |  |  ------------------
  ------------------
  531|  10.8M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  532|  10.8M|                au1_sign_up[col] = -u1_sign_down;
  533|       |
  534|  10.8M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  535|       |
  536|  10.8M|                if(0 != edge_idx)
  ------------------
  |  Branch (536:20): [True: 1.52M, False: 9.36M]
  ------------------
  537|  1.52M|                {
  538|  1.52M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  1.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.18k, False: 1.52M]
  |  |  |  Branch (40:53): [True: 1.38k, False: 1.51M]
  |  |  ------------------
  ------------------
  539|  1.52M|                }
  540|  10.8M|            }
  541|       |
  542|   359k|            pu1_src += src_strd;
  543|   359k|        }
  544|  26.5k|    }
  545|       |
  546|   783k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (546:18): [True: 757k, False: 26.5k]
  ------------------
  547|   757k|    {
  548|   757k|        pu1_src_top[col] = au1_src_top_tmp[col];
  549|   757k|    }
  550|       |
  551|  26.5k|}
ihevc_sao_edge_offset_class2:
  567|  39.3k|{
  568|  39.3k|    WORD32 row, col;
  569|  39.3k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  570|  39.3k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE], au1_src_top_tmp[MAX_CTB_SIZE];
  571|  39.3k|    UWORD8 u1_src_top_left_tmp;
  572|  39.3k|    WORD8 au1_sign_up[MAX_CTB_SIZE + 1], au1_sign_up_tmp[MAX_CTB_SIZE + 1];
  573|  39.3k|    WORD8 u1_sign_down;
  574|  39.3k|    WORD8 *pu1_sign_up;
  575|  39.3k|    WORD8 *pu1_sign_up_tmp;
  576|  39.3k|    UWORD8 *pu1_src_left_cpy;
  577|       |
  578|  39.3k|    WORD32 bit_depth;
  579|  39.3k|    UWORD8 u1_pos_0_0_tmp;
  580|  39.3k|    UWORD8 u1_pos_wd_ht_tmp;
  581|  39.3k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  39.3k|#define UNUSED(x) ((void)(x))
  ------------------
  582|  39.3k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  39.3k|#define UNUSED(x) ((void)(x))
  ------------------
  583|       |
  584|  39.3k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  39.3k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  39.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  585|  39.3k|    pu1_sign_up = au1_sign_up;
  586|  39.3k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  587|  39.3k|    pu1_src_left_cpy = pu1_src_left;
  588|       |
  589|       |    /* Initialize the mask values */
  590|  39.3k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  39.3k|#define MAX_CTB_SIZE        64
  ------------------
  591|       |
  592|       |    /* Update left, top and top-left arrays */
  593|  39.3k|    u1_src_top_left_tmp = pu1_src_top[wd - 1];
  594|  1.00M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (594:18): [True: 965k, False: 39.3k]
  ------------------
  595|   965k|    {
  596|   965k|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
  597|   965k|    }
  598|  1.01M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (598:18): [True: 972k, False: 39.3k]
  ------------------
  599|   972k|    {
  600|   972k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  601|   972k|    }
  602|       |
  603|       |
  604|       |    /* If top-left is available, process separately */
  605|  39.3k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (605:8): [True: 30.1k, False: 9.18k]
  ------------------
  606|  30.1k|    {
  607|  30.1k|        WORD32 edge_idx;
  608|       |
  609|  30.1k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  30.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 23.7k, False: 6.40k]
  |  |  |  Branch (44:34): [True: 7.59k, False: 16.1k]
  |  |  ------------------
  ------------------
  610|  30.1k|                        SIGN(pu1_src[0] - pu1_src[1 + src_strd]);
  ------------------
  |  |   44|  30.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 23.8k, False: 6.32k]
  |  |  |  Branch (44:34): [True: 6.21k, False: 17.6k]
  |  |  ------------------
  ------------------
  611|       |
  612|  30.1k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  613|       |
  614|  30.1k|        if(0 != edge_idx)
  ------------------
  |  Branch (614:12): [True: 9.12k, False: 21.0k]
  ------------------
  615|  9.12k|        {
  616|  9.12k|            u1_pos_0_0_tmp = CLIP3(pu1_src[0] + pi1_sao_offset[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: 342, False: 8.78k]
  |  |  |  Branch (40:53): [True: 331, False: 8.45k]
  |  |  ------------------
  ------------------
  617|  9.12k|        }
  618|  21.0k|        else
  619|  21.0k|        {
  620|  21.0k|            u1_pos_0_0_tmp = pu1_src[0];
  621|  21.0k|        }
  622|  30.1k|    }
  623|  9.18k|    else
  624|  9.18k|    {
  625|  9.18k|        u1_pos_0_0_tmp = pu1_src[0];
  626|  9.18k|    }
  627|       |
  628|       |    /* If bottom-right is available, process separately */
  629|  39.3k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (629:8): [True: 33.9k, False: 5.35k]
  ------------------
  630|  33.9k|    {
  631|  33.9k|        WORD32 edge_idx;
  632|       |
  633|  33.9k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 1 - src_strd]) +
  ------------------
  |  |   44|  33.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.4k, False: 6.52k]
  |  |  |  Branch (44:34): [True: 5.59k, False: 21.8k]
  |  |  ------------------
  ------------------
  634|  33.9k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 1 + src_strd]);
  ------------------
  |  |   44|  33.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 25.6k, False: 8.32k]
  |  |  |  Branch (44:34): [True: 7.59k, False: 18.0k]
  |  |  ------------------
  ------------------
  635|       |
  636|  33.9k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  637|       |
  638|  33.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (638:12): [True: 12.0k, False: 21.9k]
  ------------------
  639|  12.0k|        {
  640|  12.0k|            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|  12.0k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 399, False: 11.6k]
  |  |  |  Branch (40:53): [True: 179, False: 11.4k]
  |  |  ------------------
  ------------------
  641|  12.0k|        }
  642|  21.9k|        else
  643|  21.9k|        {
  644|  21.9k|            u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
  645|  21.9k|        }
  646|  33.9k|    }
  647|  5.35k|    else
  648|  5.35k|    {
  649|  5.35k|        u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
  650|  5.35k|    }
  651|       |
  652|       |    /* If Left is not available */
  653|  39.3k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (653:8): [True: 3.53k, False: 35.8k]
  ------------------
  654|  3.53k|    {
  655|  3.53k|        au1_mask[0] = 0;
  656|  3.53k|    }
  657|       |
  658|       |    /* If Top is not available */
  659|  39.3k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (659:8): [True: 6.36k, False: 32.9k]
  ------------------
  660|  6.36k|    {
  661|  6.36k|        pu1_src += src_strd;
  662|  6.36k|        ht--;
  663|  6.36k|        pu1_src_left_cpy += 1;
  664|   150k|        for(col = 1; col < wd; col++)
  ------------------
  |  Branch (664:22): [True: 143k, False: 6.36k]
  ------------------
  665|   143k|        {
  666|   143k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - 1 - src_strd]);
  ------------------
  |  |   44|   143k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 120k, False: 23.5k]
  |  |  |  Branch (44:34): [True: 32.7k, False: 87.6k]
  |  |  ------------------
  ------------------
  667|   143k|        }
  668|  6.36k|    }
  669|  32.9k|    else
  670|  32.9k|    {
  671|   822k|        for(col = 1; col < wd; col++)
  ------------------
  |  Branch (671:22): [True: 789k, False: 32.9k]
  ------------------
  672|   789k|        {
  673|   789k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col - 1]);
  ------------------
  |  |   44|   789k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 608k, False: 180k]
  |  |  |  Branch (44:34): [True: 172k, False: 435k]
  |  |  ------------------
  ------------------
  674|   789k|        }
  675|  32.9k|    }
  676|       |
  677|       |    /* If Right is not available */
  678|  39.3k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (678:8): [True: 2.66k, False: 36.6k]
  ------------------
  679|  2.66k|    {
  680|  2.66k|        au1_mask[wd - 1] = 0;
  681|  2.66k|    }
  682|       |
  683|       |    /* If Bottom is not available */
  684|  39.3k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (684:8): [True: 3.12k, False: 36.2k]
  ------------------
  685|  3.12k|    {
  686|  3.12k|        ht--;
  687|  3.12k|    }
  688|       |
  689|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  690|  39.3k|    {
  691|   982k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (691:22): [True: 943k, False: 39.3k]
  ------------------
  692|   943k|        {
  693|   943k|            pu1_sign_up[0] = SIGN(pu1_src[0] - pu1_src_left_cpy[row - 1]);
  ------------------
  |  |   44|   943k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 727k, False: 215k]
  |  |  |  Branch (44:34): [True: 248k, False: 479k]
  |  |  ------------------
  ------------------
  694|  27.3M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (694:26): [True: 26.3M, False: 943k]
  ------------------
  695|  26.3M|            {
  696|  26.3M|                WORD32 edge_idx;
  697|       |
  698|  26.3M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + 1 + src_strd]);
  ------------------
  |  |   44|  26.3M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 20.7M, False: 5.67M]
  |  |  |  Branch (44:34): [True: 5.56M, False: 15.1M]
  |  |  ------------------
  ------------------
  699|  26.3M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  700|  26.3M|                pu1_sign_up_tmp[col + 1] = -u1_sign_down;
  701|       |
  702|  26.3M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  703|       |
  704|  26.3M|                if(0 != edge_idx)
  ------------------
  |  Branch (704:20): [True: 7.64M, False: 18.7M]
  ------------------
  705|  7.64M|                {
  706|  7.64M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.64M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.9k, False: 7.63M]
  |  |  |  Branch (40:53): [True: 31.6k, False: 7.60M]
  |  |  ------------------
  ------------------
  707|  7.64M|                }
  708|  26.3M|            }
  709|       |
  710|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  711|   943k|            {
  712|   943k|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  713|   943k|                pu1_sign_up = pu1_sign_up_tmp;
  714|   943k|                pu1_sign_up_tmp = pu1_swap_tmp;
  715|   943k|            }
  716|       |
  717|   943k|            pu1_src += src_strd;
  718|   943k|        }
  719|       |
  720|  39.3k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd] = u1_pos_0_0_tmp;
  ------------------
  |  Branch (720:19): [True: 33.0k, False: 6.31k]
  ------------------
  721|  39.3k|        pu1_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u1_pos_wd_ht_tmp;
  ------------------
  |  Branch (721:18): [True: 36.2k, False: 3.08k]
  ------------------
  722|  39.3k|    }
  723|       |
  724|  39.3k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (724:8): [True: 6.36k, False: 32.9k]
  ------------------
  725|  6.36k|        ht++;
  726|  39.3k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (726:8): [True: 3.12k, False: 36.2k]
  ------------------
  727|  3.12k|        ht++;
  728|  39.3k|    *pu1_src_top_left = u1_src_top_left_tmp;
  729|  1.00M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (729:18): [True: 964k, False: 39.3k]
  ------------------
  730|   964k|    {
  731|   964k|        pu1_src_left[row] = au1_src_left_tmp[row];
  732|   964k|    }
  733|  1.01M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (733:18): [True: 971k, False: 39.3k]
  ------------------
  734|   971k|    {
  735|   971k|        pu1_src_top[col] = au1_src_top_tmp[col];
  736|   971k|    }
  737|       |
  738|  39.3k|}
ihevc_sao_edge_offset_class2_chroma:
  756|  38.7k|{
  757|  38.7k|    WORD32 row, col;
  758|  38.7k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  759|  38.7k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE], au1_src_top_tmp[2 * MAX_CTB_SIZE];
  760|  38.7k|    UWORD8 au1_src_top_left_tmp[2];
  761|  38.7k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE + 2], au1_sign_up_tmp[2 * MAX_CTB_SIZE + 2];
  762|  38.7k|    WORD8 u1_sign_down;
  763|  38.7k|    WORD8 *pu1_sign_up;
  764|  38.7k|    WORD8 *pu1_sign_up_tmp;
  765|  38.7k|    UWORD8 *pu1_src_left_cpy;
  766|       |
  767|  38.7k|    WORD32 bit_depth;
  768|       |
  769|  38.7k|    UWORD8 u1_pos_0_0_tmp_u;
  770|  38.7k|    UWORD8 u1_pos_0_0_tmp_v;
  771|  38.7k|    UWORD8 u1_pos_wd_ht_tmp_u;
  772|  38.7k|    UWORD8 u1_pos_wd_ht_tmp_v;
  773|  38.7k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  38.7k|#define UNUSED(x) ((void)(x))
  ------------------
  774|  38.7k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  38.7k|#define UNUSED(x) ((void)(x))
  ------------------
  775|       |
  776|       |
  777|  38.7k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  38.7k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  38.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  778|  38.7k|    pu1_sign_up = au1_sign_up;
  779|  38.7k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  780|  38.7k|    pu1_src_left_cpy = pu1_src_left;
  781|       |
  782|       |    /* Initialize the mask values */
  783|  38.7k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  38.7k|#define MAX_CTB_SIZE        64
  ------------------
  784|       |
  785|       |    /* Update left, top and top-left arrays */
  786|  38.7k|    au1_src_top_left_tmp[0] = pu1_src_top[wd - 2];
  787|  38.7k|    au1_src_top_left_tmp[1] = pu1_src_top[wd - 1];
  788|   546k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (788:18): [True: 507k, False: 38.7k]
  ------------------
  789|   507k|    {
  790|   507k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
  791|   507k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  792|   507k|    }
  793|  1.06M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (793:18): [True: 1.02M, False: 38.7k]
  ------------------
  794|  1.02M|    {
  795|  1.02M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  796|  1.02M|    }
  797|       |
  798|       |
  799|       |    /* If top-left is available, process separately */
  800|  38.7k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (800:8): [True: 30.0k, False: 8.64k]
  ------------------
  801|  30.0k|    {
  802|  30.0k|        WORD32 edge_idx;
  803|       |
  804|       |        /* U */
  805|  30.0k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 22.9k, False: 7.12k]
  |  |  |  Branch (44:34): [True: 5.86k, False: 17.0k]
  |  |  ------------------
  ------------------
  806|  30.0k|                        SIGN(pu1_src[0] - pu1_src[2 + src_strd]);
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 24.0k, False: 6.05k]
  |  |  |  Branch (44:34): [True: 5.75k, False: 18.2k]
  |  |  ------------------
  ------------------
  807|       |
  808|  30.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  809|       |
  810|  30.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (810:12): [True: 9.19k, False: 20.8k]
  ------------------
  811|  9.19k|        {
  812|  9.19k|            u1_pos_0_0_tmp_u = CLIP3(pu1_src[0] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.19k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 290, False: 8.90k]
  |  |  |  Branch (40:53): [True: 245, False: 8.65k]
  |  |  ------------------
  ------------------
  813|  9.19k|        }
  814|  20.8k|        else
  815|  20.8k|        {
  816|  20.8k|            u1_pos_0_0_tmp_u = pu1_src[0];
  817|  20.8k|        }
  818|       |
  819|       |        /* V */
  820|  30.0k|        edge_idx = 2 + SIGN(pu1_src[1] - pu1_src_top_left[1]) +
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 24.5k, False: 5.48k]
  |  |  |  Branch (44:34): [True: 7.40k, False: 17.1k]
  |  |  ------------------
  ------------------
  821|  30.0k|                        SIGN(pu1_src[1] - pu1_src[1 + 2 + src_strd]);
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 23.9k, False: 6.07k]
  |  |  |  Branch (44:34): [True: 5.70k, False: 18.2k]
  |  |  ------------------
  ------------------
  822|       |
  823|  30.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  824|       |
  825|  30.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (825:12): [True: 9.34k, False: 20.7k]
  ------------------
  826|  9.34k|        {
  827|  9.34k|            u1_pos_0_0_tmp_v = CLIP3(pu1_src[1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.34k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 491, False: 8.85k]
  |  |  |  Branch (40:53): [True: 600, False: 8.25k]
  |  |  ------------------
  ------------------
  828|  9.34k|        }
  829|  20.7k|        else
  830|  20.7k|        {
  831|  20.7k|            u1_pos_0_0_tmp_v = pu1_src[1];
  832|  20.7k|        }
  833|  30.0k|    }
  834|  8.64k|    else
  835|  8.64k|    {
  836|  8.64k|        u1_pos_0_0_tmp_u = pu1_src[0];
  837|  8.64k|        u1_pos_0_0_tmp_v = pu1_src[1];
  838|  8.64k|    }
  839|       |
  840|       |    /* If bottom-right is available, process separately */
  841|  38.7k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (841:8): [True: 33.7k, False: 4.92k]
  ------------------
  842|  33.7k|    {
  843|  33.7k|        WORD32 edge_idx;
  844|       |
  845|       |        /* U */
  846|  33.7k|        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.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 28.7k, False: 5.02k]
  |  |  |  Branch (44:34): [True: 5.36k, False: 23.3k]
  |  |  ------------------
  ------------------
  847|  33.7k|                        SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  33.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.7k, False: 7.01k]
  |  |  |  Branch (44:34): [True: 8.13k, False: 18.6k]
  |  |  ------------------
  ------------------
  848|       |
  849|  33.7k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  850|       |
  851|  33.7k|        if(0 != edge_idx)
  ------------------
  |  Branch (851:12): [True: 10.0k, False: 23.7k]
  ------------------
  852|  10.0k|        {
  853|  10.0k|            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|  10.0k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 301, False: 9.76k]
  |  |  |  Branch (40:53): [True: 262, False: 9.50k]
  |  |  ------------------
  ------------------
  854|  10.0k|        }
  855|  23.7k|        else
  856|  23.7k|        {
  857|  23.7k|            u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
  858|  23.7k|        }
  859|       |
  860|       |        /* V */
  861|  33.7k|        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.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.0k, False: 4.72k]
  |  |  |  Branch (44:34): [True: 5.55k, False: 23.5k]
  |  |  ------------------
  ------------------
  862|  33.7k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  33.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.0k, False: 7.69k]
  |  |  |  Branch (44:34): [True: 7.05k, False: 19.0k]
  |  |  ------------------
  ------------------
  863|       |
  864|  33.7k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  865|       |
  866|  33.7k|        if(0 != edge_idx)
  ------------------
  |  Branch (866:12): [True: 9.51k, False: 24.2k]
  ------------------
  867|  9.51k|        {
  868|  9.51k|            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|  9.51k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 321, False: 9.19k]
  |  |  |  Branch (40:53): [True: 227, False: 8.96k]
  |  |  ------------------
  ------------------
  869|  9.51k|        }
  870|  24.2k|        else
  871|  24.2k|        {
  872|  24.2k|            u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
  873|  24.2k|        }
  874|  33.7k|    }
  875|  4.92k|    else
  876|  4.92k|    {
  877|  4.92k|        u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
  878|  4.92k|        u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
  879|  4.92k|    }
  880|       |
  881|       |    /* If Left is not available */
  882|  38.7k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (882:8): [True: 3.19k, False: 35.5k]
  ------------------
  883|  3.19k|    {
  884|  3.19k|        au1_mask[0] = 0;
  885|  3.19k|    }
  886|       |
  887|       |    /* If Top is not available */
  888|  38.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (888:8): [True: 5.97k, False: 32.7k]
  ------------------
  889|  5.97k|    {
  890|  5.97k|        pu1_src += src_strd;
  891|  5.97k|        pu1_src_left_cpy += 2;
  892|  5.97k|        ht--;
  893|   162k|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (893:22): [True: 156k, False: 5.97k]
  ------------------
  894|   156k|        {
  895|   156k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - 2 - src_strd]);
  ------------------
  |  |   44|   156k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 134k, False: 21.5k]
  |  |  |  Branch (44:34): [True: 15.8k, False: 118k]
  |  |  ------------------
  ------------------
  896|   156k|        }
  897|  5.97k|    }
  898|  32.7k|    else
  899|  32.7k|    {
  900|   825k|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (900:22): [True: 792k, False: 32.7k]
  ------------------
  901|   792k|        {
  902|   792k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col - 2]);
  ------------------
  |  |   44|   792k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 645k, False: 147k]
  |  |  |  Branch (44:34): [True: 138k, False: 507k]
  |  |  ------------------
  ------------------
  903|   792k|        }
  904|  32.7k|    }
  905|       |
  906|       |    /* If Right is not available */
  907|  38.7k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (907:8): [True: 2.67k, False: 36.0k]
  ------------------
  908|  2.67k|    {
  909|  2.67k|        au1_mask[(wd - 1) >> 1] = 0;
  910|  2.67k|    }
  911|       |
  912|       |    /* If Bottom is not available */
  913|  38.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (913:8): [True: 2.41k, False: 36.2k]
  ------------------
  914|  2.41k|    {
  915|  2.41k|        ht--;
  916|  2.41k|    }
  917|       |
  918|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  919|  38.7k|    {
  920|   534k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (920:22): [True: 495k, False: 38.7k]
  ------------------
  921|   495k|        {
  922|   495k|            pu1_sign_up[0] = SIGN(pu1_src[0] - pu1_src_left_cpy[2 * (row - 1)]);
  ------------------
  |  |   44|   495k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 403k, False: 92.7k]
  |  |  |  Branch (44:34): [True: 105k, False: 297k]
  |  |  ------------------
  ------------------
  923|   495k|            pu1_sign_up[1] = SIGN(pu1_src[1] - pu1_src_left_cpy[2 * (row - 1) + 1]);
  ------------------
  |  |   44|   495k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 408k, False: 87.5k]
  |  |  |  Branch (44:34): [True: 123k, False: 285k]
  |  |  ------------------
  ------------------
  924|  14.7M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (924:26): [True: 14.2M, False: 495k]
  ------------------
  925|  14.2M|            {
  926|  14.2M|                WORD32 edge_idx;
  927|  14.2M|                WORD8 *pi1_sao_offset;
  928|       |
  929|  14.2M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (929:34): [True: 7.12M, False: 7.11M]
  ------------------
  930|       |
  931|  14.2M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + 2 + src_strd]);
  ------------------
  |  |   44|  14.2M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 12.2M, False: 1.98M]
  |  |  |  Branch (44:34): [True: 2.14M, False: 10.1M]
  |  |  ------------------
  ------------------
  932|  14.2M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  933|  14.2M|                pu1_sign_up_tmp[col + 2] = -u1_sign_down;
  934|       |
  935|  14.2M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  936|       |
  937|  14.2M|                if(0 != edge_idx)
  ------------------
  |  Branch (937:20): [True: 2.83M, False: 11.4M]
  ------------------
  938|  2.83M|                {
  939|  2.83M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  2.83M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 14.1k, False: 2.81M]
  |  |  |  Branch (40:53): [True: 21.9k, False: 2.79M]
  |  |  ------------------
  ------------------
  940|  2.83M|                }
  941|  14.2M|            }
  942|       |
  943|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  944|   495k|            {
  945|   495k|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  946|   495k|                pu1_sign_up = pu1_sign_up_tmp;
  947|   495k|                pu1_sign_up_tmp = pu1_swap_tmp;
  948|   495k|            }
  949|       |
  950|   495k|            pu1_src += src_strd;
  951|   495k|        }
  952|       |
  953|  38.7k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd] = u1_pos_0_0_tmp_u;
  ------------------
  |  Branch (953:19): [True: 32.7k, False: 5.93k]
  ------------------
  954|  38.7k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + 1] = u1_pos_0_0_tmp_v;
  ------------------
  |  Branch (954:19): [True: 32.7k, False: 5.94k]
  ------------------
  955|  38.7k|        pu1_src[(pu1_avail[3] ? wd - 2 - src_strd : wd - 2)] = u1_pos_wd_ht_tmp_u;
  ------------------
  |  Branch (955:18): [True: 36.3k, False: 2.38k]
  ------------------
  956|  38.7k|        pu1_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u1_pos_wd_ht_tmp_v;
  ------------------
  |  Branch (956:18): [True: 36.3k, False: 2.38k]
  ------------------
  957|  38.7k|    }
  958|       |
  959|  38.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (959:8): [True: 5.97k, False: 32.7k]
  ------------------
  960|  5.97k|        ht++;
  961|  38.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (961:8): [True: 2.41k, False: 36.2k]
  ------------------
  962|  2.41k|        ht++;
  963|  38.7k|    pu1_src_top_left[0] = au1_src_top_left_tmp[0];
  964|  38.7k|    pu1_src_top_left[1] = au1_src_top_left_tmp[1];
  965|  1.05M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (965:18): [True: 1.01M, False: 38.7k]
  ------------------
  966|  1.01M|    {
  967|  1.01M|        pu1_src_left[row] = au1_src_left_tmp[row];
  968|  1.01M|    }
  969|  1.06M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (969:18): [True: 1.02M, False: 38.7k]
  ------------------
  970|  1.02M|    {
  971|  1.02M|        pu1_src_top[col] = au1_src_top_tmp[col];
  972|  1.02M|    }
  973|       |
  974|  38.7k|}
ihevc_sao_edge_offset_class3:
  991|  53.5k|{
  992|  53.5k|    WORD32 row, col;
  993|  53.5k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  994|  53.5k|    UWORD8 au1_src_top_tmp[MAX_CTB_SIZE];
  995|  53.5k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE];
  996|  53.5k|    UWORD8 u1_src_top_left_tmp;
  997|  53.5k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  998|  53.5k|    UWORD8 *pu1_src_left_cpy;
  999|  53.5k|    WORD8 u1_sign_down;
 1000|  53.5k|    WORD32 bit_depth;
 1001|       |
 1002|  53.5k|    UWORD8 u1_pos_0_ht_tmp;
 1003|  53.5k|    UWORD8 u1_pos_wd_0_tmp;
 1004|       |
 1005|  53.5k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  53.5k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  53.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1006|  53.5k|    pu1_src_left_cpy = pu1_src_left;
 1007|       |
 1008|       |    /* Initialize the mask values */
 1009|  53.5k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  53.5k|#define MAX_CTB_SIZE        64
  ------------------
 1010|       |
 1011|       |    /* Update left, top and top-left arrays */
 1012|  53.5k|    u1_src_top_left_tmp = pu1_src_top[wd - 1];
 1013|  1.09M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1013:18): [True: 1.03M, False: 53.5k]
  ------------------
 1014|  1.03M|    {
 1015|  1.03M|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
 1016|  1.03M|    }
 1017|  1.11M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1017:18): [True: 1.05M, False: 53.5k]
  ------------------
 1018|  1.05M|    {
 1019|  1.05M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
 1020|  1.05M|    }
 1021|       |
 1022|       |    /* If top-right is available, process separately */
 1023|  53.5k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1023:8): [True: 41.3k, False: 12.2k]
  ------------------
 1024|  41.3k|    {
 1025|  41.3k|        WORD32 edge_idx;
 1026|       |
 1027|  41.3k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  41.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 31.2k, False: 10.0k]
  |  |  |  Branch (44:34): [True: 6.01k, False: 25.2k]
  |  |  ------------------
  ------------------
 1028|  41.3k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 1 + src_strd]);
  ------------------
  |  |   44|  41.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.2k, False: 7.08k]
  |  |  |  Branch (44:34): [True: 7.00k, False: 27.2k]
  |  |  ------------------
  ------------------
 1029|       |
 1030|  41.3k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1031|       |
 1032|  41.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (1032:12): [True: 11.5k, False: 29.7k]
  ------------------
 1033|  11.5k|        {
 1034|  11.5k|            u1_pos_wd_0_tmp = CLIP3(pu1_src[wd - 1] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  11.5k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 372, False: 11.1k]
  |  |  |  Branch (40:53): [True: 345, False: 10.7k]
  |  |  ------------------
  ------------------
 1035|  11.5k|        }
 1036|  29.7k|        else
 1037|  29.7k|        {
 1038|  29.7k|            u1_pos_wd_0_tmp = pu1_src[wd - 1];
 1039|  29.7k|        }
 1040|  41.3k|    }
 1041|  12.2k|    else
 1042|  12.2k|    {
 1043|  12.2k|        u1_pos_wd_0_tmp = pu1_src[wd - 1];
 1044|  12.2k|    }
 1045|       |
 1046|       |    /* If bottom-left is available, process separately */
 1047|  53.5k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1047:8): [True: 46.5k, False: 7.00k]
  ------------------
 1048|  46.5k|    {
 1049|  46.5k|        WORD32 edge_idx;
 1050|       |
 1051|  46.5k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 1 - src_strd]) +
  ------------------
  |  |   44|  46.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 40.1k, False: 6.40k]
  |  |  |  Branch (44:34): [True: 9.38k, False: 30.7k]
  |  |  ------------------
  ------------------
 1052|  46.5k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  46.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 39.9k, False: 6.58k]
  |  |  |  Branch (44:34): [True: 11.9k, False: 28.0k]
  |  |  ------------------
  ------------------
 1053|       |
 1054|  46.5k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1055|       |
 1056|  46.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (1056:12): [True: 13.5k, False: 32.9k]
  ------------------
 1057|  13.5k|        {
 1058|  13.5k|            u1_pos_0_ht_tmp = CLIP3(pu1_src[(ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  13.5k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 349, False: 13.2k]
  |  |  |  Branch (40:53): [True: 104, False: 13.1k]
  |  |  ------------------
  ------------------
 1059|  13.5k|        }
 1060|  32.9k|        else
 1061|  32.9k|        {
 1062|  32.9k|            u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 1063|  32.9k|        }
 1064|  46.5k|    }
 1065|  7.00k|    else
 1066|  7.00k|    {
 1067|  7.00k|        u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 1068|  7.00k|    }
 1069|       |
 1070|       |    /* If Left is not available */
 1071|  53.5k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1071:8): [True: 3.97k, False: 49.5k]
  ------------------
 1072|  3.97k|    {
 1073|  3.97k|        au1_mask[0] = 0;
 1074|  3.97k|    }
 1075|       |
 1076|       |    /* If Top is not available */
 1077|  53.5k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1077:8): [True: 9.21k, False: 44.3k]
  ------------------
 1078|  9.21k|    {
 1079|  9.21k|        pu1_src += src_strd;
 1080|  9.21k|        ht--;
 1081|  9.21k|        pu1_src_left_cpy += 1;
 1082|   178k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1082:22): [True: 168k, False: 9.21k]
  ------------------
 1083|   168k|        {
 1084|   168k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col + 1 - src_strd]);
  ------------------
  |  |   44|   168k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 139k, False: 29.2k]
  |  |  |  Branch (44:34): [True: 30.3k, False: 109k]
  |  |  ------------------
  ------------------
 1085|   168k|        }
 1086|  9.21k|    }
 1087|  44.3k|    else
 1088|  44.3k|    {
 1089|   881k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1089:22): [True: 837k, False: 44.3k]
  ------------------
 1090|   837k|        {
 1091|   837k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col + 1]);
  ------------------
  |  |   44|   837k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 639k, False: 197k]
  |  |  |  Branch (44:34): [True: 140k, False: 499k]
  |  |  ------------------
  ------------------
 1092|   837k|        }
 1093|  44.3k|    }
 1094|       |
 1095|       |    /* If Right is not available */
 1096|  53.5k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1096:8): [True: 3.41k, False: 50.1k]
  ------------------
 1097|  3.41k|    {
 1098|  3.41k|        au1_mask[wd - 1] = 0;
 1099|  3.41k|    }
 1100|       |
 1101|       |    /* If Bottom is not available */
 1102|  53.5k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1102:8): [True: 3.39k, False: 50.1k]
  ------------------
 1103|  3.39k|    {
 1104|  3.39k|        ht--;
 1105|  3.39k|    }
 1106|       |
 1107|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1108|  53.5k|    {
 1109|  1.07M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1109:22): [True: 1.01M, False: 53.5k]
  ------------------
 1110|  1.01M|        {
 1111|  1.01M|            au1_sign_up[wd - 1] = SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 + 1 - src_strd]);
  ------------------
  |  |   44|  1.01M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 790k, False: 227k]
  |  |  |  Branch (44:34): [True: 205k, False: 584k]
  |  |  ------------------
  ------------------
 1112|  26.0M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1112:26): [True: 25.0M, False: 1.01M]
  ------------------
 1113|  25.0M|            {
 1114|  25.0M|                WORD32 edge_idx;
 1115|       |
 1116|  25.0M|                u1_sign_down = SIGN(pu1_src[col] - ((col == 0) ? pu1_src_left_cpy[row + 1] :
  ------------------
  |  |   44|  50.1M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 20.1M, False: 4.92M]
  |  |  |  Branch (44:23): [True: 1.01M, False: 24.0M]
  |  |  |  Branch (44:34): [True: 5.16M, False: 14.9M]
  |  |  |  Branch (44:35): [True: 832k, False: 19.3M]
  |  |  ------------------
  ------------------
 1117|  25.0M|                                                                 pu1_src[col - 1 + src_strd]));
 1118|  25.0M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1119|  25.0M|                if(col > 0)
  ------------------
  |  Branch (1119:20): [True: 24.0M, False: 1.00M]
  ------------------
 1120|  24.0M|                    au1_sign_up[col - 1] = -u1_sign_down;
 1121|       |
 1122|  25.0M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
 1123|       |
 1124|  25.0M|                if(0 != edge_idx)
  ------------------
  |  Branch (1124:20): [True: 7.10M, False: 17.9M]
  ------------------
 1125|  7.10M|                {
 1126|  7.10M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 13.3k, False: 7.09M]
  |  |  |  Branch (40:53): [True: 25.8k, False: 7.06M]
  |  |  ------------------
  ------------------
 1127|  7.10M|                }
 1128|  25.0M|            }
 1129|       |
 1130|  1.01M|            pu1_src += src_strd;
 1131|  1.01M|        }
 1132|       |
 1133|  53.5k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u1_pos_wd_0_tmp;
  ------------------
  |  Branch (1133:19): [True: 44.3k, False: 9.17k]
  ------------------
 1134|  53.5k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u1_pos_0_ht_tmp;
  ------------------
  |  Branch (1134:18): [True: 50.0k, False: 3.42k]
  ------------------
 1135|  53.5k|    }
 1136|       |
 1137|  53.5k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1137:8): [True: 9.21k, False: 44.3k]
  ------------------
 1138|  9.21k|        ht++;
 1139|  53.5k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1139:8): [True: 3.39k, False: 50.1k]
  ------------------
 1140|  3.39k|        ht++;
 1141|  53.5k|    *pu1_src_top_left = u1_src_top_left_tmp;
 1142|  1.09M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1142:18): [True: 1.03M, False: 53.5k]
  ------------------
 1143|  1.03M|    {
 1144|  1.03M|        pu1_src_left[row] = au1_src_left_tmp[row];
 1145|  1.03M|    }
 1146|  1.11M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1146:18): [True: 1.05M, False: 53.5k]
  ------------------
 1147|  1.05M|    {
 1148|  1.05M|        pu1_src_top[col] = au1_src_top_tmp[col];
 1149|  1.05M|    }
 1150|       |
 1151|  53.5k|}
ihevc_sao_edge_offset_class3_chroma:
 1168|  55.0k|{
 1169|  55.0k|    WORD32 row, col;
 1170|  55.0k|    UWORD8 au1_mask[MAX_CTB_SIZE];
 1171|  55.0k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE], au1_src_top_tmp[2 * MAX_CTB_SIZE];
 1172|  55.0k|    UWORD8 au1_src_top_left_tmp[2];
 1173|  55.0k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
 1174|  55.0k|    UWORD8 *pu1_src_left_cpy;
 1175|  55.0k|    WORD8 u1_sign_down;
 1176|  55.0k|    WORD32 bit_depth;
 1177|       |
 1178|  55.0k|    UWORD8 u1_pos_wd_0_tmp_u;
 1179|  55.0k|    UWORD8 u1_pos_wd_0_tmp_v;
 1180|  55.0k|    UWORD8 u1_pos_0_ht_tmp_u;
 1181|  55.0k|    UWORD8 u1_pos_0_ht_tmp_v;
 1182|       |
 1183|  55.0k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  55.0k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  55.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1184|  55.0k|    pu1_src_left_cpy = pu1_src_left;
 1185|       |
 1186|       |    /* Initialize the mask values */
 1187|  55.0k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  55.0k|#define MAX_CTB_SIZE        64
  ------------------
 1188|       |
 1189|       |    /* Update left, top and top-left arrays */
 1190|  55.0k|    au1_src_top_left_tmp[0] = pu1_src_top[wd - 2];
 1191|  55.0k|    au1_src_top_left_tmp[1] = pu1_src_top[wd - 1];
 1192|   623k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1192:18): [True: 568k, False: 55.0k]
  ------------------
 1193|   568k|    {
 1194|   568k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
 1195|   568k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
 1196|   568k|    }
 1197|  1.19M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1197:18): [True: 1.14M, False: 55.0k]
  ------------------
 1198|  1.14M|    {
 1199|  1.14M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
 1200|  1.14M|    }
 1201|       |
 1202|       |
 1203|       |    /* If top-right is available, process separately */
 1204|  55.0k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1204:8): [True: 41.7k, False: 13.2k]
  ------------------
 1205|  41.7k|    {
 1206|  41.7k|        WORD32 edge_idx;
 1207|       |
 1208|       |        /* U */
 1209|  41.7k|        edge_idx = 2 + SIGN(pu1_src[wd - 2] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  41.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.7k, False: 7.02k]
  |  |  |  Branch (44:34): [True: 7.53k, False: 27.2k]
  |  |  ------------------
  ------------------
 1210|  41.7k|                        SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 - 2 + src_strd]);
  ------------------
  |  |   44|  41.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.2k, False: 5.57k]
  |  |  |  Branch (44:34): [True: 6.38k, False: 29.8k]
  |  |  ------------------
  ------------------
 1211|       |
 1212|  41.7k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1213|       |
 1214|  41.7k|        if(0 != edge_idx)
  ------------------
  |  Branch (1214:12): [True: 11.7k, False: 30.0k]
  ------------------
 1215|  11.7k|        {
 1216|  11.7k|            u1_pos_wd_0_tmp_u = CLIP3(pu1_src[wd - 2] + pi1_sao_offset_u[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: 650, False: 11.0k]
  |  |  |  Branch (40:53): [True: 597, False: 10.4k]
  |  |  ------------------
  ------------------
 1217|  11.7k|        }
 1218|  30.0k|        else
 1219|  30.0k|        {
 1220|  30.0k|            u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 1221|  30.0k|        }
 1222|       |
 1223|       |        /* V */
 1224|  41.7k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[1]) +
  ------------------
  |  |   44|  41.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 35.6k, False: 6.09k]
  |  |  |  Branch (44:34): [True: 7.26k, False: 28.4k]
  |  |  ------------------
  ------------------
 1225|  41.7k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 2 + src_strd]);
  ------------------
  |  |   44|  41.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.5k, False: 5.27k]
  |  |  |  Branch (44:34): [True: 6.34k, False: 30.1k]
  |  |  ------------------
  ------------------
 1226|       |
 1227|  41.7k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1228|       |
 1229|  41.7k|        if(0 != edge_idx)
  ------------------
  |  Branch (1229:12): [True: 10.7k, False: 31.0k]
  ------------------
 1230|  10.7k|        {
 1231|  10.7k|            u1_pos_wd_0_tmp_v = CLIP3(pu1_src[wd - 1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  10.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 436, False: 10.3k]
  |  |  |  Branch (40:53): [True: 931, False: 9.41k]
  |  |  ------------------
  ------------------
 1232|  10.7k|        }
 1233|  31.0k|        else
 1234|  31.0k|        {
 1235|  31.0k|            u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 1236|  31.0k|        }
 1237|  41.7k|    }
 1238|  13.2k|    else
 1239|  13.2k|    {
 1240|  13.2k|        u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 1241|  13.2k|        u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 1242|  13.2k|    }
 1243|       |
 1244|       |    /* If bottom-left is available, process separately */
 1245|  55.0k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1245:8): [True: 45.9k, False: 9.15k]
  ------------------
 1246|  45.9k|    {
 1247|  45.9k|        WORD32 edge_idx;
 1248|       |
 1249|       |        /* U */
 1250|  45.9k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 2 - src_strd]) +
  ------------------
  |  |   44|  45.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 39.9k, False: 5.93k]
  |  |  |  Branch (44:34): [True: 5.82k, False: 34.1k]
  |  |  ------------------
  ------------------
 1251|  45.9k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  45.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 37.8k, False: 8.08k]
  |  |  |  Branch (44:34): [True: 7.65k, False: 30.1k]
  |  |  ------------------
  ------------------
 1252|       |
 1253|  45.9k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1254|       |
 1255|  45.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (1255:12): [True: 11.6k, False: 34.2k]
  ------------------
 1256|  11.6k|        {
 1257|  11.6k|            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|  11.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 619, False: 11.0k]
  |  |  |  Branch (40:53): [True: 647, False: 10.3k]
  |  |  ------------------
  ------------------
 1258|  11.6k|        }
 1259|  34.2k|        else
 1260|  34.2k|        {
 1261|  34.2k|            u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 1262|  34.2k|        }
 1263|       |
 1264|       |        /* V */
 1265|  45.9k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src[(ht - 1) * src_strd + 1 + 2 - src_strd]) +
  ------------------
  |  |   44|  45.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 41.2k, False: 4.69k]
  |  |  |  Branch (44:34): [True: 5.86k, False: 35.3k]
  |  |  ------------------
  ------------------
 1266|  45.9k|                        SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src_bot_left[1]);
  ------------------
  |  |   44|  45.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 38.8k, False: 7.03k]
  |  |  |  Branch (44:34): [True: 6.93k, False: 31.9k]
  |  |  ------------------
  ------------------
 1267|       |
 1268|  45.9k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1269|       |
 1270|  45.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (1270:12): [True: 10.6k, False: 35.2k]
  ------------------
 1271|  10.6k|        {
 1272|  10.6k|            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|  10.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 482, False: 10.1k]
  |  |  |  Branch (40:53): [True: 972, False: 9.17k]
  |  |  ------------------
  ------------------
 1273|  10.6k|        }
 1274|  35.2k|        else
 1275|  35.2k|        {
 1276|  35.2k|            u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 1277|  35.2k|        }
 1278|  45.9k|    }
 1279|  9.15k|    else
 1280|  9.15k|    {
 1281|  9.15k|        u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 1282|  9.15k|        u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 1283|  9.15k|    }
 1284|       |
 1285|       |    /* If Left is not available */
 1286|  55.0k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1286:8): [True: 5.10k, False: 49.9k]
  ------------------
 1287|  5.10k|    {
 1288|  5.10k|        au1_mask[0] = 0;
 1289|  5.10k|    }
 1290|       |
 1291|       |    /* If Top is not available */
 1292|  55.0k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1292:8): [True: 9.08k, False: 46.0k]
  ------------------
 1293|  9.08k|    {
 1294|  9.08k|        pu1_src += src_strd;
 1295|  9.08k|        ht--;
 1296|  9.08k|        pu1_src_left_cpy += 2;
 1297|   178k|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1297:22): [True: 169k, False: 9.08k]
  ------------------
 1298|   169k|        {
 1299|   169k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col + 2 - src_strd]);
  ------------------
  |  |   44|   169k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 156k, False: 13.1k]
  |  |  |  Branch (44:34): [True: 9.11k, False: 147k]
  |  |  ------------------
  ------------------
 1300|   169k|        }
 1301|  9.08k|    }
 1302|  46.0k|    else
 1303|  46.0k|    {
 1304|   911k|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1304:22): [True: 865k, False: 46.0k]
  ------------------
 1305|   865k|        {
 1306|   865k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col + 2]);
  ------------------
  |  |   44|   865k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 735k, False: 130k]
  |  |  |  Branch (44:34): [True: 146k, False: 588k]
  |  |  ------------------
  ------------------
 1307|   865k|        }
 1308|  46.0k|    }
 1309|       |
 1310|       |    /* If Right is not available */
 1311|  55.0k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1311:8): [True: 4.94k, False: 50.1k]
  ------------------
 1312|  4.94k|    {
 1313|  4.94k|        au1_mask[(wd - 1) >> 1] = 0;
 1314|  4.94k|    }
 1315|       |
 1316|       |    /* If Bottom is not available */
 1317|  55.0k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1317:8): [True: 4.53k, False: 50.5k]
  ------------------
 1318|  4.53k|    {
 1319|  4.53k|        ht--;
 1320|  4.53k|    }
 1321|       |
 1322|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1323|  55.0k|    {
 1324|   607k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1324:22): [True: 552k, False: 55.0k]
  ------------------
 1325|   552k|        {
 1326|   552k|            au1_sign_up[wd - 2] = SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 + 2 - src_strd]);
  ------------------
  |  |   44|   552k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 466k, False: 85.7k]
  |  |  |  Branch (44:34): [True: 86.7k, False: 379k]
  |  |  ------------------
  ------------------
 1327|   552k|            au1_sign_up[wd - 1] = SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 + 2 - src_strd]);
  ------------------
  |  |   44|   552k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 467k, False: 84.9k]
  |  |  |  Branch (44:34): [True: 78.5k, False: 388k]
  |  |  ------------------
  ------------------
 1328|  13.6M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1328:26): [True: 13.0M, False: 552k]
  ------------------
 1329|  13.0M|            {
 1330|  13.0M|                WORD32 edge_idx;
 1331|  13.0M|                WORD8 *pi1_sao_offset;
 1332|       |
 1333|  13.0M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (1333:34): [True: 6.52M, False: 6.52M]
  ------------------
 1334|       |
 1335|  13.0M|                u1_sign_down = SIGN(pu1_src[col] - ((col < 2) ? pu1_src_left_cpy[2 * (row + 1) + col] :
  ------------------
  |  |   44|  26.0M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 11.4M, False: 1.55M]
  |  |  |  Branch (44:23): [True: 1.10M, False: 11.9M]
  |  |  |  Branch (44:34): [True: 1.68M, False: 9.81M]
  |  |  |  Branch (44:35): [True: 964k, False: 10.5M]
  |  |  ------------------
  ------------------
 1336|  13.0M|                                                                pu1_src[col - 2 + src_strd]));
 1337|  13.0M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1338|  13.0M|                if(col > 1)
  ------------------
  |  Branch (1338:20): [True: 11.9M, False: 1.09M]
  ------------------
 1339|  11.9M|                    au1_sign_up[col - 2] = -u1_sign_down;
 1340|       |
 1341|  13.0M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
 1342|       |
 1343|  13.0M|                if(0 != edge_idx)
  ------------------
  |  Branch (1343:20): [True: 2.33M, False: 10.7M]
  ------------------
 1344|  2.33M|                {
 1345|  2.33M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  2.33M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 25.6k, False: 2.31M]
  |  |  |  Branch (40:53): [True: 26.7k, False: 2.28M]
  |  |  ------------------
  ------------------
 1346|  2.33M|                }
 1347|  13.0M|            }
 1348|       |
 1349|   552k|            pu1_src += src_strd;
 1350|   552k|        }
 1351|       |
 1352|  55.0k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 2] = u1_pos_wd_0_tmp_u;
  ------------------
  |  Branch (1352:19): [True: 46.0k, False: 9.05k]
  ------------------
 1353|  55.0k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u1_pos_wd_0_tmp_v;
  ------------------
  |  Branch (1353:19): [True: 46.0k, False: 9.04k]
  ------------------
 1354|  55.0k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u1_pos_0_ht_tmp_u;
  ------------------
  |  Branch (1354:18): [True: 50.5k, False: 4.49k]
  ------------------
 1355|  55.0k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0) + 1] = u1_pos_0_ht_tmp_v;
  ------------------
  |  Branch (1355:18): [True: 50.5k, False: 4.49k]
  ------------------
 1356|  55.0k|    }
 1357|       |
 1358|  55.0k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1358:8): [True: 9.08k, False: 46.0k]
  ------------------
 1359|  9.08k|        ht++;
 1360|  55.0k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1360:8): [True: 4.53k, False: 50.5k]
  ------------------
 1361|  4.53k|        ht++;
 1362|  55.0k|    pu1_src_top_left[0] = au1_src_top_left_tmp[0];
 1363|  55.0k|    pu1_src_top_left[1] = au1_src_top_left_tmp[1];
 1364|  1.19M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1364:18): [True: 1.13M, False: 55.0k]
  ------------------
 1365|  1.13M|    {
 1366|  1.13M|        pu1_src_left[row] = au1_src_left_tmp[row];
 1367|  1.13M|    }
 1368|  1.19M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1368:18): [True: 1.14M, False: 55.0k]
  ------------------
 1369|  1.14M|    {
 1370|  1.14M|        pu1_src_top[col] = au1_src_top_tmp[col];
 1371|  1.14M|    }
 1372|       |
 1373|  55.0k|}

ihevc_weighted_pred_uni:
  114|   478k|{
  115|   478k|    WORD32 row, col;
  116|   478k|    WORD32 i4_tmp;
  117|       |
  118|  4.45M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (118:18): [True: 3.97M, False: 478k]
  ------------------
  119|  3.97M|    {
  120|  49.0M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (120:22): [True: 45.0M, False: 3.97M]
  ------------------
  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.38M, False: 43.6M]
  |  |  |  |  |  Branch (40:53): [True: 3.48M, False: 40.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|  45.0M|        }
  128|       |
  129|  3.97M|        pi2_src += src_strd;
  130|  3.97M|        pu1_dst += dst_strd;
  131|  3.97M|    }
  132|   478k|}
ihevc_weighted_pred_chroma_uni:
  199|   468k|{
  200|   468k|    WORD32 row, col;
  201|   468k|    WORD32 i4_tmp;
  202|       |
  203|  2.49M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (203:18): [True: 2.02M, False: 468k]
  ------------------
  204|  2.02M|    {
  205|  13.5M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (205:22): [True: 11.5M, False: 2.02M]
  ------------------
  206|  11.5M|        {
  207|  11.5M|            i4_tmp = (pi2_src[col] + lvl_shift) * wgt0_cb;
  208|  11.5M|            i4_tmp += 1 << (shift - 1);
  209|  11.5M|            i4_tmp = (i4_tmp >> shift) + off0_cb;
  210|       |
  211|  11.5M|            pu1_dst[col] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  11.5M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 169k, False: 11.3M]
  |  |  |  |  |  Branch (40:53): [True: 705k, False: 10.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|  11.5M|            i4_tmp = (pi2_src[col + 1] + lvl_shift) * wgt0_cr;
  214|  11.5M|            i4_tmp += 1 << (shift - 1);
  215|  11.5M|            i4_tmp = (i4_tmp >> shift) + off0_cr;
  216|       |
  217|  11.5M|            pu1_dst[col + 1] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  11.5M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 117k, False: 11.3M]
  |  |  |  |  |  Branch (40:53): [True: 600k, False: 10.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|  11.5M|        }
  219|       |
  220|  2.02M|        pi2_src += src_strd;
  221|  2.02M|        pu1_dst += dst_strd;
  222|  2.02M|    }
  223|   468k|}
ihevc_weighted_pred_bi:
  305|  16.9M|{
  306|  16.9M|    WORD32 row, col;
  307|  16.9M|    WORD32 i4_tmp;
  308|       |
  309|   147M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (309:18): [True: 130M, False: 16.9M]
  ------------------
  310|   130M|    {
  311|  1.25G|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (311:22): [True: 1.12G, False: 130M]
  ------------------
  312|  1.12G|        {
  313|  1.12G|            i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0;
  314|  1.12G|            i4_tmp += (pi2_src2[col] + lvl_shift2) * wgt1;
  315|  1.12G|            i4_tmp += (off0 + off1 + 1) << (shift - 1);
  316|       |
  317|  1.12G|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|  1.12G|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.12G|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 119M, False: 1.00G]
  |  |  |  |  |  Branch (40:53): [True: 49.1M, False: 952M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  1.12G|        }
  319|       |
  320|   130M|        pi2_src1 += src_strd1;
  321|   130M|        pi2_src2 += src_strd2;
  322|   130M|        pu1_dst += dst_strd;
  323|   130M|    }
  324|  16.9M|}
ihevc_weighted_pred_chroma_bi:
  410|  16.8M|{
  411|  16.8M|    WORD32 row, col;
  412|  16.8M|    WORD32 i4_tmp;
  413|       |
  414|  83.8M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (414:18): [True: 67.0M, False: 16.8M]
  ------------------
  415|  67.0M|    {
  416|   356M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (416:22): [True: 289M, False: 67.0M]
  ------------------
  417|   289M|        {
  418|   289M|            i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0_cb;
  419|   289M|            i4_tmp += (pi2_src2[col] + lvl_shift2) * wgt1_cb;
  420|   289M|            i4_tmp += (off0_cb + off1_cb + 1) << (shift - 1);
  421|       |
  422|   289M|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|   289M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   289M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 743k, False: 288M]
  |  |  |  |  |  Branch (40:53): [True: 1.77M, False: 286M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  423|       |
  424|   289M|            i4_tmp = (pi2_src1[col + 1] + lvl_shift1) * wgt0_cr;
  425|   289M|            i4_tmp += (pi2_src2[col + 1] + lvl_shift2) * wgt1_cr;
  426|   289M|            i4_tmp += (off0_cr + off1_cr + 1) << (shift - 1);
  427|       |
  428|   289M|            pu1_dst[col + 1] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|   289M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   289M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.44M, False: 285M]
  |  |  |  |  |  Branch (40:53): [True: 2.74M, False: 283M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|   289M|        }
  430|       |
  431|  67.0M|        pi2_src1 += src_strd1;
  432|  67.0M|        pi2_src2 += src_strd2;
  433|  67.0M|        pu1_dst += dst_strd;
  434|  67.0M|    }
  435|  16.8M|}
ihevc_weighted_pred_bi_default:
  497|  13.6M|{
  498|  13.6M|    WORD32 row, col;
  499|  13.6M|    WORD32 i4_tmp;
  500|  13.6M|    WORD32 shift;
  501|       |
  502|  13.6M|    shift = SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|  13.6M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.6M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  503|  94.1M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (503:18): [True: 80.4M, False: 13.6M]
  ------------------
  504|  80.4M|    {
  505|   770M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (505:22): [True: 690M, False: 80.4M]
  ------------------
  506|   690M|        {
  507|   690M|            i4_tmp = pi2_src1[col] + lvl_shift1;
  508|   690M|            i4_tmp += pi2_src2[col] + lvl_shift2;
  509|   690M|            i4_tmp += 1 << (shift - 1);
  510|       |
  511|   690M|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|   690M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   690M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 511k, False: 689M]
  |  |  |  |  |  Branch (40:53): [True: 639k, False: 689M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|   690M|        }
  513|       |
  514|  80.4M|        pi2_src1 += src_strd1;
  515|  80.4M|        pi2_src2 += src_strd2;
  516|  80.4M|        pu1_dst += dst_strd;
  517|  80.4M|    }
  518|  13.6M|}

ithread_get_handle_size:
   55|   224k|{
   56|   224k|    return sizeof(pthread_t);
   57|   224k|}
ithread_get_mutex_lock_size:
   60|   301k|{
   61|   301k|    return sizeof(pthread_mutex_t);
   62|   301k|}
ithread_create:
   65|  27.3k|{
   66|  27.3k|    return pthread_create((pthread_t *)thread_handle, attribute, (void * (*)(void *))strt, argument);
   67|  27.3k|}
ithread_join:
   70|  27.3k|{
   71|  27.3k|    pthread_t *pthread_handle   = (pthread_t *)thread_handle;
   72|  27.3k|    return pthread_join(*pthread_handle, val_ptr);
   73|  27.3k|}
ithread_mutex_init:
   85|   425k|{
   86|       |    return pthread_mutex_init((pthread_mutex_t *)mutex, NULL);
   87|   425k|}
ithread_mutex_destroy:
   90|   425k|{
   91|   425k|    return pthread_mutex_destroy((pthread_mutex_t *)mutex);
   92|   425k|}
ithread_mutex_lock:
   95|  7.87M|{
   96|  7.87M|    return pthread_mutex_lock((pthread_mutex_t *)mutex);
   97|  7.87M|}
ithread_mutex_unlock:
  100|  7.93M|{
  101|  7.93M|    return pthread_mutex_unlock((pthread_mutex_t *)mutex);
  102|  7.93M|}
ithread_yield:
  105|  43.6M|{
  106|  43.6M|    sched_yield();
  107|  43.6M|}
ithread_set_affinity:
  150|   235k|{
  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|   235k|    return core_id;
  183|   235k|}
ithread_get_cond_struct_size:
  186|   224k|{
  187|   224k|    return (sizeof(pthread_cond_t));
  188|   224k|}
ithread_cond_init:
  191|   399k|{
  192|       |    return pthread_cond_init((pthread_cond_t *)cond, NULL);
  193|   399k|}
ithread_cond_destroy:
  196|   399k|{
  197|   399k|    return pthread_cond_destroy((pthread_cond_t *)cond);
  198|   399k|}
ithread_cond_wait:
  201|   133k|{
  202|   133k|    return pthread_cond_wait((pthread_cond_t *)cond, (pthread_mutex_t *)mutex);
  203|   133k|}
ithread_cond_signal:
  206|   228k|{
  207|   228k|    return pthread_cond_signal((pthread_cond_t *)cond);
  208|   228k|}

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

ihevc_intra_pred_chroma_planar_sse42:
  114|   101k|{
  115|       |
  116|   101k|    WORD32 row, col;
  117|   101k|    WORD32 log2nt = 5;
  118|   101k|    WORD32 two_nt, three_nt;
  119|       |
  120|   101k|    __m128i const_temp_4x32b, const_temp1_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
  121|   101k|    __m128i col_8x16b, const_temp5_4x32b, const_temp6_4x32b, zero_8x16b, const_temp7_4x32b;
  122|   101k|    UNUSED(src_strd);
  ------------------
  |  |   38|   101k|#define UNUSED(x) ((void)(x))
  ------------------
  123|   101k|    UNUSED(mode);
  ------------------
  |  |   38|   101k|#define UNUSED(x) ((void)(x))
  ------------------
  124|       |
  125|   101k|    switch(nt)
  126|   101k|    {
  127|      0|        case 32:
  ------------------
  |  Branch (127:9): [True: 0, False: 101k]
  ------------------
  128|      0|            log2nt = 5;
  129|      0|            break;
  130|  33.5k|        case 16:
  ------------------
  |  Branch (130:9): [True: 33.5k, False: 68.1k]
  ------------------
  131|  33.5k|            log2nt = 4;
  132|  33.5k|            break;
  133|  29.6k|        case 8:
  ------------------
  |  Branch (133:9): [True: 29.6k, False: 72.0k]
  ------------------
  134|  29.6k|            log2nt = 3;
  135|  29.6k|            break;
  136|  38.5k|        case 4:
  ------------------
  |  Branch (136:9): [True: 38.5k, False: 63.1k]
  ------------------
  137|  38.5k|            log2nt = 2;
  138|  38.5k|            break;
  139|      0|        default:
  ------------------
  |  Branch (139:9): [True: 0, False: 101k]
  ------------------
  140|      0|            break;
  141|   101k|    }
  142|   101k|    two_nt = 2 * nt;
  143|   101k|    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|   101k|    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|   101k|                                      pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  156|   101k|                                      pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  157|       |
  158|   101k|    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|   101k|                                      pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  160|       |
  161|   101k|    const_temp4_4x32b = _mm_set1_epi16(nt - 1);
  162|   101k|    const_temp6_4x32b = _mm_set1_epi16(nt);
  163|   101k|    const_temp7_4x32b = _mm_set1_epi16(4);
  164|       |
  165|   101k|    zero_8x16b = _mm_set1_epi32(0);
  166|       |
  167|   101k|    if(nt % 4 == 0 && nt < 32)
  ------------------
  |  Branch (167:8): [True: 101k, False: 9]
  |  Branch (167:23): [True: 101k, False: 1]
  ------------------
  168|   101k|    {
  169|   101k|        const_temp7_4x32b = _mm_set1_epi16(4);
  170|       |
  171|  1.02M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (171:22): [True: 923k, False: 101k]
  ------------------
  172|   923k|        {
  173|   923k|            __m128i res_temp_8x16b, row_8x16b, res_temp1_8x16b, res_temp2_8x16b;
  174|   923k|            __m128i res_temp3_8x16b;
  175|       |
  176|   923k|            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|   923k|                                               pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  178|   923k|                                               pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  179|       |
  180|   923k|            const_temp3_4x32b  = _mm_set1_epi16((row + 1));
  181|   923k|            row_8x16b = _mm_set1_epi16((nt - 1 - row));
  182|       |
  183|   923k|            const_temp5_4x32b = _mm_set_epi16(3, 3, 2, 2, 1, 1, 0, 0);
  184|   923k|            col_8x16b = _mm_set_epi16(4, 4, 3, 3, 2, 2, 1, 1);
  185|       |
  186|   923k|            const_temp5_4x32b = _mm_sub_epi16(const_temp4_4x32b, const_temp5_4x32b);
  187|       |
  188|       |            /*(row + 1) * pu1_ref[nt - 1]*/
  189|   923k|            res_temp_8x16b  = _mm_mullo_epi16(const_temp3_4x32b,  const_temp1_4x32b);
  190|       |
  191|       |            /*(row + 1) * pu1_ref[nt - 1] + nt)*/
  192|   923k|            res_temp_8x16b = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  193|       |
  194|  3.68M|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (194:26): [True: 2.76M, False: 923k]
  ------------------
  195|  2.76M|            {
  196|  2.76M|                __m128i src_temp_8x16b;
  197|       |
  198|       |                /* loding 8bit 16 pixles*/
  199|  2.76M|                src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (two_nt + 1) + col));
  200|       |
  201|  2.76M|                src_temp_8x16b =  _mm_cvtepu8_epi16(src_temp_8x16b); /* row=0*/
  202|       |
  203|       |                /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] */
  204|  2.76M|                res_temp1_8x16b  = _mm_mullo_epi16(src_temp_8x16b,  row_8x16b);
  205|       |
  206|       |                /*(col + 1) * pu1_ref[three_nt + 1]*/
  207|  2.76M|                res_temp2_8x16b  = _mm_mullo_epi16(const_temp_4x32b,  col_8x16b);
  208|       |
  209|       |                /*(nt - 1 - col)* pu1_ref[two_nt - 1 - row]*/
  210|  2.76M|                res_temp3_8x16b  = _mm_mullo_epi16(const_temp2_4x32b,  const_temp5_4x32b);
  211|       |
  212|  2.76M|                res_temp1_8x16b = _mm_add_epi16(res_temp_8x16b, res_temp1_8x16b);
  213|  2.76M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  214|  2.76M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp3_8x16b);
  215|       |
  216|  2.76M|                res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, (log2nt + 1));
  217|  2.76M|                res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  218|       |
  219|  2.76M|                _mm_storel_epi64((__m128i *)(pu1_dst + (row * dst_strd) + col), res_temp1_8x16b);
  220|       |
  221|  2.76M|                const_temp5_4x32b = _mm_sub_epi16(const_temp5_4x32b, const_temp7_4x32b);
  222|  2.76M|                col_8x16b = _mm_add_epi16(col_8x16b, const_temp7_4x32b);
  223|  2.76M|            } /* inner loop ends here */
  224|   923k|        }
  225|   101k|    }
  226|      8|    else if(nt == 32)
  ------------------
  |  Branch (226:13): [True: 0, False: 8]
  ------------------
  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|   101k|}
ihevc_intra_pred_chroma_dc_sse42:
  365|  45.7k|{
  366|       |
  367|  45.7k|    WORD32 acc_dc_u, acc_dc_v;
  368|  45.7k|    WORD32 dc_val_u, dc_val_v;
  369|  45.7k|    WORD32 row, i;
  370|  45.7k|    WORD32 log2nt = 5;
  371|  45.7k|    __m128i src_temp1, src_temp3, src_temp4, src_temp5, src_temp6, m_mask;
  372|  45.7k|    __m128i src_temp7, src_temp8, src_temp9, src_temp10, src_temp11;
  373|  45.7k|    __m128i m_zero = _mm_set1_epi32(0);
  374|  45.7k|    UNUSED(src_strd);
  ------------------
  |  |   38|  45.7k|#define UNUSED(x) ((void)(x))
  ------------------
  375|  45.7k|    UNUSED(mode);
  ------------------
  |  |   38|  45.7k|#define UNUSED(x) ((void)(x))
  ------------------
  376|       |
  377|  45.7k|    switch(nt)
  378|  45.7k|    {
  379|      0|        case 32:
  ------------------
  |  Branch (379:9): [True: 0, False: 45.7k]
  ------------------
  380|      0|            log2nt = 5;
  381|      0|            break;
  382|  13.9k|        case 16:
  ------------------
  |  Branch (382:9): [True: 13.9k, False: 31.7k]
  ------------------
  383|  13.9k|            log2nt = 4;
  384|  13.9k|            break;
  385|  8.37k|        case 8:
  ------------------
  |  Branch (385:9): [True: 8.37k, False: 37.3k]
  ------------------
  386|  8.37k|            log2nt = 3;
  387|  8.37k|            break;
  388|  23.4k|        case 4:
  ------------------
  |  Branch (388:9): [True: 23.4k, False: 22.3k]
  ------------------
  389|  23.4k|            log2nt = 2;
  390|  23.4k|            break;
  391|      0|        default:
  ------------------
  |  Branch (391:9): [True: 0, False: 45.7k]
  ------------------
  392|      0|            break;
  393|  45.7k|    }
  394|       |
  395|  45.7k|    acc_dc_u = 0;
  396|  45.7k|    acc_dc_v = 0;
  397|       |
  398|       |    /* Calculate DC value for the transform block */
  399|       |
  400|  45.7k|    m_mask = _mm_loadu_si128((__m128i *)&IHEVCE_SHUFFLEMASKY9[0]);
  401|       |
  402|  45.7k|    if(nt == 32)
  ------------------
  |  Branch (402:8): [True: 0, False: 45.7k]
  ------------------
  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|  45.7k|    else if(nt == 16)
  ------------------
  |  Branch (474:13): [True: 13.9k, False: 31.7k]
  ------------------
  475|  13.9k|    {
  476|  13.9k|        __m128i temp_sad;
  477|       |
  478|  13.9k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  479|  13.9k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  480|  13.9k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  481|  13.9k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  482|       |
  483|  13.9k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  484|  13.9k|        src_temp6 =  _mm_cvtepu8_epi16(src_temp4);
  485|  13.9k|        src_temp9 =  _mm_cvtepu8_epi16(src_temp7);
  486|  13.9k|        src_temp10 =  _mm_cvtepu8_epi16(src_temp8);
  487|       |
  488|  13.9k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  489|  13.9k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  490|  13.9k|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  491|  13.9k|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  492|       |
  493|  13.9k|        src_temp3 =  _mm_cvtepu8_epi16(src_temp3);
  494|  13.9k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  495|  13.9k|        src_temp7 =  _mm_cvtepu8_epi16(src_temp7);
  496|  13.9k|        src_temp8 =  _mm_cvtepu8_epi16(src_temp8);
  497|       |
  498|  13.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  499|  13.9k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  500|  13.9k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  501|  13.9k|        src_temp10 = _mm_add_epi16(src_temp9, src_temp10);
  502|       |
  503|  13.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  504|  13.9k|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  505|       |
  506|  13.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  507|  13.9k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  508|  13.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  509|  13.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  510|       |
  511|  13.9k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  512|  13.9k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  513|  13.9k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  514|  13.9k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  515|  13.9k|    }
  516|       |
  517|  31.7k|    else if(nt == 8)
  ------------------
  |  Branch (517:13): [True: 8.37k, False: 23.4k]
  ------------------
  518|  8.37k|    {
  519|  8.37k|        __m128i temp_sad;
  520|  8.37k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  521|  8.37k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  522|       |
  523|  8.37k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  524|  8.37k|        src_temp6 =  _mm_cvtepu8_epi16(src_temp4);
  525|       |
  526|  8.37k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  527|  8.37k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  528|       |
  529|  8.37k|        src_temp3 =  _mm_cvtepu8_epi16(src_temp3);
  530|  8.37k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  531|       |
  532|  8.37k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  533|  8.37k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  534|       |
  535|  8.37k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  536|  8.37k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  537|  8.37k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  538|  8.37k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  539|       |
  540|  8.37k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  541|  8.37k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  542|  8.37k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  543|  8.37k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  544|  8.37k|    }
  545|       |
  546|  23.4k|    else if(nt == 4)
  ------------------
  |  Branch (546:13): [True: 23.4k, False: 18.4E]
  ------------------
  547|  23.4k|    {
  548|  23.4k|        __m128i temp_sad;
  549|  23.4k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  550|       |
  551|  23.4k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  552|  23.4k|        src_temp4 = _mm_srli_si128(src_temp3, 8);
  553|  23.4k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  554|       |
  555|  23.4k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  556|       |
  557|  23.4k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  558|  23.4k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  559|  23.4k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  560|       |
  561|  23.4k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  562|  23.4k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  563|  23.4k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  564|  23.4k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  565|  23.4k|    }
  566|       |
  567|       |
  568|  45.7k|    acc_dc_u += pu1_ref[6 * nt];
  569|  45.7k|    acc_dc_v += pu1_ref[6 * nt + 1];
  570|       |
  571|  45.7k|    acc_dc_u -= pu1_ref[4 * nt];
  572|  45.7k|    acc_dc_v -= pu1_ref[4 * nt + 1];
  573|       |
  574|  45.7k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  575|  45.7k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  576|       |
  577|  45.7k|    dc_val_u = dc_val_u | (dc_val_v << 8);
  578|       |
  579|       |    /* Fill the remaining rows with DC value*/
  580|       |
  581|  45.7k|    if(nt == 4)
  ------------------
  |  Branch (581:8): [True: 23.4k, False: 22.3k]
  ------------------
  582|  23.4k|    {
  583|  23.4k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  584|       |
  585|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  586|  23.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  587|  23.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  588|  23.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  589|  23.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  590|       |
  591|  23.4k|    }
  592|  22.3k|    else if(nt == 8)
  ------------------
  |  Branch (592:13): [True: 8.37k, False: 13.9k]
  ------------------
  593|  8.37k|    {
  594|  8.37k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  595|       |
  596|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  597|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  598|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  599|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  600|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  601|       |
  602|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  603|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  604|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  605|  8.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  606|       |
  607|  8.37k|    }
  608|       |
  609|  13.9k|    else if(nt == 16) /* nt == 16 */
  ------------------
  |  Branch (609:13): [True: 13.9k, False: 18.4E]
  ------------------
  610|  13.9k|    {
  611|       |
  612|  13.9k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  613|       |
  614|  41.8k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (614:22): [True: 27.8k, False: 13.9k]
  ------------------
  615|  27.8k|        {
  616|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  617|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  618|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  619|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  620|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  621|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp1);
  622|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp1);
  623|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp1);
  624|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp1);
  625|       |
  626|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  627|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  628|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  629|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  630|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp1);
  631|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp1);
  632|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp1);
  633|  27.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp1);
  634|       |
  635|  27.8k|            pu1_dst += 8 * dst_strd;
  636|  27.8k|        }
  637|       |
  638|       |
  639|  13.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|  45.7k|}

ihevc_intra_pred_chroma_planar_ssse3:
  133|   447k|{
  134|       |
  135|   447k|    WORD32 row, col;
  136|   447k|    WORD32 log2nt = 5;
  137|   447k|    WORD32 two_nt, three_nt;
  138|       |
  139|   447k|    __m128i const_temp_4x32b, const_temp1_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
  140|   447k|    __m128i col_8x16b, const_temp5_4x32b, const_temp6_4x32b, zero_8x16b, const_temp7_4x32b;
  141|   447k|    UNUSED(src_strd);
  ------------------
  |  |   38|   447k|#define UNUSED(x) ((void)(x))
  ------------------
  142|   447k|    UNUSED(mode);
  ------------------
  |  |   38|   447k|#define UNUSED(x) ((void)(x))
  ------------------
  143|   447k|    switch(nt)
  144|   447k|    {
  145|      0|        case 32:
  ------------------
  |  Branch (145:9): [True: 0, False: 447k]
  ------------------
  146|      0|            log2nt = 5;
  147|      0|            break;
  148|   106k|        case 16:
  ------------------
  |  Branch (148:9): [True: 106k, False: 341k]
  ------------------
  149|   106k|            log2nt = 4;
  150|   106k|            break;
  151|   149k|        case 8:
  ------------------
  |  Branch (151:9): [True: 149k, False: 298k]
  ------------------
  152|   149k|            log2nt = 3;
  153|   149k|            break;
  154|   192k|        case 4:
  ------------------
  |  Branch (154:9): [True: 192k, False: 254k]
  ------------------
  155|   192k|            log2nt = 2;
  156|   192k|            break;
  157|      0|        default:
  ------------------
  |  Branch (157:9): [True: 0, False: 447k]
  ------------------
  158|      0|            break;
  159|   447k|    }
  160|   447k|    two_nt = 2 * nt;
  161|   447k|    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|   447k|    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|   447k|                                      pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  174|   447k|                                      pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  175|       |
  176|   447k|    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|   447k|                                      pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  178|       |
  179|   447k|    const_temp4_4x32b = _mm_set1_epi16(nt - 1);
  180|   447k|    const_temp6_4x32b = _mm_set1_epi16(nt);
  181|   447k|    const_temp7_4x32b = _mm_set1_epi16(4);
  182|       |
  183|   447k|    zero_8x16b = _mm_set1_epi32(0);
  184|       |
  185|   447k|    if(nt % 4 == 0 && nt < 32)
  ------------------
  |  Branch (185:8): [True: 447k, False: 109]
  |  Branch (185:23): [True: 447k, False: 18.4E]
  ------------------
  186|   447k|    {
  187|   447k|        const_temp7_4x32b = _mm_set1_epi16(4);
  188|       |
  189|  4.09M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (189:22): [True: 3.65M, False: 447k]
  ------------------
  190|  3.65M|        {
  191|  3.65M|            __m128i res_temp_8x16b, row_8x16b, res_temp1_8x16b, res_temp2_8x16b;
  192|  3.65M|            __m128i res_temp3_8x16b;
  193|       |
  194|  3.65M|            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|  3.65M|                                               pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  196|  3.65M|                                               pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  197|       |
  198|  3.65M|            const_temp3_4x32b  = _mm_set1_epi16((row + 1));
  199|  3.65M|            row_8x16b = _mm_set1_epi16((nt - 1 - row));
  200|       |
  201|  3.65M|            const_temp5_4x32b = _mm_set_epi16(3, 3, 2, 2, 1, 1, 0, 0);
  202|  3.65M|            col_8x16b = _mm_set_epi16(4, 4, 3, 3, 2, 2, 1, 1);
  203|       |
  204|  3.65M|            const_temp5_4x32b = _mm_sub_epi16(const_temp4_4x32b, const_temp5_4x32b);
  205|       |
  206|       |            /*(row + 1) * pu1_ref[nt - 1]*/
  207|  3.65M|            res_temp_8x16b  = _mm_mullo_epi16(const_temp3_4x32b,  const_temp1_4x32b);
  208|       |
  209|       |            /*(row + 1) * pu1_ref[nt - 1] + nt)*/
  210|  3.65M|            res_temp_8x16b = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  211|       |
  212|  13.5M|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (212:26): [True: 9.91M, False: 3.65M]
  ------------------
  213|  9.91M|            {
  214|  9.91M|                __m128i src_temp_8x16b;
  215|       |
  216|       |                /* loding 8bit 16 pixles*/
  217|  9.91M|                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|  9.91M|                src_temp_8x16b = _mm_unpacklo_epi8(src_temp_8x16b, zero_8x16b);
  221|       |
  222|       |                /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] */
  223|  9.91M|                res_temp1_8x16b  = _mm_mullo_epi16(src_temp_8x16b,  row_8x16b);
  224|       |
  225|       |                /*(col + 1) * pu1_ref[three_nt + 1]*/
  226|  9.91M|                res_temp2_8x16b  = _mm_mullo_epi16(const_temp_4x32b,  col_8x16b);
  227|       |
  228|       |                /*(nt - 1 - col)* pu1_ref[two_nt - 1 - row]*/
  229|  9.91M|                res_temp3_8x16b  = _mm_mullo_epi16(const_temp2_4x32b,  const_temp5_4x32b);
  230|       |
  231|  9.91M|                res_temp1_8x16b = _mm_add_epi16(res_temp_8x16b, res_temp1_8x16b);
  232|  9.91M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  233|  9.91M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp3_8x16b);
  234|       |
  235|  9.91M|                res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, (log2nt + 1));
  236|  9.91M|                res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  237|       |
  238|  9.91M|                _mm_storel_epi64((__m128i *)(pu1_dst + (row * dst_strd) + col), res_temp1_8x16b);
  239|       |
  240|  9.91M|                const_temp5_4x32b = _mm_sub_epi16(const_temp5_4x32b, const_temp7_4x32b);
  241|  9.91M|                col_8x16b = _mm_add_epi16(col_8x16b, const_temp7_4x32b);
  242|  9.91M|            } /* inner loop ends here */
  243|  3.65M|        }
  244|   447k|    }
  245|    102|    else if(nt == 32)
  ------------------
  |  Branch (245:13): [True: 0, False: 102]
  ------------------
  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|   447k|}
ihevc_intra_pred_chroma_dc_ssse3:
  383|   201k|{
  384|       |
  385|   201k|    WORD32 acc_dc_u, acc_dc_v;
  386|   201k|    WORD32 dc_val_u, dc_val_v;
  387|   201k|    WORD32 row, i;
  388|   201k|    WORD32 log2nt = 5;
  389|   201k|    __m128i src_temp1, src_temp3, src_temp4, src_temp5, src_temp6, m_mask;
  390|   201k|    __m128i src_temp7, src_temp8, src_temp9, src_temp10, src_temp11;
  391|   201k|    __m128i m_zero = _mm_set1_epi32(0);
  392|   201k|    UNUSED(src_strd);
  ------------------
  |  |   38|   201k|#define UNUSED(x) ((void)(x))
  ------------------
  393|   201k|    UNUSED(mode);
  ------------------
  |  |   38|   201k|#define UNUSED(x) ((void)(x))
  ------------------
  394|       |
  395|   201k|    switch(nt)
  396|   201k|    {
  397|      0|        case 32:
  ------------------
  |  Branch (397:9): [True: 0, False: 201k]
  ------------------
  398|      0|            log2nt = 5;
  399|      0|            break;
  400|  40.9k|        case 16:
  ------------------
  |  Branch (400:9): [True: 40.9k, False: 160k]
  ------------------
  401|  40.9k|            log2nt = 4;
  402|  40.9k|            break;
  403|  51.1k|        case 8:
  ------------------
  |  Branch (403:9): [True: 51.1k, False: 150k]
  ------------------
  404|  51.1k|            log2nt = 3;
  405|  51.1k|            break;
  406|   109k|        case 4:
  ------------------
  |  Branch (406:9): [True: 109k, False: 91.9k]
  ------------------
  407|   109k|            log2nt = 2;
  408|   109k|            break;
  409|      0|        default:
  ------------------
  |  Branch (409:9): [True: 0, False: 201k]
  ------------------
  410|      0|            break;
  411|   201k|    }
  412|       |
  413|   201k|    acc_dc_u = 0;
  414|   201k|    acc_dc_v = 0;
  415|       |
  416|       |    /* Calculate DC value for the transform block */
  417|       |
  418|   201k|    m_mask = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY9[0]);
  419|       |
  420|   201k|    if(nt == 32)
  ------------------
  |  Branch (420:8): [True: 0, False: 201k]
  ------------------
  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|   201k|    else if(nt == 16)
  ------------------
  |  Branch (496:13): [True: 40.9k, False: 160k]
  ------------------
  497|  40.9k|    {
  498|  40.9k|        __m128i temp_sad, sign_8x16b;
  499|       |
  500|  40.9k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  501|  40.9k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  502|  40.9k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  503|  40.9k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  504|       |
  505|  40.9k|        src_temp5  = _mm_unpacklo_epi8(src_temp3, m_zero);
  506|  40.9k|        src_temp6  = _mm_unpacklo_epi8(src_temp4, m_zero);
  507|  40.9k|        src_temp9  = _mm_unpacklo_epi8(src_temp7, m_zero);
  508|  40.9k|        src_temp10 = _mm_unpacklo_epi8(src_temp8, m_zero);
  509|       |
  510|  40.9k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  511|  40.9k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  512|  40.9k|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  513|  40.9k|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  514|       |
  515|  40.9k|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  516|  40.9k|        src_temp4 = _mm_unpacklo_epi8(src_temp4, m_zero);
  517|  40.9k|        src_temp7 = _mm_unpacklo_epi8(src_temp7, m_zero);
  518|  40.9k|        src_temp8 = _mm_unpacklo_epi8(src_temp8, m_zero);
  519|       |
  520|  40.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  521|  40.9k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  522|  40.9k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  523|  40.9k|        src_temp10 = _mm_add_epi16(src_temp9, src_temp10);
  524|       |
  525|  40.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  526|  40.9k|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  527|       |
  528|  40.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  529|  40.9k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  530|  40.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  531|  40.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  532|       |
  533|  40.9k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  534|  40.9k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  535|       |
  536|  40.9k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  537|  40.9k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  538|  40.9k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  539|  40.9k|    }
  540|       |
  541|   160k|    else if(nt == 8)
  ------------------
  |  Branch (541:13): [True: 51.1k, False: 109k]
  ------------------
  542|  51.1k|    {
  543|  51.1k|        __m128i temp_sad, sign_8x16b;
  544|  51.1k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  545|  51.1k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  546|       |
  547|  51.1k|        src_temp5 = _mm_unpacklo_epi8(src_temp3, m_zero);
  548|  51.1k|        src_temp6 = _mm_unpacklo_epi8(src_temp4, m_zero);
  549|       |
  550|  51.1k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  551|  51.1k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  552|       |
  553|  51.1k|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  554|  51.1k|        src_temp4 = _mm_unpacklo_epi8(src_temp4, m_zero);
  555|       |
  556|  51.1k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  557|  51.1k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  558|       |
  559|  51.1k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  560|  51.1k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  561|  51.1k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  562|  51.1k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  563|       |
  564|  51.1k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  565|  51.1k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  566|       |
  567|  51.1k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  568|  51.1k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  569|  51.1k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  570|  51.1k|    }
  571|       |
  572|   109k|    else if(nt == 4)
  ------------------
  |  Branch (572:13): [True: 109k, False: 18.4E]
  ------------------
  573|   109k|    {
  574|   109k|        __m128i temp_sad, sign_8x16b;
  575|   109k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  576|       |
  577|   109k|        src_temp5 =  _mm_unpacklo_epi8(src_temp3, m_zero);
  578|   109k|        src_temp4 = _mm_srli_si128(src_temp3, 8);
  579|       |
  580|   109k|        src_temp4 =  _mm_unpacklo_epi8(src_temp4, m_zero);
  581|       |
  582|   109k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  583|       |
  584|   109k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  585|   109k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  586|   109k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  587|       |
  588|   109k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  589|   109k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  590|       |
  591|   109k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  592|   109k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  593|   109k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  594|   109k|    }
  595|       |
  596|       |
  597|   201k|    acc_dc_u += pu1_ref[6 * nt];
  598|   201k|    acc_dc_v += pu1_ref[6 * nt + 1];
  599|       |
  600|   201k|    acc_dc_u -= pu1_ref[4 * nt];
  601|   201k|    acc_dc_v -= pu1_ref[4 * nt + 1];
  602|       |
  603|   201k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  604|   201k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  605|       |
  606|   201k|    dc_val_u = dc_val_u | (dc_val_v << 8);
  607|       |
  608|       |    /* Fill the remaining rows with DC value*/
  609|       |
  610|   201k|    if(nt == 4)
  ------------------
  |  Branch (610:8): [True: 109k, False: 91.9k]
  ------------------
  611|   109k|    {
  612|   109k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  613|       |
  614|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  615|   109k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  616|   109k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  617|   109k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  618|   109k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  619|       |
  620|   109k|    }
  621|  91.9k|    else if(nt == 8)
  ------------------
  |  Branch (621:13): [True: 51.1k, False: 40.8k]
  ------------------
  622|  51.1k|    {
  623|  51.1k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  624|       |
  625|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  626|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  627|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  628|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  629|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  630|       |
  631|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  632|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  633|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  634|  51.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  635|       |
  636|  51.1k|    }
  637|  40.8k|    else if(nt == 16)
  ------------------
  |  Branch (637:13): [True: 40.9k, False: 18.4E]
  ------------------
  638|  40.9k|    {
  639|  40.9k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  640|       |
  641|   122k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (641:22): [True: 81.9k, False: 40.9k]
  ------------------
  642|  81.9k|        {
  643|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  644|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  645|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  646|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  647|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  648|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp1);
  649|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp1);
  650|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp1);
  651|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp1);
  652|       |
  653|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  654|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  655|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  656|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  657|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp1);
  658|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp1);
  659|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp1);
  660|  81.9k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp1);
  661|       |
  662|  81.9k|            pu1_dst += 8 * dst_strd;
  663|  81.9k|        }
  664|  40.9k|    }
  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|   201k|}
ihevc_intra_pred_chroma_horz_ssse3:
  730|  99.5k|{
  731|       |
  732|  99.5k|    WORD32 row, col;
  733|  99.5k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6,  temp7, temp8;
  734|  99.5k|    UNUSED(src_strd);
  ------------------
  |  |   38|  99.5k|#define UNUSED(x) ((void)(x))
  ------------------
  735|  99.5k|    UNUSED(mode);
  ------------------
  |  |   38|  99.5k|#define UNUSED(x) ((void)(x))
  ------------------
  736|       |
  737|       |    /* Replication to next rows*/
  738|       |
  739|  99.5k|    if(nt == 8)
  ------------------
  |  Branch (739:8): [True: 18.2k, False: 81.3k]
  ------------------
  740|  18.2k|    {
  741|  54.6k|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (741:22): [True: 36.4k, False: 18.2k]
  ------------------
  742|  36.4k|        {
  743|  36.4k|            temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 0)]);
  744|  36.4k|            temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 0)]);
  745|  36.4k|            temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 1)]);
  746|  36.4k|            temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 1)]);
  747|  36.4k|            temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 2)]);
  748|  36.4k|            temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 2)]);
  749|  36.4k|            temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 3)]);
  750|  36.4k|            temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 3)]);
  751|       |
  752|  36.4k|            temp2 = _mm_unpacklo_epi8(temp1, temp2);
  753|  36.4k|            temp4 = _mm_unpacklo_epi8(temp3, temp4);
  754|  36.4k|            temp6 = _mm_unpacklo_epi8(temp5, temp6);
  755|  36.4k|            temp8 = _mm_unpacklo_epi8(temp7, temp8);
  756|       |
  757|  36.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), temp2);
  758|  36.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), temp4);
  759|  36.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), temp6);
  760|  36.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), temp8);
  761|       |
  762|  36.4k|        }
  763|  18.2k|    }
  764|  81.3k|    else if(nt == 16)
  ------------------
  |  Branch (764:13): [True: 36.8k, False: 44.4k]
  ------------------
  765|  36.8k|    {
  766|   184k|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (766:22): [True: 147k, False: 36.8k]
  ------------------
  767|   147k|        {
  768|   147k|            temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 0)]);
  769|   147k|            temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 0)]);
  770|       |
  771|   147k|            temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 1)]);
  772|   147k|            temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 1)]);
  773|       |
  774|   147k|            temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 2)]);
  775|   147k|            temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 2)]);
  776|       |
  777|   147k|            temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 3)]);
  778|   147k|            temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 3)]);
  779|       |
  780|   147k|            temp2 = _mm_unpacklo_epi8(temp1, temp2);
  781|   147k|            temp4 = _mm_unpacklo_epi8(temp3, temp4);
  782|   147k|            temp6 = _mm_unpacklo_epi8(temp5, temp6);
  783|   147k|            temp8 = _mm_unpacklo_epi8(temp7, temp8);
  784|       |
  785|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd) + 0), temp2);
  786|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd) + 16), temp2);
  787|       |
  788|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + 0), temp4);
  789|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + 16), temp4);
  790|       |
  791|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + 0), temp6);
  792|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + 16), temp6);
  793|       |
  794|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + 0), temp8);
  795|   147k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + 16), temp8);
  796|       |
  797|       |
  798|   147k|        }
  799|  36.8k|    }
  800|  44.4k|    else if(nt == 32)
  ------------------
  |  Branch (800:13): [True: 0, False: 44.4k]
  ------------------
  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|  44.4k|    else
  828|  44.4k|    {
  829|  44.4k|        temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 0]);
  830|  44.4k|        temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 0]);
  831|       |
  832|  44.4k|        temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 1]);
  833|  44.4k|        temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 1]);
  834|       |
  835|  44.4k|        temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 2]);
  836|  44.4k|        temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 2]);
  837|       |
  838|  44.4k|        temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 3]);
  839|  44.4k|        temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 3]);
  840|       |
  841|  44.4k|        temp2 = _mm_unpacklo_epi8(temp1, temp2);
  842|  44.4k|        temp4 = _mm_unpacklo_epi8(temp3, temp4);
  843|  44.4k|        temp6 = _mm_unpacklo_epi8(temp5, temp6);
  844|  44.4k|        temp8 = _mm_unpacklo_epi8(temp7, temp8);
  845|       |
  846|  44.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), temp2);
  847|  44.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), temp4);
  848|  44.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), temp6);
  849|  44.4k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), temp8);
  850|  44.4k|    }
  851|  99.5k|}
ihevc_intra_pred_chroma_ver_ssse3:
  897|   196k|{
  898|   196k|    WORD32 row;
  899|   196k|    __m128i src_temp1;
  900|   196k|    UNUSED(src_strd);
  ------------------
  |  |   38|   196k|#define UNUSED(x) ((void)(x))
  ------------------
  901|   196k|    UNUSED(mode);
  ------------------
  |  |   38|   196k|#define UNUSED(x) ((void)(x))
  ------------------
  902|       |
  903|       |    /* Replication to next columns*/
  904|   196k|    if(nt == 8)
  ------------------
  |  Branch (904:8): [True: 63.8k, False: 132k]
  ------------------
  905|  63.8k|    {
  906|  63.8k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  907|       |
  908|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), src_temp1);
  909|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
  910|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp1);
  911|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp1);
  912|       |
  913|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp1);
  914|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp1);
  915|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp1);
  916|  63.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp1);
  917|       |
  918|  63.8k|    }
  919|   196k|    if(nt == 16)
  ------------------
  |  Branch (919:8): [True: 63.0k, False: 132k]
  ------------------
  920|  63.0k|    {
  921|  63.0k|        __m128i temp1, temp2;
  922|       |
  923|  63.0k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  924|  63.0k|        temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 16));
  925|       |
  926|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  927|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), temp1);
  928|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), temp1);
  929|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), temp1);
  930|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), temp1);
  931|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), temp1);
  932|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), temp1);
  933|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), temp1);
  934|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), temp1);
  935|       |
  936|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((0) * dst_strd)), temp2);
  937|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((1) * dst_strd)), temp2);
  938|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((2) * dst_strd)), temp2);
  939|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((3) * dst_strd)), temp2);
  940|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((4) * dst_strd)), temp2);
  941|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((5) * dst_strd)), temp2);
  942|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((6) * dst_strd)), temp2);
  943|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((7) * dst_strd)), temp2);
  944|       |
  945|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), temp1);
  946|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), temp1);
  947|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), temp1);
  948|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), temp1);
  949|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), temp1);
  950|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), temp1);
  951|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), temp1);
  952|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), temp1);
  953|       |
  954|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((8) * dst_strd)), temp2);
  955|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((9) * dst_strd)), temp2);
  956|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((10) * dst_strd)), temp2);
  957|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((11) * dst_strd)), temp2);
  958|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((12) * dst_strd)), temp2);
  959|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((13) * dst_strd)), temp2);
  960|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((14) * dst_strd)), temp2);
  961|  63.0k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((15) * dst_strd)), temp2);
  962|       |
  963|  63.0k|    }
  964|   196k|    if(nt == 32)
  ------------------
  |  Branch (964:8): [True: 0, False: 196k]
  ------------------
  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|   196k|    else
  981|   196k|    {
  982|   196k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  983|       |
  984|   196k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  985|   196k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  986|   196k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  987|   196k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  988|       |
  989|       |
  990|   196k|    }
  991|       |
  992|   196k|}
ihevc_intra_pred_chroma_mode2_ssse3:
 1037|   164k|{
 1038|   164k|    WORD32 row, col;
 1039|       |
 1040|       |
 1041|   164k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8, sm2, sm3;
 1042|   164k|    UNUSED(src_strd);
  ------------------
  |  |   38|   164k|#define UNUSED(x) ((void)(x))
  ------------------
 1043|   164k|    UNUSED(mode);
  ------------------
  |  |   38|   164k|#define UNUSED(x) ((void)(x))
  ------------------
 1044|       |
 1045|   164k|    sm2 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY7[0]);
 1046|   164k|    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|   164k|    if(nt == 4)
  ------------------
  |  Branch (1051:8): [True: 64.0k, False: 100k]
  ------------------
 1052|  64.0k|    {
 1053|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1054|  64.0k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 0 - 8 - 2));
 1055|  64.0k|        src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 1 - 8 - 2));
 1056|  64.0k|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 2 - 8 - 2));
 1057|  64.0k|        src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 3 - 8 - 2));
 1058|       |
 1059|  64.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), _mm_shuffle_epi8(src_temp1, sm2));
 1060|  64.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), _mm_shuffle_epi8(src_temp2, sm2));
 1061|  64.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), _mm_shuffle_epi8(src_temp3, sm2));
 1062|  64.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), _mm_shuffle_epi8(src_temp4, sm2));
 1063|       |
 1064|  64.0k|    }
 1065|   100k|    else if(nt == 8)
  ------------------
  |  Branch (1065:13): [True: 33.6k, False: 66.4k]
  ------------------
 1066|  33.6k|    {
 1067|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1068|  33.6k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 0 - 16 - 2));
 1069|  33.6k|        src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 1 - 16 - 2));
 1070|  33.6k|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 2 - 16 - 2));
 1071|  33.6k|        src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 3 - 16 - 2));
 1072|  33.6k|        src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 4 - 16 - 2));
 1073|  33.6k|        src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 5 - 16 - 2));
 1074|  33.6k|        src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 6 - 16 - 2));
 1075|  33.6k|        src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 7 - 16 - 2));
 1076|       |
 1077|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), _mm_shuffle_epi8(src_temp1, sm3));
 1078|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), _mm_shuffle_epi8(src_temp2, sm3));
 1079|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), _mm_shuffle_epi8(src_temp3, sm3));
 1080|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), _mm_shuffle_epi8(src_temp4, sm3));
 1081|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), _mm_shuffle_epi8(src_temp5, sm3));
 1082|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), _mm_shuffle_epi8(src_temp6, sm3));
 1083|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), _mm_shuffle_epi8(src_temp7, sm3));
 1084|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), _mm_shuffle_epi8(src_temp8, sm3));
 1085|       |
 1086|       |
 1087|  33.6k|    }
 1088|  66.4k|    else
 1089|  66.4k|    {
 1090|   199k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1090:22): [True: 132k, False: 66.4k]
  ------------------
 1091|   132k|        {
 1092|   398k|            for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1092:26): [True: 265k, False: 132k]
  ------------------
 1093|   265k|            {   /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1094|   265k|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 0) - (col + 16) - 2));
 1095|   265k|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 1) - (col + 16) - 2));
 1096|   265k|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 2) - (col + 16) - 2));
 1097|   265k|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 3) - (col + 16) - 2));
 1098|   265k|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 4) - (col + 16) - 2));
 1099|   265k|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 5) - (col + 16) - 2));
 1100|   265k|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 6) - (col + 16) - 2));
 1101|   265k|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 7) - (col + 16) - 2));
 1102|       |
 1103|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 0) * dst_strd)), _mm_shuffle_epi8(src_temp1, sm3));
 1104|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 1) * dst_strd)), _mm_shuffle_epi8(src_temp2, sm3));
 1105|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 2) * dst_strd)), _mm_shuffle_epi8(src_temp3, sm3));
 1106|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 3) * dst_strd)), _mm_shuffle_epi8(src_temp4, sm3));
 1107|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 4) * dst_strd)), _mm_shuffle_epi8(src_temp5, sm3));
 1108|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 5) * dst_strd)), _mm_shuffle_epi8(src_temp6, sm3));
 1109|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 6) * dst_strd)), _mm_shuffle_epi8(src_temp7, sm3));
 1110|   265k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 7) * dst_strd)), _mm_shuffle_epi8(src_temp8, sm3));
 1111|   265k|            }
 1112|   132k|        }
 1113|  66.4k|    }
 1114|   164k|}
ihevc_intra_pred_chroma_mode_18_34_ssse3:
 1159|  97.8k|{
 1160|  97.8k|    WORD32 row, col;
 1161|  97.8k|    WORD32 idx = 0;
 1162|       |
 1163|  97.8k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8;
 1164|  97.8k|    UNUSED(src_strd);
  ------------------
  |  |   38|  97.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1165|       |
 1166|  97.8k|    if(mode == 34)
  ------------------
  |  Branch (1166:8): [True: 67.3k, False: 30.5k]
  ------------------
 1167|  67.3k|    {
 1168|  67.3k|        if(nt == 4)
  ------------------
  |  Branch (1168:12): [True: 40.2k, False: 27.0k]
  ------------------
 1169|  40.2k|        {
 1170|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1171|  40.2k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1172|  40.2k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1173|  40.2k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1174|  40.2k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1175|       |
 1176|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1177|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1178|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1179|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1180|       |
 1181|  40.2k|        }
 1182|  27.0k|        else if(nt == 8)
  ------------------
  |  Branch (1182:17): [True: 11.1k, False: 15.9k]
  ------------------
 1183|  11.1k|        {
 1184|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1185|  11.1k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1186|  11.1k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1187|  11.1k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1188|  11.1k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1189|  11.1k|            src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) + (4 * nt) + 2 * idx + 2));
 1190|  11.1k|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) + (4 * nt) + 2 * idx + 2));
 1191|  11.1k|            src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) + (4 * nt) + 2 * idx + 2));
 1192|  11.1k|            src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) + (4 * nt) + 2 * idx + 2));
 1193|       |
 1194|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1195|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1196|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1197|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1198|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp5);
 1199|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp6);
 1200|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp7);
 1201|  11.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp8);
 1202|       |
 1203|       |
 1204|  11.1k|        }
 1205|  15.9k|        else if(nt == 16)
  ------------------
  |  Branch (1205:17): [True: 15.9k, False: 18.4E]
  ------------------
 1206|  15.9k|        {
 1207|  15.9k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 1208|  47.9k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1208:26): [True: 31.9k, False: 15.9k]
  ------------------
 1209|  31.9k|            {
 1210|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 1211|  31.9k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1212|  31.9k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1213|  31.9k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1214|  31.9k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1215|  31.9k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1216|  31.9k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1217|  31.9k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1218|  31.9k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1219|       |
 1220|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
 1221|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
 1222|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
 1223|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
 1224|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
 1225|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
 1226|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
 1227|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
 1228|       |
 1229|  31.9k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1230|  31.9k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1231|  31.9k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1232|  31.9k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1233|  31.9k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1234|  31.9k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1235|  31.9k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1236|  31.9k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1237|       |
 1238|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 1239|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 1240|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 1241|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 1242|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 1243|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 1244|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 1245|  31.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 1246|       |
 1247|  31.9k|                pu1_ref += 2 * 8;
 1248|  31.9k|                pu1_dst += 8 * dst_strd;
 1249|  31.9k|            }
 1250|  15.9k|        }
 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|  67.3k|    }
 1281|  30.5k|    else
 1282|  30.5k|    {
 1283|  30.5k|        if(nt == 4)
  ------------------
  |  Branch (1283:12): [True: 7.59k, False: 22.9k]
  ------------------
 1284|  7.59k|        {
 1285|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1286|  7.59k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1287|  7.59k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1288|  7.59k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1289|  7.59k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1290|       |
 1291|  7.59k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1292|  7.59k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1293|  7.59k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1294|  7.59k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1295|       |
 1296|       |
 1297|  7.59k|        }
 1298|  22.9k|        else if(nt == 8)
  ------------------
  |  Branch (1298:17): [True: 6.43k, False: 16.4k]
  ------------------
 1299|  6.43k|        {
 1300|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1301|  6.43k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1302|  6.43k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1303|  6.43k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1304|  6.43k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1305|  6.43k|            src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) + (4 * nt) + 2 * idx + 2));
 1306|  6.43k|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) + (4 * nt) + 2 * idx + 2));
 1307|  6.43k|            src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) + (4 * nt) + 2 * idx + 2));
 1308|  6.43k|            src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) + (4 * nt) + 2 * idx + 2));
 1309|       |
 1310|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1311|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1312|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1313|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1314|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp5);
 1315|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp6);
 1316|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp7);
 1317|  6.43k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp8);
 1318|       |
 1319|       |
 1320|  6.43k|        }
 1321|  16.4k|        else if(nt == 16)
  ------------------
  |  Branch (1321:17): [True: 16.5k, False: 18.4E]
  ------------------
 1322|  16.5k|        {
 1323|  16.5k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 1324|  49.5k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1324:26): [True: 33.0k, False: 16.5k]
  ------------------
 1325|  33.0k|            {
 1326|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 1327|  33.0k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1328|  33.0k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1329|  33.0k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1330|  33.0k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1331|  33.0k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1332|  33.0k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1333|  33.0k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1334|  33.0k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1335|       |
 1336|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
 1337|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
 1338|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
 1339|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
 1340|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
 1341|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
 1342|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
 1343|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
 1344|       |
 1345|  33.0k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1346|  33.0k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1347|  33.0k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1348|  33.0k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1349|  33.0k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1350|  33.0k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1351|  33.0k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1352|  33.0k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1353|       |
 1354|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 1355|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 1356|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 1357|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 1358|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 1359|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 1360|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 1361|  33.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 1362|       |
 1363|  33.0k|                pu1_ref -= 2 * 8;
 1364|  33.0k|                pu1_dst += 8 * dst_strd;
 1365|  33.0k|            }
 1366|  16.5k|        }
 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|  30.5k|    }
 1397|       |
 1398|  97.8k|}
ihevc_intra_pred_chroma_mode_3_to_9_ssse3:
 1443|   240k|{
 1444|   240k|    WORD32 row, col;
 1445|       |
 1446|   240k|    WORD32 intra_pred_ang;
 1447|       |
 1448|   240k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1449|   240k|    __m128i fract_4x32b, zero_8x16b, intra_pred_ang_4x32b;
 1450|   240k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b, sm1;
 1451|   240k|    UNUSED(src_strd);
  ------------------
  |  |   38|   240k|#define UNUSED(x) ((void)(x))
  ------------------
 1452|       |
 1453|       |    /* Intra Pred Angle according to the mode */
 1454|   240k|    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|   240k|    sm1 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY7[0]);
 1460|   240k|    const_temp_4x32b  = _mm_set1_epi16(16);
 1461|   240k|    const_temp2_4x32b = _mm_set1_epi32(31);
 1462|   240k|    const_temp3_4x32b = _mm_set1_epi16(32);
 1463|   240k|    const_temp4_4x32b = _mm_set1_epi32(4);
 1464|       |
 1465|   240k|    two_nt_4x32b = _mm_set1_epi32(1);
 1466|       |
 1467|   240k|    zero_8x16b = _mm_set1_epi16(0);
 1468|       |
 1469|       |
 1470|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 1471|   240k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 1472|       |
 1473|   240k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 1474|       |
 1475|   240k|    if(nt == 4)
  ------------------
  |  Branch (1475:8): [True: 52.7k, False: 187k]
  ------------------
 1476|  52.7k|    {
 1477|  52.7k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1478|  52.7k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1479|  52.7k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1480|  52.7k|        const_temp4_4x32b = _mm_set1_epi16(4);
 1481|  52.7k|        two_nt_4x32b = _mm_set1_epi16((4 * nt) - 2);
 1482|       |
 1483|  52.7k|        {
 1484|  52.7k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1485|  52.7k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1486|       |
 1487|  52.7k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1488|  52.7k|            __m128i src_values10;
 1489|       |
 1490|  52.7k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1491|       |
 1492|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1493|  52.7k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1494|       |
 1495|       |            /* fract = pos & (31); */
 1496|  52.7k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1497|       |
 1498|  52.7k|            ref_main_idx_4x32b = _mm_srai_epi16(res_temp5_4x32b,  5);
 1499|       |
 1500|  52.7k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b,  ref_main_idx_4x32b);
 1501|       |
 1502|  52.7k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, ref_main_idx_4x32b);
 1503|       |
 1504|  52.7k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1505|       |
 1506|       |            /*(32 - fract) */
 1507|  52.7k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1508|       |
 1509|  52.7k|            _mm_storel_epi64((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1510|  52.7k|            _mm_storel_epi64((__m128i *)(ai1_src_temp_val),  src_values10);
 1511|       |
 1512|  52.7k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1513|  52.7k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1514|  52.7k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1515|  52.7k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1516|       |
 1517|  52.7k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1518|  52.7k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1519|  52.7k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1520|  52.7k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1521|       |
 1522|  52.7k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1523|  52.7k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1524|  52.7k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1525|  52.7k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1526|       |
 1527|  52.7k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1528|  52.7k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1529|  52.7k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1530|  52.7k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1531|       |
 1532|  52.7k|            {
 1533|  52.7k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1534|  52.7k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1535|       |
 1536|       |                /* loding 8-bit 16 pixels */
 1537|  52.7k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - 8)); /* col=0*/
 1538|  52.7k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - 8)); /* col=1*/
 1539|  52.7k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - 8)); /* col=2*/
 1540|  52.7k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - 8)); /* col=3*/
 1541|       |
 1542|  52.7k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1543|  52.7k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1544|  52.7k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1545|  52.7k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1546|       |
 1547|  52.7k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp1_8x16b, src_temp5_8x16b); /* col=0*/
 1548|  52.7k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp2_8x16b, src_temp6_8x16b); /* col=1*/
 1549|  52.7k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp3_8x16b, src_temp7_8x16b); /* col=2*/
 1550|  52.7k|                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|  52.7k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1554|  52.7k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1555|  52.7k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1556|  52.7k|                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|  52.7k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1560|  52.7k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1561|  52.7k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1562|  52.7k|                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|  52.7k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1566|  52.7k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1567|  52.7k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1568|  52.7k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1569|       |
 1570|       |                /* converting 16 bit to 8 bit */
 1571|  52.7k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1572|  52.7k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1573|  52.7k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1574|  52.7k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1575|       |
 1576|  52.7k|                src_temp1_8x16b = _mm_shuffle_epi8(src_temp1_8x16b, sm1);
 1577|  52.7k|                src_temp2_8x16b = _mm_shuffle_epi8(src_temp2_8x16b, sm1);
 1578|  52.7k|                src_temp3_8x16b = _mm_shuffle_epi8(src_temp3_8x16b, sm1);
 1579|  52.7k|                src_temp4_8x16b = _mm_shuffle_epi8(src_temp4_8x16b, sm1);
 1580|       |
 1581|  52.7k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1582|  52.7k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1583|       |
 1584|  52.7k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1585|  52.7k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1586|       |
 1587|  52.7k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp8_8x16b);             /* row=0*/
 1588|       |
 1589|  52.7k|                src_temp2_8x16b  = _mm_shuffle_epi32(src_temp8_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1590|  52.7k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp2_8x16b);       /* row=1*/
 1591|       |
 1592|  52.7k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp7_8x16b);       /* row=2*/
 1593|       |
 1594|  52.7k|                src_temp4_8x16b  = _mm_shuffle_epi32(src_temp7_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1595|  52.7k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp4_8x16b);       /* row=4*/
 1596|       |
 1597|  52.7k|            }
 1598|  52.7k|        }
 1599|  52.7k|    }
 1600|   187k|    else
 1601|   187k|    {
 1602|   187k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1603|   187k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1604|   187k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1605|   187k|        const_temp4_4x32b = _mm_set1_epi16(8);
 1606|   187k|        two_nt_4x32b = _mm_set1_epi16((4 * nt) - 2);
 1607|       |
 1608|   523k|        for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1608:22): [True: 335k, False: 187k]
  ------------------
 1609|   335k|        {
 1610|   335k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1611|   335k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 1612|   335k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1613|       |
 1614|   335k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1615|   335k|            __m128i fract5_8x16b, fract6_8x16b, fract7_8x16b, fract8_8x16b, src_values10;
 1616|       |
 1617|   335k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1618|   335k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 1619|       |
 1620|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1621|   335k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1622|       |
 1623|       |            /* fract = pos & (31); */
 1624|   335k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1625|       |
 1626|   335k|            ref_main_idx_4x32b = _mm_srai_epi16(res_temp5_4x32b,  5);
 1627|       |
 1628|   335k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b,  ref_main_idx_4x32b);
 1629|       |
 1630|   335k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, ref_main_idx_4x32b);
 1631|       |
 1632|   335k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1633|       |
 1634|       |            /*(32 - fract) */
 1635|   335k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1636|       |
 1637|   335k|            _mm_storeu_si128((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1638|   335k|            _mm_storeu_si128((__m128i *)(ai1_src_temp_val),  src_values10);
 1639|       |
 1640|   335k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1641|   335k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1642|   335k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1643|   335k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1644|       |
 1645|   335k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1646|   335k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1647|   335k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1648|   335k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1649|       |
 1650|   335k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1651|   335k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1652|   335k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1653|   335k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1654|       |
 1655|   335k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1656|   335k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1657|   335k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1658|   335k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1659|       |
 1660|   335k|            fract5_8x16b = _mm_set1_epi8(ai1_fract_temp_val[8]);  /* col=5*/
 1661|   335k|            fract6_8x16b = _mm_set1_epi8(ai1_fract_temp_val[10]);  /* col=6*/
 1662|   335k|            fract7_8x16b = _mm_set1_epi8(ai1_fract_temp_val[12]);  /* col=7*/
 1663|   335k|            fract8_8x16b = _mm_set1_epi8(ai1_fract_temp_val[14]);  /* col=8*/
 1664|       |
 1665|   335k|            temp11_8x16b = _mm_set1_epi8(ai1_src_temp_val[8]);  /* col=0*/
 1666|   335k|            temp12_8x16b = _mm_set1_epi8(ai1_src_temp_val[10]);  /* col=1*/
 1667|   335k|            temp13_8x16b = _mm_set1_epi8(ai1_src_temp_val[12]);  /* col=2*/
 1668|   335k|            temp14_8x16b = _mm_set1_epi8(ai1_src_temp_val[14]);  /* col=3*/
 1669|       |
 1670|   335k|            temp11_8x16b = _mm_unpacklo_epi8(temp11_8x16b, fract5_8x16b);
 1671|   335k|            temp12_8x16b = _mm_unpacklo_epi8(temp12_8x16b, fract6_8x16b);
 1672|   335k|            temp13_8x16b = _mm_unpacklo_epi8(temp13_8x16b, fract7_8x16b);
 1673|   335k|            temp14_8x16b = _mm_unpacklo_epi8(temp14_8x16b, fract8_8x16b);
 1674|       |
 1675|   335k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 1676|   335k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 1677|   335k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 1678|   335k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 1679|       |
 1680|  1.59M|            for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (1680:26): [True: 1.26M, False: 335k]
  ------------------
 1681|  1.26M|            {
 1682|  1.26M|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1683|  1.26M|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1684|       |
 1685|  1.26M|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 1686|  1.26M|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 1687|       |
 1688|       |                /* loding 8-bit 16 pixels */
 1689|  1.26M|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - row - (8 + row))); /* col=0*/
 1690|  1.26M|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - row - (8 + row))); /* col=1*/
 1691|  1.26M|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - row - (8 + row))); /* col=2*/
 1692|  1.26M|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - row - (8 + row))); /* col=3*/
 1693|       |
 1694|  1.26M|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1695|  1.26M|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1696|  1.26M|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1697|  1.26M|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1698|       |
 1699|  1.26M|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp1_8x16b, src_temp5_8x16b); /* col=0*/
 1700|  1.26M|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp2_8x16b, src_temp6_8x16b); /* col=1*/
 1701|  1.26M|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp3_8x16b, src_temp7_8x16b); /* col=2*/
 1702|  1.26M|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp4_8x16b, src_temp8_8x16b); /* col=3*/
 1703|       |
 1704|       |                /* loding 8-bit 16 pixels */
 1705|  1.26M|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx5 - row - row - 8)); /* col=5*/
 1706|  1.26M|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx6 - row - row - 8)); /* col=6*/
 1707|  1.26M|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx7 - row - row - 8)); /* col=7*/
 1708|  1.26M|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx8 - row - row - 8)); /* col=8*/
 1709|       |
 1710|  1.26M|                src_temp11_8x16b = _mm_srli_si128(src_temp15_8x16b, 2); /* col=5*/
 1711|  1.26M|                src_temp12_8x16b = _mm_srli_si128(src_temp16_8x16b, 2); /* col=6*/
 1712|  1.26M|                src_temp13_8x16b = _mm_srli_si128(src_temp17_8x16b, 2); /* col=7*/
 1713|  1.26M|                src_temp14_8x16b = _mm_srli_si128(src_temp18_8x16b, 2); /* col=8*/
 1714|       |
 1715|  1.26M|                src_temp11_8x16b =  _mm_unpacklo_epi8(src_temp11_8x16b, src_temp15_8x16b); /* col=0*/
 1716|  1.26M|                src_temp12_8x16b =  _mm_unpacklo_epi8(src_temp12_8x16b, src_temp16_8x16b); /* col=1*/
 1717|  1.26M|                src_temp13_8x16b =  _mm_unpacklo_epi8(src_temp13_8x16b, src_temp17_8x16b); /* col=2*/
 1718|  1.26M|                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.26M|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1722|  1.26M|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1723|  1.26M|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1724|  1.26M|                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.26M|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 1728|  1.26M|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 1729|  1.26M|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 1730|  1.26M|                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.26M|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1734|  1.26M|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1735|  1.26M|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1736|  1.26M|                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.26M|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1740|  1.26M|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1741|  1.26M|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1742|  1.26M|                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.26M|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 1746|  1.26M|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 1747|  1.26M|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 1748|  1.26M|                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.26M|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 1752|  1.26M|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 1753|  1.26M|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 1754|  1.26M|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 1755|       |
 1756|       |                /* converting 16 bit to 8 bit */
 1757|  1.26M|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1758|  1.26M|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1759|  1.26M|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1760|  1.26M|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1761|       |
 1762|  1.26M|                src_temp1_8x16b = _mm_shuffle_epi8(src_temp1_8x16b, sm1);
 1763|  1.26M|                src_temp2_8x16b = _mm_shuffle_epi8(src_temp2_8x16b, sm1);
 1764|  1.26M|                src_temp3_8x16b = _mm_shuffle_epi8(src_temp3_8x16b, sm1);
 1765|  1.26M|                src_temp4_8x16b = _mm_shuffle_epi8(src_temp4_8x16b, sm1);
 1766|       |
 1767|       |                /* converting 16 bit to 8 bit */
 1768|  1.26M|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, zero_8x16b); /* col=5*/
 1769|  1.26M|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, zero_8x16b); /* col=6*/
 1770|  1.26M|                src_temp13_8x16b = _mm_packus_epi16(src_temp13_8x16b, zero_8x16b); /* col=7*/
 1771|  1.26M|                src_temp14_8x16b = _mm_packus_epi16(src_temp14_8x16b, zero_8x16b); /* col=8*/
 1772|       |
 1773|  1.26M|                src_temp11_8x16b = _mm_shuffle_epi8(src_temp11_8x16b, sm1);
 1774|  1.26M|                src_temp12_8x16b = _mm_shuffle_epi8(src_temp12_8x16b, sm1);
 1775|  1.26M|                src_temp13_8x16b = _mm_shuffle_epi8(src_temp13_8x16b, sm1);
 1776|  1.26M|                src_temp14_8x16b = _mm_shuffle_epi8(src_temp14_8x16b, sm1);
 1777|       |
 1778|  1.26M|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1779|  1.26M|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1780|       |
 1781|  1.26M|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1782|  1.26M|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1783|       |
 1784|  1.26M|                src_temp15_8x16b = _mm_unpacklo_epi16(src_temp11_8x16b, src_temp12_8x16b);
 1785|  1.26M|                src_temp16_8x16b = _mm_unpacklo_epi16(src_temp13_8x16b, src_temp14_8x16b);
 1786|       |
 1787|  1.26M|                src_temp18_8x16b = _mm_unpacklo_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1788|  1.26M|                src_temp17_8x16b = _mm_unpackhi_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1789|       |
 1790|  1.26M|                src_temp11_8x16b = _mm_unpacklo_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1791|  1.26M|                src_temp12_8x16b = _mm_unpackhi_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1792|  1.26M|                src_temp13_8x16b = _mm_unpacklo_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1793|  1.26M|                src_temp14_8x16b = _mm_unpackhi_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1794|       |
 1795|  1.26M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * row)),    src_temp11_8x16b);          /* row=0*/
 1796|  1.26M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp12_8x16b);       /* row=1*/
 1797|  1.26M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp13_8x16b);       /* row=2*/
 1798|  1.26M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp14_8x16b);       /* row=4*/
 1799|       |
 1800|  1.26M|            }
 1801|   335k|        }
 1802|   187k|    }
 1803|   240k|}
ihevc_intra_pred_chroma_mode_11_to_17_ssse3:
 1849|   206k|{
 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|   206k|    WORD32 row, col, k;
 1855|   206k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1856|   206k|    WORD32 ref_idx;
 1857|       |
 1858|       |
 1859|   206k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1860|   206k|    __m128i fract_4x32b, zero_8x16b, intra_pred_ang_4x32b;
 1861|   206k|    __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|   206k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 2 + 4];
 1865|   206k|    UWORD8 *ref_main;
 1866|   206k|    UNUSED(src_strd);
  ------------------
  |  |   38|   206k|#define UNUSED(x) ((void)(x))
  ------------------
 1867|       |
 1868|   206k|    inv_ang_sum = 128;
 1869|       |
 1870|   206k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1871|       |
 1872|   206k|    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|   206k|    ref_main = ref_temp + 2 * nt;
 1880|  2.75M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1880:16): [True: 2.54M, False: 206k]
  ------------------
 1881|  2.54M|    {
 1882|  2.54M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k];
 1883|  2.54M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k + 1];
 1884|  2.54M|    }
 1885|       |
 1886|   206k|    ref_main = ref_temp + (2 * (nt - 1));
 1887|   206k|    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.09M|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1893:17): [True: 892k, False: 206k]
  ------------------
 1894|   892k|    {
 1895|   892k|        inv_ang_sum += inv_ang;
 1896|   892k|        ref_main[k] = pu1_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1897|   892k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1898|   892k|    }
 1899|       |
 1900|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1901|       |    /* samples dependent on distance to obtain destination sample */
 1902|       |
 1903|   206k|    const_temp_4x32b  = _mm_set1_epi16(16);
 1904|   206k|    const_temp2_4x32b = _mm_set1_epi32(31);
 1905|   206k|    const_temp3_4x32b = _mm_set1_epi16(32);
 1906|   206k|    const_temp4_4x32b = _mm_set1_epi32(4);
 1907|       |
 1908|   206k|    two_nt_4x32b = _mm_set1_epi32(1);
 1909|       |
 1910|   206k|    zero_8x16b = _mm_set1_epi16(0);
 1911|       |
 1912|       |
 1913|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 1914|   206k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 1915|       |
 1916|   206k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 1917|       |
 1918|   206k|    if(nt == 4)
  ------------------
  |  Branch (1918:8): [True: 54.8k, False: 151k]
  ------------------
 1919|  54.8k|    {
 1920|  54.8k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1921|  54.8k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1922|  54.8k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1923|  54.8k|        const_temp4_4x32b = _mm_set1_epi16(4);
 1924|  54.8k|        two_nt_4x32b = _mm_set1_epi16(1);
 1925|       |
 1926|  54.8k|        {
 1927|  54.8k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1928|  54.8k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1929|       |
 1930|  54.8k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1931|  54.8k|            __m128i src_values10;
 1932|       |
 1933|  54.8k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1934|       |
 1935|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1936|  54.8k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1937|       |
 1938|       |            /* fract = pos & (31); */
 1939|  54.8k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1940|       |
 1941|  54.8k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 1942|  54.8k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b, ref_main_idx_4x32b);
 1943|       |
 1944|  54.8k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1945|       |
 1946|       |            /*(32 - fract) */
 1947|  54.8k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1948|       |
 1949|  54.8k|            _mm_storel_epi64((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1950|  54.8k|            _mm_storel_epi64((__m128i *)(ai1_src_temp_val),  src_values10);
 1951|       |
 1952|  54.8k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1953|  54.8k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1954|  54.8k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1955|  54.8k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1956|       |
 1957|  54.8k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1958|  54.8k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1959|  54.8k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1960|  54.8k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1961|       |
 1962|  54.8k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1963|  54.8k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1964|  54.8k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1965|  54.8k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1966|       |
 1967|  54.8k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1968|  54.8k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1969|  54.8k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1970|  54.8k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1971|       |
 1972|  54.8k|            {
 1973|  54.8k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1974|  54.8k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1975|       |
 1976|       |                /* loding 8-bit 16 pixels */
 1977|  54.8k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1)); /* col=0*/
 1978|  54.8k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2)); /* col=1*/
 1979|  54.8k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3)); /* col=2*/
 1980|  54.8k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4)); /* col=3*/
 1981|       |
 1982|  54.8k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1983|  54.8k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1984|  54.8k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1985|  54.8k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1986|       |
 1987|  54.8k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp5_8x16b, src_temp1_8x16b); /* col=0*/
 1988|  54.8k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp6_8x16b, src_temp2_8x16b); /* col=1*/
 1989|  54.8k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp7_8x16b, src_temp3_8x16b); /* col=2*/
 1990|  54.8k|                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|  54.8k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1994|  54.8k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1995|  54.8k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1996|  54.8k|                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|  54.8k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2000|  54.8k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2001|  54.8k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2002|  54.8k|                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|  54.8k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2006|  54.8k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2007|  54.8k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2008|  54.8k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2009|       |
 2010|       |                /* converting 16 bit to 8 bit */
 2011|  54.8k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 2012|  54.8k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 2013|  54.8k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 2014|  54.8k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 2015|       |
 2016|  54.8k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 2017|  54.8k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 2018|       |
 2019|  54.8k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2020|  54.8k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2021|       |
 2022|  54.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp8_8x16b);             /* row=0*/
 2023|       |
 2024|  54.8k|                src_temp2_8x16b  = _mm_shuffle_epi32(src_temp8_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 2025|  54.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp2_8x16b);       /* row=1*/
 2026|       |
 2027|  54.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp7_8x16b);       /* row=2*/
 2028|       |
 2029|  54.8k|                src_temp4_8x16b  = _mm_shuffle_epi32(src_temp7_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 2030|  54.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp4_8x16b);       /* row=4*/
 2031|       |
 2032|  54.8k|            }
 2033|  54.8k|        }
 2034|  54.8k|    }
 2035|   151k|    else
 2036|   151k|    {
 2037|   151k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2038|   151k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2039|   151k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2040|   151k|        const_temp4_4x32b = _mm_set1_epi16(8);
 2041|   151k|        two_nt_4x32b = _mm_set1_epi16(1);
 2042|       |
 2043|   416k|        for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (2043:22): [True: 265k, False: 151k]
  ------------------
 2044|   265k|        {
 2045|   265k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 2046|   265k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 2047|   265k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 2048|       |
 2049|   265k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 2050|   265k|            __m128i fract5_8x16b, fract6_8x16b, fract7_8x16b, fract8_8x16b, src_values10;
 2051|       |
 2052|   265k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2053|   265k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 2054|       |
 2055|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2056|   265k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2057|       |
 2058|       |            /* fract = pos & (31); */
 2059|   265k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2060|       |
 2061|   265k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2062|   265k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b, ref_main_idx_4x32b);
 2063|       |
 2064|   265k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 2065|       |
 2066|       |            /*(32 - fract) */
 2067|   265k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 2068|       |
 2069|   265k|            _mm_storeu_si128((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 2070|   265k|            _mm_storeu_si128((__m128i *)(ai1_src_temp_val),  src_values10);
 2071|       |
 2072|   265k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 2073|   265k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 2074|   265k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 2075|   265k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 2076|       |
 2077|   265k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 2078|   265k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 2079|   265k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 2080|   265k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 2081|       |
 2082|   265k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2083|   265k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2084|   265k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2085|   265k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2086|       |
 2087|   265k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 2088|   265k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 2089|   265k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 2090|   265k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 2091|       |
 2092|   265k|            fract5_8x16b = _mm_set1_epi8(ai1_fract_temp_val[8]);  /* col=5*/
 2093|   265k|            fract6_8x16b = _mm_set1_epi8(ai1_fract_temp_val[10]);  /* col=6*/
 2094|   265k|            fract7_8x16b = _mm_set1_epi8(ai1_fract_temp_val[12]);  /* col=7*/
 2095|   265k|            fract8_8x16b = _mm_set1_epi8(ai1_fract_temp_val[14]);  /* col=8*/
 2096|       |
 2097|   265k|            temp11_8x16b = _mm_set1_epi8(ai1_src_temp_val[8]);  /* col=0*/
 2098|   265k|            temp12_8x16b = _mm_set1_epi8(ai1_src_temp_val[10]);  /* col=1*/
 2099|   265k|            temp13_8x16b = _mm_set1_epi8(ai1_src_temp_val[12]);  /* col=2*/
 2100|   265k|            temp14_8x16b = _mm_set1_epi8(ai1_src_temp_val[14]);  /* col=3*/
 2101|       |
 2102|   265k|            temp11_8x16b = _mm_unpacklo_epi8(temp11_8x16b, fract5_8x16b);
 2103|   265k|            temp12_8x16b = _mm_unpacklo_epi8(temp12_8x16b, fract6_8x16b);
 2104|   265k|            temp13_8x16b = _mm_unpacklo_epi8(temp13_8x16b, fract7_8x16b);
 2105|   265k|            temp14_8x16b = _mm_unpacklo_epi8(temp14_8x16b, fract8_8x16b);
 2106|       |
 2107|   265k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 2108|   265k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 2109|   265k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 2110|   265k|            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: 982k, False: 265k]
  ------------------
 2113|   982k|            {
 2114|   982k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2115|   982k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2116|       |
 2117|   982k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 2118|   982k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 2119|       |
 2120|       |                /* loding 8-bit 16 pixels */
 2121|   982k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1 + row + row)); /* col=0*/
 2122|   982k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2 + row + row)); /* col=1*/
 2123|   982k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3 + row + row)); /* col=2*/
 2124|   982k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4 + row + row)); /* col=3*/
 2125|       |
 2126|   982k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 2127|   982k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 2128|   982k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 2129|   982k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 2130|       |
 2131|   982k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp5_8x16b, src_temp1_8x16b); /* col=0*/
 2132|   982k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp6_8x16b, src_temp2_8x16b); /* col=1*/
 2133|   982k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp7_8x16b, src_temp3_8x16b); /* col=2*/
 2134|   982k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp8_8x16b, src_temp4_8x16b); /* col=3*/
 2135|       |
 2136|       |                /* loding 8-bit 16 pixels */
 2137|   982k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5 + row + row)); /* col=5*/
 2138|   982k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6 + row + row)); /* col=6*/
 2139|   982k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7 + row + row)); /* col=7*/
 2140|   982k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8 + row + row)); /* col=8*/
 2141|       |
 2142|   982k|                src_temp11_8x16b = _mm_srli_si128(src_temp15_8x16b, 2); /* col=5*/
 2143|   982k|                src_temp12_8x16b = _mm_srli_si128(src_temp16_8x16b, 2); /* col=6*/
 2144|   982k|                src_temp13_8x16b = _mm_srli_si128(src_temp17_8x16b, 2); /* col=7*/
 2145|   982k|                src_temp14_8x16b = _mm_srli_si128(src_temp18_8x16b, 2); /* col=8*/
 2146|       |
 2147|   982k|                src_temp11_8x16b =  _mm_unpacklo_epi8(src_temp15_8x16b, src_temp11_8x16b); /* col=0*/
 2148|   982k|                src_temp12_8x16b =  _mm_unpacklo_epi8(src_temp16_8x16b, src_temp12_8x16b); /* col=1*/
 2149|   982k|                src_temp13_8x16b =  _mm_unpacklo_epi8(src_temp17_8x16b, src_temp13_8x16b); /* col=2*/
 2150|   982k|                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|   982k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2154|   982k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2155|   982k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2156|   982k|                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|   982k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 2160|   982k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 2161|   982k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 2162|   982k|                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|   982k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2166|   982k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2167|   982k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2168|   982k|                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|   982k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2172|   982k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2173|   982k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2174|   982k|                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|   982k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 2178|   982k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 2179|   982k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 2180|   982k|                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|   982k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 2184|   982k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 2185|   982k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 2186|   982k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 2187|       |
 2188|       |                /* converting 16 bit to 8 bit */
 2189|   982k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 2190|   982k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 2191|   982k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 2192|   982k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 2193|       |
 2194|       |                /* converting 16 bit to 8 bit */
 2195|   982k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, zero_8x16b); /* col=5*/
 2196|   982k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, zero_8x16b); /* col=6*/
 2197|   982k|                src_temp13_8x16b = _mm_packus_epi16(src_temp13_8x16b, zero_8x16b); /* col=7*/
 2198|   982k|                src_temp14_8x16b = _mm_packus_epi16(src_temp14_8x16b, zero_8x16b); /* col=8*/
 2199|       |
 2200|   982k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 2201|   982k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 2202|       |
 2203|   982k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2204|   982k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2205|       |
 2206|   982k|                src_temp15_8x16b = _mm_unpacklo_epi16(src_temp11_8x16b, src_temp12_8x16b);
 2207|   982k|                src_temp16_8x16b = _mm_unpacklo_epi16(src_temp13_8x16b, src_temp14_8x16b);
 2208|       |
 2209|   982k|                src_temp18_8x16b = _mm_unpacklo_epi32(src_temp15_8x16b, src_temp16_8x16b);
 2210|   982k|                src_temp17_8x16b = _mm_unpackhi_epi32(src_temp15_8x16b, src_temp16_8x16b);
 2211|       |
 2212|   982k|                src_temp11_8x16b = _mm_unpacklo_epi64(src_temp8_8x16b, src_temp18_8x16b);
 2213|   982k|                src_temp12_8x16b = _mm_unpackhi_epi64(src_temp8_8x16b, src_temp18_8x16b);
 2214|   982k|                src_temp13_8x16b = _mm_unpacklo_epi64(src_temp7_8x16b, src_temp17_8x16b);
 2215|   982k|                src_temp14_8x16b = _mm_unpackhi_epi64(src_temp7_8x16b, src_temp17_8x16b);
 2216|       |
 2217|   982k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * row)),    src_temp11_8x16b);          /* row=0*/
 2218|   982k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp12_8x16b);       /* row=1*/
 2219|   982k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp13_8x16b);       /* row=2*/
 2220|   982k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp14_8x16b);       /* row=4*/
 2221|       |
 2222|   982k|            }
 2223|   265k|        }
 2224|   151k|    }
 2225|   206k|}
ihevc_intra_pred_chroma_mode_19_to_25_ssse3:
 2270|   233k|{
 2271|   233k|    WORD32 row, k;
 2272|   233k|    WORD32 intra_pred_ang, idx;
 2273|   233k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 2274|   233k|    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|   233k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 2 + 4];
 2277|   233k|    UWORD8 *ref_main;
 2278|       |
 2279|   233k|    __m128i zero_8x16b, fract_8x16b, const_temp_8x16b;
 2280|   233k|    UNUSED(src_strd);
  ------------------
  |  |   38|   233k|#define UNUSED(x) ((void)(x))
  ------------------
 2281|       |
 2282|   233k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 2283|   233k|    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|   233k|    ref_main = ref_temp + 2 * nt;
 2289|  2.69M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (2289:16): [True: 2.46M, False: 233k]
  ------------------
 2290|  2.46M|    {
 2291|  2.46M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k];
 2292|  2.46M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k + 1];
 2293|  2.46M|    }
 2294|       |
 2295|   233k|    ref_idx = (nt * intra_pred_ang) >> 5;
 2296|   233k|    inv_ang_sum = 128;
 2297|   233k|    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|   994k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (2301:17): [True: 760k, False: 233k]
  ------------------
 2302|   760k|    {
 2303|   760k|        inv_ang_sum += inv_ang;
 2304|   760k|        ref_main[k] = pu1_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 2305|   760k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 2306|   760k|    }
 2307|       |
 2308|   233k|    const_temp_8x16b = _mm_set1_epi16(16);
 2309|       |
 2310|   233k|    if(nt == 4) /* if nt =4*/
  ------------------
  |  Branch (2310:8): [True: 90.1k, False: 143k]
  ------------------
 2311|  90.1k|    {
 2312|  90.1k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 2313|  90.1k|        __m128i src_values10, src_values11, zero_8x16b, intra_pred_ang_4x32b;
 2314|  90.1k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 2315|       |
 2316|       |
 2317|  90.1k|        const_temp2_4x32b = _mm_set1_epi32(31);
 2318|  90.1k|        const_temp3_4x32b = _mm_set1_epi32(32);
 2319|       |
 2320|  90.1k|        two_nt_4x32b = _mm_set1_epi32(2);
 2321|       |
 2322|  90.1k|        zero_8x16b = _mm_set1_epi16(0);
 2323|       |
 2324|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2325|  90.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2326|       |
 2327|  90.1k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2328|  90.1k|        {
 2329|  90.1k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2330|  90.1k|            WORD8  ai1_src_temp0_val[16], ai1_src_temp1_val[16];
 2331|       |
 2332|  90.1k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b, res_temp5_4x32b;
 2333|  90.1k|            __m128i src_values0, src_values1, src_values2, src_values3, src_values13;
 2334|  90.1k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2335|  90.1k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2, sign_8x16b;
 2336|       |
 2337|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2338|  90.1k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2339|  90.1k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2340|  90.1k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2341|       |
 2342|  90.1k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2343|  90.1k|            src_values12 = _mm_add_epi32(src_values12, _mm_srai_epi32(res_temp5_4x32b,  5));
 2344|       |
 2345|  90.1k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 2346|  90.1k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 2347|  90.1k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 2348|  90.1k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 2349|  90.1k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 2350|  90.1k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 2351|  90.1k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 2352|       |
 2353|       |            /* fract = pos & (31); */
 2354|  90.1k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2355|       |
 2356|       |            /*(32 - fract) */
 2357|  90.1k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 2358|       |
 2359|  90.1k|            _mm_storeu_si128((__m128i *)(ai1_src_temp1_val), src_values11);
 2360|  90.1k|            _mm_storeu_si128((__m128i *)(ai1_src_temp0_val), src_values10);
 2361|       |
 2362|  90.1k|            fract1_8x16b = _mm_set1_epi8(ai1_src_temp1_val[0]);  /* row=0*/
 2363|  90.1k|            fract2_8x16b = _mm_set1_epi8(ai1_src_temp1_val[4]);  /* row=1*/
 2364|  90.1k|            fract3_8x16b = _mm_set1_epi8(ai1_src_temp1_val[8]);  /* row=2*/
 2365|  90.1k|            fract4_8x16b = _mm_set1_epi8(ai1_src_temp1_val[12]);  /* row=3*/
 2366|       |
 2367|  90.1k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp0_val[0]);  /* row=0*/
 2368|  90.1k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp0_val[4]);  /* row=1*/
 2369|  90.1k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp0_val[8]);  /* row=2*/
 2370|  90.1k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp0_val[12]);  /* row=3*/
 2371|       |
 2372|  90.1k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2373|  90.1k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2374|  90.1k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2375|  90.1k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2376|       |
 2377|       |// inner loop starts from here
 2378|  90.1k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));  /* col = 0-7   */
 2379|  90.1k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx2));  /* col = 8-15  */
 2380|  90.1k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx3));  /* col = 16-23 */
 2381|  90.1k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx4));  /* col = 24-31 */
 2382|       |
 2383|  90.1k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2384|  90.1k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2385|  90.1k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2386|  90.1k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2387|       |
 2388|  90.1k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2389|  90.1k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2390|  90.1k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2391|  90.1k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2392|       |
 2393|  90.1k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1_8x16b);
 2394|  90.1k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2_8x16b);
 2395|  90.1k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3_8x16b);
 2396|  90.1k|            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|  90.1k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2400|  90.1k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2401|  90.1k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2402|  90.1k|            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|  90.1k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2406|  90.1k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2407|  90.1k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2408|  90.1k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2409|       |
 2410|       |            /* converting 16 bit to 8 bit */
 2411|  90.1k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2412|  90.1k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2413|  90.1k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2414|  90.1k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2415|       |
 2416|  90.1k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_values0);       /* row=0*/
 2417|  90.1k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_values1);   /* row=1*/
 2418|  90.1k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_values2);   /* row=2*/
 2419|  90.1k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_values3);   /* row=3*/
 2420|       |
 2421|  90.1k|        }
 2422|  90.1k|    }
 2423|   143k|    else if(nt == 8) /* for nt = 16 case */
  ------------------
  |  Branch (2423:13): [True: 52.7k, False: 90.4k]
  ------------------
 2424|  52.7k|    {
 2425|  52.7k|        WORD32 ref_main_idx1, fract1, temp, temp1;
 2426|  52.7k|        __m128i fract1_8x16b, temp_8x16b, temp1_8x16b;
 2427|       |
 2428|  52.7k|        zero_8x16b = _mm_set1_epi16(0);
 2429|       |
 2430|   263k|        for(row = 0; row < nt; row += 2)
  ------------------
  |  Branch (2430:22): [True: 211k, False: 52.7k]
  ------------------
 2431|   211k|        {
 2432|   211k|            __m128i src_values0, src_values1, src_values2, src_values3;
 2433|   211k|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2434|       |
 2435|   211k|            pos = ((row + 1) * intra_pred_ang);
 2436|   211k|            idx = pos >> 5;
 2437|   211k|            fract = pos & (31);
 2438|   211k|            temp = 32 - fract;
 2439|   211k|            ref_main_idx = 2 * idx + 2; /* col from 0-15 */
 2440|       |
 2441|   211k|            pos = ((row + 2) * intra_pred_ang);
 2442|   211k|            idx = pos >> 5;
 2443|   211k|            fract1 = pos & (31);
 2444|   211k|            temp1 = 32 - fract1;
 2445|   211k|            ref_main_idx1 = 2 * idx + 2; /* col from 0-15 */
 2446|       |
 2447|   211k|            fract_8x16b  = _mm_set1_epi8(fract);
 2448|   211k|            fract1_8x16b = _mm_set1_epi8(fract1);
 2449|   211k|            temp_8x16b   = _mm_set1_epi8(temp);
 2450|   211k|            temp1_8x16b  = _mm_set1_epi8(temp1);
 2451|       |
 2452|   211k|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2453|   211k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2454|       |
 2455|       |            /* row=0 */
 2456|   211k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx));     /* col = 0-7   */
 2457|   211k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 8));   /* col = 8-15  */
 2458|       |
 2459|       |            /* row=1 */
 2460|   211k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));   /* col = 0-7  */
 2461|   211k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1 + 8));  /* col = 8-15 */
 2462|       |
 2463|   211k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2464|   211k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2465|   211k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2466|   211k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2467|       |
 2468|   211k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2469|   211k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2470|   211k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2471|   211k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2472|       |
 2473|   211k|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2474|   211k|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2475|       |
 2476|   211k|            src_values2 = _mm_maddubs_epi16(src_values2, temp1_8x16b);
 2477|   211k|            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|   211k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2481|   211k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2482|       |
 2483|   211k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2484|   211k|            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|   211k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2488|   211k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2489|       |
 2490|   211k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2491|   211k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2492|       |
 2493|       |            /* converting 16 bit to 8 bit */
 2494|   211k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2495|   211k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2496|       |
 2497|   211k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2498|   211k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2499|       |
 2500|       |            /* loding 8-bit 8 pixels values */
 2501|   211k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2502|   211k|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2503|       |
 2504|   211k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), src_values2);
 2505|   211k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + 8), src_values3);
 2506|       |
 2507|   211k|            pu1_dst += 2 * dst_strd;
 2508|   211k|        }
 2509|  52.7k|    }
 2510|  90.4k|    else if(nt == 16)
  ------------------
  |  Branch (2510:13): [True: 90.9k, False: 18.4E]
  ------------------
 2511|  90.9k|    {
 2512|  90.9k|        WORD32 temp;
 2513|       |        /* unroll the col loop (inner) */
 2514|  90.9k|        zero_8x16b = _mm_set1_epi16(0);
 2515|       |
 2516|  1.54M|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2516:22): [True: 1.45M, False: 90.9k]
  ------------------
 2517|  1.45M|        {
 2518|  1.45M|            __m128i  src_values0, src_values1, src_values2, src_values3, temp_8x16b;
 2519|  1.45M|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2520|       |
 2521|  1.45M|            pos = ((row + 1) * intra_pred_ang);
 2522|  1.45M|            idx = pos >> 5;
 2523|  1.45M|            fract = pos & (31);
 2524|  1.45M|            temp = 32 - fract;
 2525|  1.45M|            ref_main_idx = 2 * idx + 2; /* col from 0-31 */
 2526|       |
 2527|  1.45M|            fract_8x16b = _mm_set1_epi8(fract);
 2528|  1.45M|            temp_8x16b  = _mm_set1_epi8(temp);
 2529|       |
 2530|  1.45M|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2531|       |
 2532|  1.45M|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx));     /* col = 0-7   */
 2533|  1.45M|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 8));   /* col = 8-15  */
 2534|  1.45M|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 16));  /* col = 16-23 */
 2535|  1.45M|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 24));  /* col = 24-31 */
 2536|       |
 2537|  1.45M|            src_values10 = _mm_srli_si128(src_values0, 2);
 2538|  1.45M|            src_values11 = _mm_srli_si128(src_values1, 2);
 2539|  1.45M|            src_values12 = _mm_srli_si128(src_values2, 2);
 2540|  1.45M|            src_values13 = _mm_srli_si128(src_values3, 2);
 2541|       |
 2542|  1.45M|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2543|  1.45M|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2544|  1.45M|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2545|  1.45M|            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.45M|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2549|  1.45M|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2550|  1.45M|            src_values2 = _mm_maddubs_epi16(src_values2, temp_8x16b);
 2551|  1.45M|            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.45M|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2555|  1.45M|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2556|  1.45M|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2557|  1.45M|            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.45M|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2561|  1.45M|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2562|  1.45M|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2563|  1.45M|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2564|       |
 2565|       |            /* converting 16 bit to 8 bit */
 2566|  1.45M|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2567|  1.45M|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2568|  1.45M|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2569|  1.45M|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2570|       |
 2571|       |            /* loding 8-bit 8 pixels values */
 2572|  1.45M|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2573|  1.45M|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2574|  1.45M|            _mm_storel_epi64((__m128i *)(pu1_dst + 16), src_values2);
 2575|  1.45M|            _mm_storel_epi64((__m128i *)(pu1_dst + 24), src_values3);
 2576|       |
 2577|  1.45M|            pu1_dst += dst_strd;
 2578|       |
 2579|  1.45M|        }
 2580|  90.9k|    }
 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|   233k|}
ihevc_intra_pred_chroma_mode_27_to_33_ssse3:
 2683|   238k|{
 2684|   238k|    WORD32 row;
 2685|   238k|    WORD32 pos, fract;
 2686|   238k|    WORD32 intra_pred_ang;
 2687|   238k|    WORD32 idx, ref_main_idx;
 2688|       |
 2689|   238k|    __m128i zero_8x16b, fract_8x16b, const_temp_8x16b;
 2690|   238k|    UNUSED(src_strd);
  ------------------
  |  |   38|   238k|#define UNUSED(x) ((void)(x))
  ------------------
 2691|       |
 2692|   238k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 2693|   238k|    const_temp_8x16b = _mm_set1_epi16(16);
 2694|       |
 2695|   238k|    if(nt == 4) /* if nt =4*/
  ------------------
  |  Branch (2695:8): [True: 83.3k, False: 154k]
  ------------------
 2696|  83.3k|    {
 2697|  83.3k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 2698|  83.3k|        __m128i src_values10, src_values11, zero_8x16b, intra_pred_ang_4x32b;
 2699|  83.3k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 2700|       |
 2701|  83.3k|        const_temp2_4x32b = _mm_set1_epi32(31);
 2702|  83.3k|        const_temp3_4x32b = _mm_set1_epi32(32);
 2703|       |
 2704|  83.3k|        two_nt_4x32b = _mm_set1_epi32((4 * nt) + 2);
 2705|       |
 2706|  83.3k|        zero_8x16b = _mm_set1_epi16(0);
 2707|       |
 2708|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2709|  83.3k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2710|  83.3k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2711|       |
 2712|  83.3k|        {
 2713|  83.3k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2714|  83.3k|            WORD8  ai1_src_temp0_val[16], ai1_src_temp1_val[16];
 2715|       |
 2716|  83.3k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b, res_temp5_4x32b;
 2717|  83.3k|            __m128i src_values0, src_values1, src_values2, src_values3, src_values13;
 2718|  83.3k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2719|  83.3k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2, sign_8x16b;
 2720|       |
 2721|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2722|  83.3k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2723|  83.3k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2724|  83.3k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2725|       |
 2726|  83.3k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2727|  83.3k|            src_values12 = _mm_add_epi32(src_values12, _mm_srai_epi32(res_temp5_4x32b,  5));
 2728|       |
 2729|  83.3k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 2730|  83.3k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 2731|  83.3k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 2732|  83.3k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 2733|  83.3k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 2734|  83.3k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 2735|  83.3k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 2736|       |
 2737|       |            /* fract = pos & (31); */
 2738|  83.3k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2739|       |
 2740|       |            /*(32 - fract) */
 2741|  83.3k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 2742|       |
 2743|  83.3k|            _mm_storeu_si128((__m128i *)(ai1_src_temp1_val), src_values11);
 2744|  83.3k|            _mm_storeu_si128((__m128i *)(ai1_src_temp0_val), src_values10);
 2745|       |
 2746|  83.3k|            fract1_8x16b = _mm_set1_epi8(ai1_src_temp1_val[0]);  /* row=0*/
 2747|  83.3k|            fract2_8x16b = _mm_set1_epi8(ai1_src_temp1_val[4]);  /* row=1*/
 2748|  83.3k|            fract3_8x16b = _mm_set1_epi8(ai1_src_temp1_val[8]);  /* row=2*/
 2749|  83.3k|            fract4_8x16b = _mm_set1_epi8(ai1_src_temp1_val[12]);  /* row=3*/
 2750|       |
 2751|  83.3k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp0_val[0]);  /* row=0*/
 2752|  83.3k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp0_val[4]);  /* row=1*/
 2753|  83.3k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp0_val[8]);  /* row=2*/
 2754|  83.3k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp0_val[12]);  /* row=3*/
 2755|       |
 2756|  83.3k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2757|  83.3k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2758|  83.3k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2759|  83.3k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2760|       |
 2761|       |// inner loop starts from here
 2762|  83.3k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));  /* col = 0-7   */
 2763|  83.3k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx2));  /* col = 8-15  */
 2764|  83.3k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx3));  /* col = 16-23 */
 2765|  83.3k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx4));  /* col = 24-31 */
 2766|       |
 2767|  83.3k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2768|  83.3k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2769|  83.3k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2770|  83.3k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2771|       |
 2772|  83.3k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2773|  83.3k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2774|  83.3k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2775|  83.3k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2776|       |
 2777|  83.3k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1_8x16b);
 2778|  83.3k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2_8x16b);
 2779|  83.3k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3_8x16b);
 2780|  83.3k|            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|  83.3k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2784|  83.3k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2785|  83.3k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2786|  83.3k|            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|  83.3k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2790|  83.3k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2791|  83.3k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2792|  83.3k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2793|       |
 2794|       |            /* converting 16 bit to 8 bit */
 2795|  83.3k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2796|  83.3k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2797|  83.3k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2798|  83.3k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2799|       |
 2800|  83.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_values0);       /* row=0*/
 2801|  83.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_values1);   /* row=1*/
 2802|  83.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_values2);   /* row=2*/
 2803|  83.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_values3);   /* row=3*/
 2804|       |
 2805|  83.3k|        }
 2806|  83.3k|    }
 2807|       |
 2808|   154k|    else if(nt == 8) /* for nt = 16 case */
  ------------------
  |  Branch (2808:13): [True: 51.7k, False: 103k]
  ------------------
 2809|  51.7k|    {
 2810|  51.7k|        WORD32 ref_main_idx1, fract1, temp, temp1;
 2811|  51.7k|        __m128i fract1_8x16b, temp_8x16b, temp1_8x16b;
 2812|       |
 2813|  51.7k|        zero_8x16b = _mm_set1_epi16(0);
 2814|       |
 2815|   258k|        for(row = 0; row < nt; row += 2)
  ------------------
  |  Branch (2815:22): [True: 206k, False: 51.7k]
  ------------------
 2816|   206k|        {
 2817|   206k|            __m128i src_values0, src_values1, src_values2, src_values3;
 2818|   206k|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2819|       |
 2820|   206k|            pos = ((row + 1) * intra_pred_ang);
 2821|   206k|            idx = pos >> 5;
 2822|   206k|            fract = pos & (31);
 2823|   206k|            temp = 32 - fract;
 2824|   206k|            ref_main_idx = (4 * nt) + 2 * idx + 2; /* col from 0-15 */
 2825|       |
 2826|   206k|            pos = ((row + 2) * intra_pred_ang);
 2827|   206k|            idx = pos >> 5;
 2828|   206k|            fract1 = pos & (31);
 2829|   206k|            temp1 = 32 - fract1;
 2830|   206k|            ref_main_idx1 = (4 * nt) + 2 * idx + 2; /* col from 0-15 */
 2831|       |
 2832|   206k|            fract_8x16b  = _mm_set1_epi8(fract);
 2833|   206k|            fract1_8x16b = _mm_set1_epi8(fract1);
 2834|   206k|            temp_8x16b   = _mm_set1_epi8(temp);
 2835|   206k|            temp1_8x16b  = _mm_set1_epi8(temp1);
 2836|       |
 2837|   206k|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2838|   206k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2839|       |
 2840|       |            /* row=0 */
 2841|   206k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx));     /* col = 0-7   */
 2842|   206k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 8));   /* col = 8-15  */
 2843|       |
 2844|       |            /* row=1 */
 2845|   206k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));    /* col = 0-7  */
 2846|   206k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1 + 8));  /* col = 8-15 */
 2847|       |
 2848|   206k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2849|   206k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2850|   206k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2851|   206k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2852|       |
 2853|   206k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2854|   206k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2855|   206k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2856|   206k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2857|       |
 2858|   206k|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2859|   206k|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2860|       |
 2861|   206k|            src_values2 = _mm_maddubs_epi16(src_values2, temp1_8x16b);
 2862|   206k|            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|   206k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2866|   206k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2867|       |
 2868|   206k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2869|   206k|            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|   206k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2873|   206k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2874|       |
 2875|   206k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2876|   206k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2877|       |
 2878|       |            /* converting 16 bit to 8 bit */
 2879|   206k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2880|   206k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2881|       |
 2882|   206k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2883|   206k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2884|       |
 2885|       |            /* loding 8-bit 8 pixels values */
 2886|   206k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2887|   206k|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2888|       |
 2889|   206k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), src_values2);
 2890|   206k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + 8), src_values3);
 2891|       |
 2892|   206k|            pu1_dst += 2 * dst_strd;
 2893|   206k|        }
 2894|  51.7k|    }
 2895|   103k|    else if(nt == 16)
  ------------------
  |  Branch (2895:13): [True: 103k, False: 18.4E]
  ------------------
 2896|   103k|    {
 2897|   103k|        WORD32 temp;
 2898|       |        /* unroll the col loop (inner) */
 2899|   103k|        zero_8x16b = _mm_set1_epi16(0);
 2900|       |
 2901|  1.75M|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2901:22): [True: 1.65M, False: 103k]
  ------------------
 2902|  1.65M|        {
 2903|  1.65M|            __m128i  src_values0, src_values1, src_values2, src_values3, temp_8x16b;
 2904|  1.65M|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2905|       |
 2906|  1.65M|            pos = ((row + 1) * intra_pred_ang);
 2907|  1.65M|            idx = pos >> 5;
 2908|  1.65M|            fract = pos & (31);
 2909|  1.65M|            temp = 32 - fract;
 2910|  1.65M|            ref_main_idx = (4 * nt) + 2 * idx + 2; /* col from 0-31 */
 2911|       |
 2912|  1.65M|            fract_8x16b = _mm_set1_epi8(fract);
 2913|  1.65M|            temp_8x16b  = _mm_set1_epi8(temp);
 2914|       |
 2915|  1.65M|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2916|       |
 2917|  1.65M|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx));     /* col = 0-7   */
 2918|  1.65M|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 8));   /* col = 8-15  */
 2919|  1.65M|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 16));  /* col = 16-23 */
 2920|  1.65M|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 24));  /* col = 24-31 */
 2921|       |
 2922|  1.65M|            src_values10 = _mm_srli_si128(src_values0, 2);
 2923|  1.65M|            src_values11 = _mm_srli_si128(src_values1, 2);
 2924|  1.65M|            src_values12 = _mm_srli_si128(src_values2, 2);
 2925|  1.65M|            src_values13 = _mm_srli_si128(src_values3, 2);
 2926|       |
 2927|  1.65M|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2928|  1.65M|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2929|  1.65M|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2930|  1.65M|            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.65M|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2934|  1.65M|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2935|  1.65M|            src_values2 = _mm_maddubs_epi16(src_values2, temp_8x16b);
 2936|  1.65M|            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.65M|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2940|  1.65M|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2941|  1.65M|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2942|  1.65M|            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.65M|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2946|  1.65M|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2947|  1.65M|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2948|  1.65M|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2949|       |
 2950|       |            /* converting 16 bit to 8 bit */
 2951|  1.65M|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2952|  1.65M|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2953|  1.65M|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2954|  1.65M|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2955|       |
 2956|       |            /* loding 8-bit 8 pixels values */
 2957|  1.65M|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2958|  1.65M|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2959|  1.65M|            _mm_storel_epi64((__m128i *)(pu1_dst + 16), src_values2);
 2960|  1.65M|            _mm_storel_epi64((__m128i *)(pu1_dst + 24), src_values3);
 2961|       |
 2962|  1.65M|            pu1_dst += dst_strd;
 2963|       |
 2964|  1.65M|        }
 2965|   103k|    }
 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|   238k|}

ihevc_deblk_luma_vert_ssse3:
  110|  66.0M|{
  111|  66.0M|    WORD32 qp_luma, beta_indx, tc_indx;
  112|  66.0M|    WORD32 beta, tc;
  113|  66.0M|    WORD32 d, dp, dq, d_sam0, d_sam3;
  114|       |
  115|  66.0M|    WORD32 d3, d0, de_0, de_1, de_2, de_3;
  116|  66.0M|    WORD32 de, dep, deq;
  117|  66.0M|    __m128i src_row0_8x16b, src_row1_8x16b, src_row2_8x16b, src_row3_8x16b;
  118|       |
  119|       |
  120|  66.0M|    {
  121|  66.0M|        __m128i src_tmp_8x16b, coef_8x16b, mask_d_result_4x32b, mask_de_result_8x16b;
  122|  66.0M|        __m128i mask_16x8b, temp_coef0_8x16b, temp_coef1_8x16b;
  123|       |
  124|       |
  125|       |
  126|  66.0M|        ASSERT((bs > 0) && (bs <= 3));
  ------------------
  |  |   55|  66.0M|#define ASSERT(x) {}
  ------------------
  127|  66.0M|        ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  66.0M|#define ASSERT(x) {}
  ------------------
  128|       |
  129|  66.0M|        qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  130|  66.0M|        beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  66.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 52.8k, False: 65.9M]
  |  |  |  Branch (40:53): [True: 3.97k, False: 65.9M]
  |  |  ------------------
  ------------------
  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|  66.0M|        tc_indx = CLIP3(qp_luma + (2 * (bs >> 1)) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  66.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.33k, False: 66.0M]
  |  |  |  Branch (40:53): [True: 4.83k, False: 66.0M]
  |  |  ------------------
  ------------------
  138|       |
  139|  66.0M|        beta = gai4_ihevc_beta_table[beta_indx];
  140|  66.0M|        tc = gai4_ihevc_tc_table[tc_indx];
  141|  66.0M|        if(0 == tc)
  ------------------
  |  Branch (141:12): [True: 1.82M, False: 64.1M]
  ------------------
  142|  1.82M|        {
  143|  1.82M|            return;
  144|  1.82M|        }
  145|  64.1M|        src_row0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 4));
  146|  64.1M|        src_row3_8x16b = _mm_loadl_epi64((__m128i *)((pu1_src - 4) + 3 * src_strd));
  147|       |
  148|  64.1M|        coef_8x16b = _mm_load_si128((__m128i *)(coef_d));
  149|  64.1M|        mask_16x8b =  _mm_load_si128((__m128i *)(shuffle_d));
  150|       |
  151|  64.1M|        src_tmp_8x16b = _mm_unpacklo_epi64(src_row0_8x16b, src_row3_8x16b);
  152|  64.1M|        mask_de_result_8x16b = _mm_shuffle_epi8(src_tmp_8x16b, mask_16x8b);
  153|       |
  154|  64.1M|        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|  64.1M|        temp_coef0_8x16b = _mm_cmpeq_epi16(src_tmp_8x16b, src_tmp_8x16b);
  159|  64.1M|        temp_coef1_8x16b = _mm_srli_epi16(temp_coef0_8x16b, 15);
  160|       |        //accumulating values foe dp3 dq3 , dp0 dq0 values
  161|  64.1M|        mask_d_result_4x32b = _mm_madd_epi16(mask_d_result_4x32b, temp_coef1_8x16b);
  162|       |
  163|  64.1M|        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|  64.1M|        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|  64.1M|        mask_de_result_8x16b = _mm_maddubs_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  168|       |        //to get 16 bit 1's
  169|  64.1M|        temp_coef0_8x16b = _mm_srli_epi16(temp_coef1_8x16b, 8);
  170|       |
  171|       |
  172|       |        // dq3 dp3 dq0 dp0
  173|  64.1M|        mask_d_result_4x32b = _mm_abs_epi32(mask_d_result_4x32b);
  174|  64.1M|        mask_16x8b = _mm_shuffle_epi32(mask_d_result_4x32b, 0xec);
  175|  64.1M|        mask_d_result_4x32b = _mm_shuffle_epi32(mask_d_result_4x32b, 0x49);
  176|       |        // dq dp d3 d0
  177|  64.1M|        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|  64.1M|        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|  64.1M|        mask_de_result_8x16b = _mm_madd_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  182|       |
  183|       |        ///store back in a single variable
  184|  64.1M|        temp_coef0_8x16b = _mm_srli_si128(mask_d_result_4x32b, 4);
  185|  64.1M|        temp_coef1_8x16b = _mm_srli_si128(mask_d_result_4x32b, 8);
  186|  64.1M|        mask_16x8b = _mm_srli_si128(mask_d_result_4x32b, 12);
  187|       |
  188|  64.1M|        d0 = _mm_cvtsi128_si32(mask_d_result_4x32b);
  189|  64.1M|        d3 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  190|  64.1M|        dp = _mm_cvtsi128_si32(temp_coef1_8x16b);
  191|  64.1M|        dq = _mm_cvtsi128_si32(mask_16x8b);
  192|       |        //getting d
  193|  64.1M|        d = d0 + d3;
  194|       |
  195|       |        ///store back in a single variable
  196|  64.1M|        temp_coef0_8x16b = _mm_srli_si128(mask_de_result_8x16b, 4);
  197|  64.1M|        temp_coef1_8x16b = _mm_srli_si128(mask_de_result_8x16b, 8);
  198|  64.1M|        mask_16x8b = _mm_srli_si128(mask_de_result_8x16b, 12);
  199|       |
  200|  64.1M|        de_0 = _mm_cvtsi128_si32(mask_de_result_8x16b);
  201|  64.1M|        de_1 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  202|  64.1M|        de_2 = _mm_cvtsi128_si32(temp_coef1_8x16b);
  203|  64.1M|        de_3 = _mm_cvtsi128_si32(mask_16x8b);
  204|       |
  205|  64.1M|        de = 0;
  206|  64.1M|        dep = 0;
  207|  64.1M|        deq = 0;
  208|  64.1M|        if(d < beta)
  ------------------
  |  Branch (208:12): [True: 62.5M, False: 1.64M]
  ------------------
  209|  62.5M|        {
  210|  62.5M|            d_sam0 = 0;
  211|  62.5M|            if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (211:16): [True: 60.8M, False: 1.74M]
  ------------------
  212|  60.8M|                            && (de_2 < (beta >> 3))
  ------------------
  |  Branch (212:32): [True: 58.0M, False: 2.73M]
  ------------------
  213|  58.0M|                            && (de_0 < ((5 * tc + 1) >> 1)))
  ------------------
  |  Branch (213:32): [True: 57.6M, False: 413k]
  ------------------
  214|  57.5M|            {
  215|  57.5M|                d_sam0 = 1;
  216|  57.5M|            }
  217|       |
  218|  62.5M|            d_sam3 = 0;
  219|  62.5M|            if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (219:16): [True: 60.7M, False: 1.80M]
  ------------------
  220|  60.7M|                            && (de_3 < (beta >> 3))
  ------------------
  |  Branch (220:32): [True: 58.0M, False: 2.71M]
  ------------------
  221|  58.0M|                            && de_1 < ((5 * tc + 1) >> 1))
  ------------------
  |  Branch (221:32): [True: 57.6M, False: 366k]
  ------------------
  222|  57.6M|            {
  223|  57.6M|                d_sam3 = 1;
  224|  57.6M|            }
  225|       |
  226|  62.5M|            de = (d_sam0 & d_sam3) + 1;
  227|  62.5M|            dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (227:19): [True: 61.3M, False: 1.18M]
  ------------------
  228|  62.5M|            deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (228:19): [True: 60.9M, False: 1.58M]
  ------------------
  229|  62.5M|            if(tc <= 1)
  ------------------
  |  Branch (229:16): [True: 11.9M, False: 50.6M]
  ------------------
  230|  11.9M|            {
  231|  11.9M|                dep = 0;
  232|  11.9M|                deq = 0;
  233|  11.9M|            }
  234|  62.5M|        }
  235|       |
  236|  64.1M|    }
  237|       |
  238|  64.1M|    if(de != 0)
  ------------------
  |  Branch (238:8): [True: 62.4M, False: 1.78M]
  ------------------
  239|  62.4M|    {
  240|       |
  241|       |
  242|  62.4M|        src_row1_8x16b = _mm_loadl_epi64((__m128i *)((pu1_src - 4) + src_strd));
  243|  62.4M|        src_row2_8x16b = _mm_loadl_epi64((__m128i *)((pu1_src - 4) + 2 * src_strd));
  244|       |
  245|  62.4M|        if(de == 2)
  ------------------
  |  Branch (245:12): [True: 57.1M, False: 5.27M]
  ------------------
  246|  57.1M|        {
  247|  57.1M|            __m128i temp_pq_str0_16x8b;
  248|  57.1M|            __m128i temp_pq1_str0_16x8b, temp_pq1_str1_16x8b;
  249|  57.1M|            __m128i temp_pq2_str0_16x8b;
  250|  57.1M|            __m128i temp_pq_str1_16x8b;
  251|  57.1M|            __m128i temp_str0_16x8b, temp_str1_16x8b, temp_str2_16x8b, temp_str3_16x8b;
  252|  57.1M|            __m128i temp_max0_16x8b, temp_max1_16x8b, temp_min0_16x8b, temp_min1_16x8b;
  253|  57.1M|            __m128i const2_8x16b, const2tc_8x16b;
  254|  57.1M|            LWORD64 mask, tc2;
  255|  57.1M|            tc = tc << 1;
  256|  57.1M|            mask = (((LWORD64)filter_flag_q) << 63) | (((LWORD64)filter_flag_p) << 31);
  257|  57.1M|            tc2 = ((LWORD64)tc);
  258|       |
  259|  57.1M|            const2_8x16b = _mm_cmpeq_epi16(src_row0_8x16b, src_row0_8x16b);
  260|       |            //q'0-q'1-2 ,p'0-p'1-2
  261|  57.1M|            src_row0_8x16b = _mm_unpacklo_epi64(src_row0_8x16b, src_row2_8x16b);
  262|  57.1M|            src_row1_8x16b = _mm_unpacklo_epi64(src_row1_8x16b, src_row3_8x16b);
  263|       |
  264|  57.1M|            const2_8x16b = _mm_srli_epi16(const2_8x16b, 15);
  265|  57.1M|            temp_pq_str0_16x8b = _mm_srli_epi64(src_row0_8x16b, 16);
  266|  57.1M|            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|  57.1M|            temp_str0_16x8b = _mm_unpacklo_epi16(temp_pq_str0_16x8b, temp_pq_str1_16x8b);
  269|  57.1M|            temp_str1_16x8b = _mm_unpackhi_epi16(temp_pq_str0_16x8b, temp_pq_str1_16x8b);
  270|       |
  271|  57.1M|            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|  57.1M|            temp_pq_str0_16x8b = _mm_unpacklo_epi32(temp_str0_16x8b, temp_str1_16x8b);
  274|       |
  275|  57.1M|            temp_pq_str0_16x8b = _mm_maddubs_epi16(temp_pq_str0_16x8b, const2_8x16b);
  276|       |
  277|       |            //q'1-2, p'1-2
  278|  57.1M|            temp_pq1_str0_16x8b = _mm_srli_epi64(src_row0_8x16b, 8);
  279|  57.1M|            temp_pq1_str1_16x8b = _mm_srli_epi64(src_row1_8x16b, 8);
  280|       |
  281|  57.1M|            temp_str2_16x8b = _mm_unpacklo_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  282|  57.1M|            temp_str3_16x8b = _mm_unpackhi_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  283|       |
  284|  57.1M|            temp_str2_16x8b = _mm_shuffle_epi32(temp_str2_16x8b, 0x58);
  285|  57.1M|            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|  57.1M|            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|  57.1M|            temp_pq1_str1_16x8b = _mm_unpacklo_epi32(temp_str2_16x8b, temp_str3_16x8b);
  290|       |
  291|  57.1M|            temp_pq1_str0_16x8b = _mm_maddubs_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  292|  57.1M|            temp_pq1_str1_16x8b = _mm_maddubs_epi16(temp_pq1_str1_16x8b, const2_8x16b);
  293|       |
  294|       |            //clipping mask design
  295|  57.1M|            temp_str1_16x8b = _mm_setzero_si128();
  296|  57.1M|            temp_str0_16x8b = _mm_loadl_epi64((__m128i *)(&mask));
  297|  57.1M|            const2tc_8x16b  = _mm_loadl_epi64((__m128i *)(&tc2));
  298|  57.1M|            temp_str0_16x8b = _mm_shuffle_epi32(temp_str0_16x8b, 0x44);
  299|  57.1M|            const2tc_8x16b  = _mm_shuffle_epi8(const2tc_8x16b, temp_str1_16x8b);
  300|       |
  301|       |            //clipping mask design
  302|  57.1M|            temp_str0_16x8b = _mm_srai_epi32(temp_str0_16x8b, 31);
  303|  57.1M|            const2tc_8x16b = _mm_and_si128(const2tc_8x16b, temp_str0_16x8b);
  304|       |            //calculating Clipping MAX for all pixel values.
  305|  57.1M|            temp_max0_16x8b = _mm_adds_epu8(src_row0_8x16b, const2tc_8x16b);
  306|  57.1M|            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|  57.1M|            temp_pq2_str0_16x8b = _mm_unpacklo_epi16(src_row0_8x16b, src_row2_8x16b);
  311|  57.1M|            temp_str3_16x8b     = _mm_unpacklo_epi16(src_row1_8x16b, src_row3_8x16b);
  312|       |
  313|  57.1M|            temp_pq2_str0_16x8b = _mm_shuffle_epi32(temp_pq2_str0_16x8b, 0x5c);
  314|  57.1M|            temp_str3_16x8b     = _mm_shuffle_epi32(temp_str3_16x8b, 0x5c);
  315|       |
  316|  57.1M|            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|  57.1M|            temp_str3_16x8b = _mm_unpacklo_epi16(temp_pq2_str0_16x8b, temp_str3_16x8b);
  319|       |
  320|  57.1M|            temp_pq2_str0_16x8b = _mm_maddubs_epi16(temp_str3_16x8b, const2_8x16b);
  321|       |
  322|       |            //calculating Clipping MIN for all pixel values.
  323|  57.1M|            temp_min0_16x8b = _mm_subs_epu8(src_row0_8x16b, const2tc_8x16b);
  324|  57.1M|            temp_min1_16x8b = _mm_subs_epu8(src_row1_8x16b, const2tc_8x16b);
  325|       |            //q'0-q'1-2 ,p'0-p'1-2
  326|  57.1M|            temp_pq_str1_16x8b = _mm_shuffle_epi32(temp_pq_str0_16x8b, 0x4e);
  327|  57.1M|            temp_pq_str0_16x8b = _mm_add_epi16(temp_pq_str0_16x8b, temp_pq_str1_16x8b);
  328|       |            //q'1-2 p'1-2
  329|  57.1M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  330|       |            //to get 2 in 16 bit
  331|  57.1M|            const2_8x16b = _mm_srli_epi16(const2_8x16b, 8);
  332|       |            //to get q33 q23 q13 q03, p33 p23 p13 p03
  333|  57.1M|            temp_pq1_str1_16x8b = _mm_slli_epi16(temp_str3_16x8b, 8);
  334|  57.1M|            temp_pq_str1_16x8b = _mm_srli_epi16(temp_str3_16x8b, 8);
  335|  57.1M|            temp_pq1_str1_16x8b = _mm_srli_epi16(temp_pq1_str1_16x8b, 8);
  336|       |
  337|       |            //q'1, p'1 (adding 2)
  338|  57.1M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  339|       |            //q'0-q'1,p'0-p'1
  340|  57.1M|            temp_pq_str0_16x8b = _mm_add_epi16(temp_pq_str0_16x8b, const2_8x16b);
  341|       |            //q'2-q'1,p'2-p'1
  342|  57.1M|            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|  57.1M|            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|  57.1M|            temp_pq2_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq2_str0_16x8b);
  347|       |
  348|       |            //normalisation of all modified pixels
  349|  57.1M|            temp_pq_str0_16x8b  = _mm_srai_epi16(temp_pq_str0_16x8b, 3);
  350|  57.1M|            temp_pq1_str0_16x8b = _mm_srai_epi16(temp_pq1_str0_16x8b, 2);
  351|  57.1M|            temp_pq2_str0_16x8b = _mm_srai_epi16(temp_pq2_str0_16x8b, 3);
  352|       |
  353|       |            //getting p0 p1 together and p2 p3 together
  354|  57.1M|            temp_str0_16x8b = _mm_unpacklo_epi16(temp_pq1_str0_16x8b, temp_pq_str0_16x8b);
  355|  57.1M|            temp_str2_16x8b = _mm_unpacklo_epi16(temp_pq1_str1_16x8b, temp_pq2_str0_16x8b);
  356|       |            //getting q1 q0 together and  q3 q2 together
  357|  57.1M|            temp_pq_str0_16x8b = _mm_unpackhi_epi16(temp_pq_str0_16x8b, temp_pq1_str0_16x8b);
  358|  57.1M|            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|  57.1M|            temp_pq_str1_16x8b = _mm_unpacklo_epi32(temp_str2_16x8b, temp_str0_16x8b);
  361|  57.1M|            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|  57.1M|            temp_str0_16x8b    = _mm_unpacklo_epi32(temp_pq_str0_16x8b, temp_pq2_str0_16x8b);
  364|  57.1M|            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|  57.1M|            src_row0_8x16b = _mm_unpacklo_epi64(temp_pq_str1_16x8b, temp_str0_16x8b);
  367|  57.1M|            src_row1_8x16b = _mm_unpackhi_epi64(temp_pq_str1_16x8b, temp_str0_16x8b);
  368|  57.1M|            src_row2_8x16b = _mm_unpacklo_epi64(temp_str2_16x8b, temp_pq_str0_16x8b);
  369|  57.1M|            src_row3_8x16b = _mm_unpackhi_epi64(temp_str2_16x8b, temp_pq_str0_16x8b);
  370|       |            //packing values to 8 bit
  371|  57.1M|            src_row0_8x16b = _mm_packus_epi16(src_row0_8x16b, src_row2_8x16b);
  372|  57.1M|            src_row1_8x16b = _mm_packus_epi16(src_row1_8x16b, src_row3_8x16b);
  373|       |            //Clipping MAX
  374|  57.1M|            src_row0_8x16b = _mm_min_epu8(src_row0_8x16b, temp_max0_16x8b);
  375|  57.1M|            src_row1_8x16b = _mm_min_epu8(src_row1_8x16b, temp_max1_16x8b);
  376|       |            //Clipping MIN
  377|  57.1M|            src_row0_8x16b = _mm_max_epu8(src_row0_8x16b, temp_min0_16x8b);
  378|  57.1M|            src_row1_8x16b = _mm_max_epu8(src_row1_8x16b, temp_min1_16x8b);
  379|       |            //separating row 2 and row 3
  380|  57.1M|            src_row2_8x16b = _mm_srli_si128(src_row0_8x16b, 8);
  381|  57.1M|            src_row3_8x16b = _mm_srli_si128(src_row1_8x16b, 8);
  382|       |
  383|  57.1M|        }
  384|       |
  385|  5.27M|        else
  386|  5.27M|        {
  387|       |
  388|  5.27M|            __m128i tmp_delta0_8x16b, tmp_delta1_8x16b, tmp_delta2_8x16b, tmp_delta3_8x16b;
  389|  5.27M|            __m128i tmp0_const_8x16b, tmp1_const_8x16b, tmp2_const_8x16b, tmp3_const_8x16b;
  390|  5.27M|            __m128i coefdelta_0_8x16b, mask_pq_8x16b;
  391|  5.27M|            __m128i const2_8x16b, consttc_8x16b;
  392|       |
  393|  5.27M|            LWORD64 mask1;
  394|  5.27M|            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.27M|            consttc_8x16b = _mm_set1_epi32(tc);
  397|       |
  398|       |
  399|  5.27M|            src_row0_8x16b = _mm_unpacklo_epi64(src_row0_8x16b, src_row1_8x16b);
  400|  5.27M|            src_row2_8x16b = _mm_unpacklo_epi64(src_row2_8x16b, src_row3_8x16b);
  401|       |
  402|  5.27M|            tmp_delta2_8x16b = _mm_srli_epi64(src_row0_8x16b, 16);
  403|  5.27M|            tmp_delta3_8x16b = _mm_srli_epi64(src_row2_8x16b, 16);
  404|       |
  405|  5.27M|            tmp_delta2_8x16b = _mm_shuffle_epi32(tmp_delta2_8x16b, 0x08);
  406|  5.27M|            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.27M|            tmp_delta2_8x16b = _mm_unpacklo_epi64(tmp_delta2_8x16b, tmp_delta3_8x16b);
  409|       |
  410|  5.27M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_de1);
  411|       |            // (-3q1+9q0),(-9p0+3p1)
  412|  5.27M|            tmp_delta3_8x16b = _mm_maddubs_epi16(tmp_delta2_8x16b, coefdelta_0_8x16b);
  413|       |            //converting to 16 bit
  414|  5.27M|            consttc_8x16b = _mm_packs_epi32(consttc_8x16b, consttc_8x16b);
  415|       |            //getting -tc store
  416|  5.27M|            tmp1_const_8x16b = _mm_cmpeq_epi32(consttc_8x16b, consttc_8x16b);
  417|       |            //calc 10 *tc = 2*tc +8*tc ; 2*tc
  418|  5.27M|            tmp2_const_8x16b = _mm_slli_epi16(consttc_8x16b, 1);
  419|       |            //calc 10 *tc = 2*tc +8*tc ; 8*tc
  420|  5.27M|            tmp0_const_8x16b = _mm_slli_epi16(consttc_8x16b, 3);
  421|       |            //getting -tc store
  422|  5.27M|            tmp3_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp1_const_8x16b);
  423|       |            //calc 10 *tc
  424|  5.27M|            tmp2_const_8x16b = _mm_add_epi16(tmp2_const_8x16b, tmp0_const_8x16b);
  425|       |            //const 1
  426|  5.27M|            const2_8x16b = _mm_srli_epi16(tmp1_const_8x16b, 15);
  427|  5.27M|            tmp_delta0_8x16b = _mm_madd_epi16(tmp_delta3_8x16b, const2_8x16b);
  428|  5.27M|            const2_8x16b = _mm_srli_epi32(tmp1_const_8x16b, 31);
  429|       |            //getting the mask values
  430|  5.27M|            mask_pq_8x16b = _mm_loadl_epi64((__m128i *)(&mask1));
  431|       |            //loaded coef for delta1 calculation
  432|  5.27M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_dep1);
  433|       |            //(-2q1+q0),(p0-2p1)
  434|  5.27M|            tmp_delta3_8x16b = _mm_maddubs_epi16(tmp_delta2_8x16b, coefdelta_0_8x16b);
  435|       |            //const 8
  436|  5.27M|            const2_8x16b = _mm_slli_epi32(const2_8x16b, 3);
  437|       |            //rearranging the mask values
  438|  5.27M|            mask_pq_8x16b = _mm_unpacklo_epi64(mask_pq_8x16b, mask_pq_8x16b);
  439|       |            //normalisation of the filter
  440|  5.27M|            tmp_delta0_8x16b = _mm_add_epi32(tmp_delta0_8x16b, const2_8x16b);
  441|  5.27M|            tmp_delta0_8x16b = _mm_srai_epi32(tmp_delta0_8x16b, 4);
  442|       |
  443|       |            //getting deltaq0
  444|  5.27M|            tmp_delta2_8x16b = _mm_sign_epi32(tmp_delta0_8x16b, tmp1_const_8x16b);
  445|       |            //packing  d3q d2q d1q d0q d3p d2p d1p d0p
  446|  5.27M|            tmp_delta0_8x16b = _mm_packs_epi32(tmp_delta0_8x16b, tmp_delta2_8x16b);
  447|       |            //absolute delta
  448|  5.27M|            tmp_delta2_8x16b = _mm_abs_epi16(tmp_delta0_8x16b);
  449|       |            //Clipping of delta0
  450|  5.27M|            tmp_delta0_8x16b = _mm_min_epi16(tmp_delta0_8x16b, consttc_8x16b);
  451|       |            //mask for |delta| < 10*tc
  452|  5.27M|            tmp0_const_8x16b = _mm_cmpgt_epi16(tmp2_const_8x16b, tmp_delta2_8x16b);
  453|       |            //Clipping of delta0
  454|  5.27M|            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.27M|            tmp2_const_8x16b = _mm_loadl_epi64((__m128i *)(shuffle0));
  461|  5.27M|            tmp_delta2_8x16b = _mm_shuffle_epi8(src_row0_8x16b, tmp2_const_8x16b);
  462|  5.27M|            tmp_delta1_8x16b =  _mm_shuffle_epi8(src_row2_8x16b, tmp2_const_8x16b);
  463|  5.27M|            tmp_delta1_8x16b = _mm_unpacklo_epi32(tmp_delta2_8x16b, tmp_delta1_8x16b);
  464|       |            //constant 1
  465|  5.27M|            const2_8x16b = _mm_srli_epi16(tmp1_const_8x16b, 15);
  466|       |            //tc>>1 16 bit
  467|  5.27M|            consttc_8x16b = _mm_srai_epi16(consttc_8x16b, 1);
  468|       |
  469|       |            //getting -tc>>1 store  16 bit
  470|  5.27M|            tmp1_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp1_const_8x16b);
  471|       |            //2*delta0
  472|  5.27M|            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.27M|            tmp3_const_8x16b = _mm_load_si128((__m128i *)(shuffle1));
  476|  5.27M|            tmp_delta3_8x16b = _mm_shuffle_epi8(tmp_delta3_8x16b, tmp3_const_8x16b);
  477|       |            //final adds for deltap1 and deltaq1
  478|  5.27M|            tmp_delta3_8x16b = _mm_add_epi16(tmp_delta3_8x16b, const2_8x16b);
  479|  5.27M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, tmp2_const_8x16b);
  480|  5.27M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, tmp_delta3_8x16b);
  481|  5.27M|            tmp2_const_8x16b = _mm_setzero_si128();
  482|  5.27M|            tmp_delta1_8x16b = _mm_srai_epi16(tmp_delta1_8x16b, 2);
  483|       |
  484|       |            // clipping delta1
  485|  5.27M|            tmp_delta1_8x16b = _mm_min_epi16(tmp_delta1_8x16b, consttc_8x16b);
  486|       |            // clipping delta1
  487|  5.27M|            tmp_delta1_8x16b = _mm_max_epi16(tmp_delta1_8x16b, tmp1_const_8x16b);
  488|       |
  489|       |            //getting the mask ready
  490|  5.27M|            mask_pq_8x16b = _mm_srai_epi16(mask_pq_8x16b, 15);
  491|       |            //masking of the delta values |delta|<10*tc
  492|  5.27M|            tmp_delta1_8x16b = _mm_and_si128(tmp_delta1_8x16b, tmp0_const_8x16b);
  493|  5.27M|            tmp_delta0_8x16b = _mm_and_si128(tmp_delta0_8x16b, tmp0_const_8x16b);
  494|       |            //packing dq1 dq0 dp0 dp1
  495|  5.27M|            tmp1_const_8x16b = _mm_unpacklo_epi16(tmp_delta1_8x16b, tmp_delta0_8x16b);
  496|  5.27M|            tmp_delta0_8x16b = _mm_unpackhi_epi16(tmp_delta0_8x16b, tmp_delta1_8x16b);
  497|  5.27M|            tmp_delta1_8x16b = _mm_unpackhi_epi32(tmp1_const_8x16b, tmp_delta0_8x16b);
  498|  5.27M|            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.27M|            tmp_delta0_8x16b = _mm_and_si128(tmp_delta0_8x16b, mask_pq_8x16b);
  502|  5.27M|            tmp_delta1_8x16b = _mm_and_si128(tmp_delta1_8x16b, mask_pq_8x16b);
  503|       |            //converting 8bit to 16 bit
  504|  5.27M|            src_row0_8x16b = _mm_unpacklo_epi8(src_row0_8x16b, tmp2_const_8x16b);
  505|  5.27M|            src_row1_8x16b = _mm_unpacklo_epi8(src_row1_8x16b, tmp2_const_8x16b);
  506|  5.27M|            src_row2_8x16b = _mm_unpacklo_epi8(src_row2_8x16b, tmp2_const_8x16b);
  507|  5.27M|            src_row3_8x16b = _mm_unpacklo_epi8(src_row3_8x16b, tmp2_const_8x16b);
  508|       |            //shuffle values loaded
  509|  5.27M|            tmp0_const_8x16b = _mm_load_si128((__m128i *)shuffle2);
  510|  5.27M|            tmp1_const_8x16b = _mm_load_si128((__m128i *)shuffle3);
  511|       |            //arranging each row delta in different registers
  512|  5.27M|            tmp_delta3_8x16b = _mm_shuffle_epi8(tmp_delta1_8x16b, tmp1_const_8x16b);
  513|  5.27M|            tmp_delta2_8x16b = _mm_shuffle_epi8(tmp_delta1_8x16b, tmp0_const_8x16b);
  514|  5.27M|            tmp_delta1_8x16b = _mm_shuffle_epi8(tmp_delta0_8x16b, tmp1_const_8x16b);
  515|  5.27M|            tmp_delta0_8x16b = _mm_shuffle_epi8(tmp_delta0_8x16b, tmp0_const_8x16b);
  516|       |
  517|       |            //adding the respective delta
  518|  5.27M|            src_row3_8x16b = _mm_add_epi16(tmp_delta3_8x16b, src_row3_8x16b);
  519|  5.27M|            src_row2_8x16b = _mm_add_epi16(tmp_delta2_8x16b, src_row2_8x16b);
  520|  5.27M|            src_row1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, src_row1_8x16b);
  521|  5.27M|            src_row0_8x16b = _mm_add_epi16(tmp_delta0_8x16b, src_row0_8x16b);
  522|       |            //saturating to 8 bit
  523|  5.27M|            src_row2_8x16b = _mm_packus_epi16(src_row2_8x16b, src_row3_8x16b);
  524|  5.27M|            src_row0_8x16b = _mm_packus_epi16(src_row0_8x16b, src_row1_8x16b);
  525|       |            //separating different rows
  526|  5.27M|            src_row1_8x16b = _mm_srli_si128(src_row0_8x16b, 8);
  527|  5.27M|            src_row3_8x16b = _mm_srli_si128(src_row2_8x16b, 8);
  528|  5.27M|        }
  529|       |
  530|  62.4M|        _mm_storel_epi64((__m128i *)(pu1_src - 4), src_row0_8x16b);
  531|  62.4M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + src_strd), src_row1_8x16b);
  532|  62.4M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 2 * src_strd), src_row2_8x16b);
  533|  62.4M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 3 * src_strd), src_row3_8x16b);
  534|  62.4M|    }
  535|  64.1M|}
ihevc_deblk_luma_horz_ssse3:
  546|  71.7M|{
  547|  71.7M|    WORD32 qp_luma, beta_indx, tc_indx;
  548|  71.7M|    WORD32 beta, tc;
  549|       |
  550|  71.7M|    WORD32 d0, d3, dp, dq, d;
  551|  71.7M|    WORD32 de_0, de_1, de_2, de_3;
  552|  71.7M|    WORD32 d_sam0, d_sam3;
  553|  71.7M|    WORD32 de, dep, deq;
  554|       |
  555|  71.7M|    __m128i src_q0_8x16b, src_q1_8x16b, src_p0_8x16b, src_p1_8x16b, src_q2_8x16b;
  556|  71.7M|    __m128i tmp_pq_str1_8x16b, src_p2_8x16b, tmp_pq_str0_8x16b;
  557|       |
  558|       |
  559|       |
  560|       |
  561|  71.7M|    {
  562|  71.7M|        __m128i src_tmp_p_0_8x16b, src_tmp_p_1_8x16b, src_tmp_q_0_8x16b, src_tmp_q_1_8x16b;
  563|  71.7M|        __m128i coef_8x16b, mask_d_result_4x32b, mask_de_result_8x16b;
  564|  71.7M|        __m128i mask_16x8b, temp_coef0_8x16b, temp_coef1_8x16b;
  565|       |
  566|  71.7M|        ASSERT((bs > 0));
  ------------------
  |  |   55|  71.7M|#define ASSERT(x) {}
  ------------------
  567|  71.7M|        ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  71.7M|#define ASSERT(x) {}
  ------------------
  568|       |
  569|  71.7M|        qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  570|  71.7M|        beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  71.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 55.4k, False: 71.6M]
  |  |  |  Branch (40:53): [True: 3.15k, False: 71.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|  71.7M|        tc_indx = CLIP3(qp_luma + 2 * (bs >> 1) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  71.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.68k, False: 71.7M]
  |  |  |  Branch (40:53): [True: 4.05k, False: 71.6M]
  |  |  ------------------
  ------------------
  578|       |
  579|  71.7M|        beta = gai4_ihevc_beta_table[beta_indx];
  580|  71.7M|        tc = gai4_ihevc_tc_table[tc_indx];
  581|  71.7M|        if(0 == tc)
  ------------------
  |  Branch (581:12): [True: 2.08M, False: 69.6M]
  ------------------
  582|  2.08M|        {
  583|  2.08M|            return;
  584|  2.08M|        }
  585|  69.6M|        src_q0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src));
  586|  69.6M|        src_q1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  587|  69.6M|        src_p0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - src_strd));
  588|  69.6M|        src_p1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 2 * src_strd));
  589|  69.6M|        src_q2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd));
  590|  69.6M|        tmp_pq_str1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd));
  591|  69.6M|        src_p2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 3 * src_strd));
  592|  69.6M|        tmp_pq_str0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 4 * src_strd));
  593|       |
  594|       |
  595|  69.6M|        src_tmp_p_0_8x16b = _mm_unpacklo_epi8(src_p1_8x16b, src_p0_8x16b);
  596|  69.6M|        src_tmp_p_1_8x16b = _mm_unpacklo_epi8(tmp_pq_str0_8x16b, src_p2_8x16b);
  597|       |
  598|  69.6M|        src_tmp_q_0_8x16b = _mm_unpacklo_epi8(src_q0_8x16b, src_q1_8x16b);
  599|  69.6M|        src_tmp_q_1_8x16b = _mm_unpacklo_epi8(src_q2_8x16b, tmp_pq_str1_8x16b);
  600|       |
  601|  69.6M|        src_tmp_p_0_8x16b = _mm_unpacklo_epi16(src_tmp_p_1_8x16b, src_tmp_p_0_8x16b);
  602|  69.6M|        src_tmp_q_0_8x16b = _mm_unpacklo_epi16(src_tmp_q_0_8x16b, src_tmp_q_1_8x16b);
  603|       |
  604|  69.6M|        src_tmp_p_0_8x16b = _mm_shuffle_epi32(src_tmp_p_0_8x16b, 0x6c);
  605|  69.6M|        src_tmp_q_0_8x16b = _mm_shuffle_epi32(src_tmp_q_0_8x16b, 0x6c);
  606|       |
  607|  69.6M|        coef_8x16b = _mm_load_si128((__m128i *)(coef_d));
  608|  69.6M|        mask_16x8b =  _mm_load_si128((__m128i *)(shuffle_d));
  609|       |
  610|  69.6M|        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|  69.6M|        mask_de_result_8x16b = _mm_shuffle_epi8(src_tmp_p_0_8x16b, mask_16x8b);
  613|       |
  614|  69.6M|        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|  69.6M|        temp_coef0_8x16b = _mm_cmpeq_epi16(src_tmp_p_0_8x16b, src_tmp_p_0_8x16b);
  619|  69.6M|        temp_coef1_8x16b = _mm_srli_epi16(temp_coef0_8x16b, 15);
  620|       |        //accumulating values foe dp3 dq3 , dp0 dq0 values
  621|  69.6M|        mask_d_result_4x32b = _mm_madd_epi16(mask_d_result_4x32b, temp_coef1_8x16b);
  622|       |
  623|  69.6M|        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|  69.6M|        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|  69.6M|        mask_de_result_8x16b = _mm_maddubs_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  628|       |        //to get 16 bit 1's
  629|  69.6M|        temp_coef0_8x16b = _mm_srli_epi16(temp_coef1_8x16b, 8);
  630|       |
  631|       |
  632|       |        // dq3 dp3 dq0 dp0
  633|  69.6M|        mask_d_result_4x32b = _mm_abs_epi32(mask_d_result_4x32b);
  634|  69.6M|        mask_16x8b = _mm_shuffle_epi32(mask_d_result_4x32b, 0xec);
  635|  69.6M|        mask_d_result_4x32b = _mm_shuffle_epi32(mask_d_result_4x32b, 0x49);
  636|       |        // dq dp d3 d0
  637|  69.6M|        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|  69.6M|        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|  69.6M|        mask_de_result_8x16b = _mm_madd_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  642|       |
  643|       |        ///store back in a single variable
  644|  69.6M|        temp_coef0_8x16b = _mm_srli_si128(mask_d_result_4x32b, 4);
  645|  69.6M|        temp_coef1_8x16b = _mm_srli_si128(mask_d_result_4x32b, 8);
  646|  69.6M|        mask_16x8b = _mm_srli_si128(mask_d_result_4x32b, 12);
  647|       |
  648|  69.6M|        d0 = _mm_cvtsi128_si32(mask_d_result_4x32b);
  649|  69.6M|        d3 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  650|  69.6M|        dp = _mm_cvtsi128_si32(temp_coef1_8x16b);
  651|  69.6M|        dq = _mm_cvtsi128_si32(mask_16x8b);
  652|       |        //getting d
  653|  69.6M|        d = d0 + d3;
  654|       |
  655|       |        ///store back in a single variable
  656|  69.6M|        temp_coef0_8x16b = _mm_srli_si128(mask_de_result_8x16b, 4);
  657|  69.6M|        temp_coef1_8x16b = _mm_srli_si128(mask_de_result_8x16b, 8);
  658|  69.6M|        mask_16x8b = _mm_srli_si128(mask_de_result_8x16b, 12);
  659|       |
  660|  69.6M|        de_0 = _mm_cvtsi128_si32(mask_de_result_8x16b);
  661|  69.6M|        de_1 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  662|  69.6M|        de_2 = _mm_cvtsi128_si32(temp_coef1_8x16b);
  663|  69.6M|        de_3 = _mm_cvtsi128_si32(mask_16x8b);
  664|       |
  665|  69.6M|        de = 0;
  666|  69.6M|        dep = 0;
  667|  69.6M|        deq = 0;
  668|  69.6M|        if(d < beta)
  ------------------
  |  Branch (668:12): [True: 73.7M, False: 18.4E]
  ------------------
  669|  73.7M|        {
  670|  73.7M|            d_sam0 = 0;
  671|  73.7M|            if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (671:16): [True: 72.2M, False: 1.52M]
  ------------------
  672|  72.2M|                            && (de_2 < (beta >> 3))
  ------------------
  |  Branch (672:32): [True: 68.4M, False: 3.80M]
  ------------------
  673|  66.9M|                            && (de_0 < ((5 * tc + 1) >> 1)))
  ------------------
  |  Branch (673:32): [True: 66.4M, False: 499k]
  ------------------
  674|  66.4M|            {
  675|  66.4M|                d_sam0 = 1;
  676|  66.4M|            }
  677|       |
  678|  73.7M|            d_sam3 = 0;
  679|  73.7M|            if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (679:16): [True: 69.3M, False: 4.42M]
  ------------------
  680|  69.3M|                            && (de_3 < (beta >> 3))
  ------------------
  |  Branch (680:32): [True: 65.9M, False: 3.46M]
  ------------------
  681|  65.9M|                            && de_1 < ((5 * tc + 1) >> 1))
  ------------------
  |  Branch (681:32): [True: 65.4M, False: 473k]
  ------------------
  682|  65.4M|            {
  683|  65.4M|                d_sam3 = 1;
  684|  65.4M|            }
  685|       |
  686|  73.7M|            de = (d_sam0 & d_sam3) + 1;
  687|  73.7M|            dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (687:19): [True: 70.0M, False: 3.73M]
  ------------------
  688|  73.7M|            deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (688:19): [True: 69.7M, False: 4.03M]
  ------------------
  689|  73.7M|            if(tc <= 1)
  ------------------
  |  Branch (689:16): [True: 13.1M, False: 60.5M]
  ------------------
  690|  13.1M|            {
  691|  13.1M|                dep = 0;
  692|  13.1M|                deq = 0;
  693|  13.1M|            }
  694|  73.7M|        }
  695|       |
  696|  69.6M|    }
  697|       |
  698|  69.6M|    if(de != 0)
  ------------------
  |  Branch (698:8): [True: 70.4M, False: 18.4E]
  ------------------
  699|  70.4M|    {
  700|       |
  701|  70.4M|        if(2 == de)
  ------------------
  |  Branch (701:12): [True: 64.1M, False: 6.25M]
  ------------------
  702|  64.1M|        {
  703|       |
  704|  64.1M|            __m128i temp_pq0_str0_16x8b;
  705|  64.1M|            __m128i temp_pq1_str0_16x8b, temp_pq1_str1_16x8b;
  706|  64.1M|            __m128i temp_pq2_str0_16x8b;
  707|  64.1M|            __m128i temp_str0_16x8b, temp_str1_16x8b;
  708|  64.1M|            __m128i const2_8x16b, const2tc_8x16b;
  709|       |
  710|  64.1M|            LWORD64 mask, tc2;
  711|  64.1M|            tc = tc << 1;
  712|  64.1M|            mask = (((LWORD64)filter_flag_q) << 63) | (((LWORD64)filter_flag_p) << 31);
  713|  64.1M|            tc2 = ((LWORD64)tc);
  714|       |
  715|  64.1M|            const2_8x16b = _mm_cmpeq_epi16(src_p1_8x16b, src_p1_8x16b);
  716|       |            //q'0-q'1-2 ,p'0-p'1-2
  717|  64.1M|            temp_pq0_str0_16x8b = _mm_unpacklo_epi8(src_p1_8x16b, src_p0_8x16b);
  718|  64.1M|            temp_str0_16x8b   = _mm_unpacklo_epi8(src_q0_8x16b, src_q1_8x16b);
  719|  64.1M|            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|  64.1M|            temp_pq0_str0_16x8b = _mm_unpacklo_epi64(temp_pq0_str0_16x8b, temp_str0_16x8b);
  722|       |
  723|  64.1M|            const2_8x16b = _mm_packus_epi16(const2_8x16b, const2_8x16b);
  724|  64.1M|            temp_pq0_str0_16x8b = _mm_maddubs_epi16(temp_pq0_str0_16x8b, const2_8x16b);
  725|       |
  726|       |            //q'1-2, p'1-2
  727|  64.1M|            temp_pq1_str0_16x8b = _mm_unpacklo_epi8(src_p0_8x16b, src_q0_8x16b);
  728|  64.1M|            temp_pq1_str1_16x8b = _mm_unpacklo_epi8(src_q1_8x16b, src_q2_8x16b);
  729|  64.1M|            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|  64.1M|            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|  64.1M|            temp_pq1_str1_16x8b = _mm_unpacklo_epi64(temp_str1_16x8b, temp_pq1_str1_16x8b);
  734|       |
  735|  64.1M|            temp_pq1_str0_16x8b = _mm_maddubs_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  736|  64.1M|            temp_pq1_str1_16x8b = _mm_maddubs_epi16(temp_pq1_str1_16x8b, const2_8x16b);
  737|       |
  738|       |            //clipping mask design
  739|  64.1M|            temp_str1_16x8b = _mm_setzero_si128();
  740|  64.1M|            temp_str0_16x8b = _mm_loadl_epi64((__m128i *)(&mask));
  741|  64.1M|            const2tc_8x16b  = _mm_loadl_epi64((__m128i *)(&tc2));
  742|  64.1M|            temp_str0_16x8b = _mm_shuffle_epi32(temp_str0_16x8b, 0x44);
  743|  64.1M|            const2tc_8x16b  = _mm_shuffle_epi8(const2tc_8x16b, temp_str1_16x8b);
  744|       |
  745|       |            //clipping mask design
  746|  64.1M|            temp_str0_16x8b = _mm_srai_epi32(temp_str0_16x8b, 31);
  747|  64.1M|            const2tc_8x16b = _mm_and_si128(const2tc_8x16b, temp_str0_16x8b);
  748|       |            //calculating Clipping MAX for all pixel values.
  749|  64.1M|            src_p0_8x16b = _mm_unpacklo_epi32(src_p0_8x16b, src_q0_8x16b);
  750|  64.1M|            src_q0_8x16b = _mm_unpacklo_epi32(src_p1_8x16b, src_q1_8x16b);
  751|       |            //for clipping calc
  752|  64.1M|            src_p1_8x16b = _mm_unpacklo_epi64(src_p0_8x16b, src_q0_8x16b);
  753|       |            //saving the unmodified data of q1 p1 q0 p0
  754|  64.1M|            src_q1_8x16b = _mm_unpackhi_epi64(src_p0_8x16b, src_q0_8x16b);
  755|       |            //CLIpping MAX and MIN for q1 p1 q0 p0
  756|  64.1M|            src_p0_8x16b = _mm_adds_epu8(src_p1_8x16b, const2tc_8x16b);
  757|  64.1M|            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|  64.1M|            tmp_pq_str0_8x16b = _mm_unpacklo_epi8(src_p2_8x16b, tmp_pq_str0_8x16b);
  762|  64.1M|            temp_pq2_str0_16x8b = _mm_unpacklo_epi8(src_q2_8x16b, tmp_pq_str1_8x16b);
  763|  64.1M|            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|  64.1M|            temp_pq2_str0_16x8b = _mm_unpacklo_epi64(tmp_pq_str0_8x16b, temp_pq2_str0_16x8b);
  766|  64.1M|            src_p2_8x16b = _mm_unpacklo_epi32(src_p2_8x16b, src_q2_8x16b);
  767|  64.1M|            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|  64.1M|            tmp_pq_str0_8x16b = _mm_adds_epu8(src_p2_8x16b, const2tc_8x16b);
  771|  64.1M|            tmp_pq_str1_8x16b = _mm_subs_epu8(src_p2_8x16b, const2tc_8x16b);
  772|       |            //q'0-q'1-2 ,p'0-p'1-2
  773|  64.1M|            temp_str0_16x8b = _mm_shuffle_epi32(temp_pq0_str0_16x8b, 0x4e);
  774|  64.1M|            temp_pq0_str0_16x8b = _mm_add_epi16(temp_pq0_str0_16x8b, temp_str0_16x8b);
  775|       |            //q'1-2 p'1-2
  776|  64.1M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  777|       |            //to get 2 in 16 bit
  778|  64.1M|            const2_8x16b = _mm_srli_epi16(const2_8x16b, 8);
  779|       |
  780|       |
  781|       |            //q'1, p'1 (adding 2)
  782|  64.1M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  783|       |            //q'0-q'1,p'0-p'1
  784|  64.1M|            temp_pq0_str0_16x8b = _mm_add_epi16(temp_pq0_str0_16x8b, const2_8x16b);
  785|       |            //q'2-q'1,p'2-p'1
  786|  64.1M|            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|  64.1M|            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|  64.1M|            temp_pq2_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq2_str0_16x8b);
  791|       |
  792|       |            //normalisation of all modified pixels
  793|  64.1M|            temp_pq0_str0_16x8b = _mm_srai_epi16(temp_pq0_str0_16x8b, 3);
  794|  64.1M|            temp_pq1_str0_16x8b = _mm_srai_epi16(temp_pq1_str0_16x8b, 2);
  795|  64.1M|            temp_pq2_str0_16x8b = _mm_srai_epi16(temp_pq2_str0_16x8b, 3);
  796|       |            //q'1 p'1 q'0 p'0
  797|  64.1M|            temp_pq0_str0_16x8b = _mm_packus_epi16(temp_pq0_str0_16x8b, temp_pq1_str0_16x8b);
  798|  64.1M|            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|  64.1M|            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|  64.1M|            temp_pq0_str0_16x8b = _mm_min_epu8(temp_pq0_str0_16x8b, src_p0_8x16b);
  803|  64.1M|            src_p2_8x16b = _mm_min_epu8(src_p2_8x16b, tmp_pq_str0_8x16b);
  804|  64.1M|            temp_pq0_str0_16x8b = _mm_max_epu8(temp_pq0_str0_16x8b, src_p1_8x16b);
  805|  64.1M|            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|  64.1M|            src_p0_8x16b = _mm_unpacklo_epi32(temp_pq0_str0_16x8b, src_q1_8x16b);
  808|  64.1M|            src_p1_8x16b = _mm_unpackhi_epi32(temp_pq0_str0_16x8b, src_q1_8x16b);
  809|  64.1M|            src_p2_8x16b = _mm_shuffle_epi32(src_p2_8x16b, 0xd8);
  810|  64.1M|            src_q0_8x16b = _mm_srli_si128(src_p0_8x16b, 8);
  811|  64.1M|            src_q1_8x16b = _mm_srli_si128(src_p1_8x16b, 8);
  812|  64.1M|            src_q2_8x16b = _mm_srli_si128(src_p2_8x16b, 8);
  813|       |
  814|  64.1M|            _mm_storel_epi64((__m128i *)(pu1_src - 3 * src_strd), src_p2_8x16b);
  815|  64.1M|            _mm_storel_epi64((__m128i *)(pu1_src - 2 * src_strd), src_p1_8x16b);
  816|  64.1M|            _mm_storel_epi64((__m128i *)(pu1_src - src_strd), src_p0_8x16b);
  817|  64.1M|            _mm_storel_epi64((__m128i *)(pu1_src), src_q0_8x16b);
  818|  64.1M|            _mm_storel_epi64((__m128i *)(pu1_src + src_strd), src_q1_8x16b);
  819|  64.1M|            _mm_storel_epi64((__m128i *)(pu1_src + 2 * src_strd), src_q2_8x16b);
  820|       |
  821|       |
  822|  64.1M|        }
  823|       |
  824|  6.25M|        else
  825|  6.25M|        {
  826|       |
  827|  6.25M|            __m128i tmp_delta0_8x16b, tmp_delta1_8x16b;
  828|  6.25M|            __m128i tmp0_const_8x16b, tmp1_const_8x16b, tmp2_const_8x16b;
  829|  6.25M|            __m128i coefdelta_0_8x16b;
  830|  6.25M|            __m128i const2_8x16b, consttc_8x16b;
  831|       |
  832|  6.25M|            LWORD64 maskp0, maskp1, maskq0, maskq1;
  833|  6.25M|            maskp0 = (LWORD64)filter_flag_p;
  834|  6.25M|            maskq0 = (LWORD64)filter_flag_q;
  835|  6.25M|            maskp1 = (LWORD64)dep;
  836|  6.25M|            maskq1 = (LWORD64)deq;
  837|  6.25M|            consttc_8x16b = _mm_set1_epi32(tc);
  838|       |
  839|  6.25M|            tmp_delta0_8x16b = _mm_unpacklo_epi8(src_p1_8x16b, src_p0_8x16b);
  840|  6.25M|            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.25M|            tmp_delta1_8x16b = _mm_unpacklo_epi16(tmp_delta0_8x16b, tmp_delta1_8x16b);
  843|       |
  844|  6.25M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_de1);
  845|       |            // (-3q1+9q0),(-9p0+3p1)
  846|  6.25M|            tmp_delta0_8x16b = _mm_maddubs_epi16(tmp_delta1_8x16b, coefdelta_0_8x16b);
  847|       |
  848|       |            //getting -tc store
  849|  6.25M|            tmp2_const_8x16b = _mm_cmpeq_epi32(consttc_8x16b, consttc_8x16b);
  850|       |
  851|       |            //getting tc in 16 bit
  852|  6.25M|            consttc_8x16b = _mm_packs_epi32(consttc_8x16b, consttc_8x16b);
  853|       |            //calc 10 *tc = 2*tc +8*tc ; 2*tc
  854|  6.25M|            tmp_pq_str0_8x16b = _mm_slli_epi16(consttc_8x16b, 1);
  855|       |            //calc 10 *tc = 2*tc +8*tc ; 8*tc
  856|  6.25M|            tmp_pq_str1_8x16b = _mm_slli_epi16(consttc_8x16b, 3);
  857|       |
  858|       |            //const 1
  859|  6.25M|            const2_8x16b = _mm_srli_epi16(tmp2_const_8x16b, 15);
  860|       |            //calc 10 *tc
  861|  6.25M|            tmp_pq_str0_8x16b = _mm_add_epi16(tmp_pq_str0_8x16b, tmp_pq_str1_8x16b);
  862|       |            //delta0 without normalisation and clipping
  863|  6.25M|            tmp_delta0_8x16b = _mm_madd_epi16(tmp_delta0_8x16b, const2_8x16b);
  864|       |
  865|  6.25M|            const2_8x16b = _mm_srli_epi32(tmp2_const_8x16b, 31);
  866|       |
  867|       |            //loaded coef for delta1 calculation
  868|  6.25M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_dep1);
  869|       |            //(-2q1+q0),(p0-2p1)
  870|  6.25M|            tmp_delta1_8x16b = _mm_maddubs_epi16(tmp_delta1_8x16b, coefdelta_0_8x16b);
  871|       |            //const 8
  872|  6.25M|            const2_8x16b = _mm_slli_epi32(const2_8x16b, 3);
  873|       |
  874|       |            //normalisation of the filter
  875|  6.25M|            tmp_delta0_8x16b = _mm_add_epi32(tmp_delta0_8x16b, const2_8x16b);
  876|  6.25M|            tmp_delta0_8x16b = _mm_srai_epi32(tmp_delta0_8x16b, 4);
  877|       |
  878|       |            //getting deltaq0
  879|  6.25M|            tmp_pq_str1_8x16b = _mm_sign_epi32(tmp_delta0_8x16b, tmp2_const_8x16b);
  880|       |            //getting -tc
  881|  6.25M|            tmp1_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp2_const_8x16b);
  882|       |            //packing  d03q d02q d01q d0q d03p d02p d01p d00p
  883|  6.25M|            tmp_delta0_8x16b = _mm_packs_epi32(tmp_delta0_8x16b, tmp_pq_str1_8x16b);
  884|       |            //absolute delta
  885|  6.25M|            tmp_pq_str1_8x16b = _mm_abs_epi16(tmp_delta0_8x16b);
  886|       |
  887|       |            //Clipping of delta0
  888|  6.25M|            tmp_delta0_8x16b = _mm_min_epi16(tmp_delta0_8x16b, consttc_8x16b);
  889|       |            //tc>>1 16 bit
  890|  6.25M|            consttc_8x16b = _mm_srai_epi16(consttc_8x16b, 1);
  891|       |            //Clipping of delta0
  892|  6.25M|            tmp_delta0_8x16b = _mm_max_epi16(tmp_delta0_8x16b, tmp1_const_8x16b);
  893|       |
  894|       |            //(-tc)>>1 16 bit
  895|  6.25M|            tmp1_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp2_const_8x16b);
  896|       |            //mask for |delta| < 10*tc
  897|  6.25M|            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.25M|            tmp0_const_8x16b = _mm_setzero_si128();
  902|  6.25M|            src_q2_8x16b = _mm_unpacklo_epi8(src_q2_8x16b, tmp0_const_8x16b);
  903|  6.25M|            src_p2_8x16b = _mm_unpacklo_epi8(src_p2_8x16b, tmp0_const_8x16b);
  904|  6.25M|            src_p2_8x16b = _mm_unpacklo_epi64(src_p2_8x16b, src_q2_8x16b);
  905|       |            //constant 1
  906|  6.25M|            const2_8x16b = _mm_srli_epi16(tmp2_const_8x16b, 15);
  907|       |            //2*delta0
  908|  6.25M|            tmp2_const_8x16b = _mm_add_epi16(tmp_delta0_8x16b, tmp_delta0_8x16b);
  909|       |            //getting  all respective q's and p's together
  910|  6.25M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)(shuffle1));
  911|  6.25M|            tmp_delta1_8x16b = _mm_shuffle_epi8(tmp_delta1_8x16b, coefdelta_0_8x16b);
  912|       |            //final adds for deltap1 and deltaq1
  913|  6.25M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, const2_8x16b);
  914|  6.25M|            src_p2_8x16b = _mm_add_epi16(src_p2_8x16b, tmp2_const_8x16b);
  915|  6.25M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, src_p2_8x16b);
  916|  6.25M|            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.25M|            tmp_pq_str1_8x16b = _mm_loadl_epi64((__m128i *)(&(maskq0)));
  920|  6.25M|            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.25M|            src_q2_8x16b = _mm_loadl_epi64((__m128i *)(&(maskq1)));
  925|  6.25M|            coefdelta_0_8x16b = _mm_loadl_epi64((__m128i *)(&(maskp1)));
  926|       |
  927|  6.25M|            src_p2_8x16b = _mm_unpacklo_epi32(src_p2_8x16b, tmp_pq_str1_8x16b);
  928|  6.25M|            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.25M|            src_q2_8x16b = _mm_and_si128(src_q2_8x16b, src_p2_8x16b);
  931|       |
  932|       |            //rearranging the mask values
  933|  6.25M|            src_q2_8x16b = _mm_shuffle_epi32(src_q2_8x16b, 0x50);
  934|  6.25M|            src_p2_8x16b = _mm_shuffle_epi32(src_p2_8x16b, 0x50);
  935|       |
  936|  6.25M|            src_q2_8x16b = _mm_slli_epi32(src_q2_8x16b, 31);
  937|  6.25M|            src_p2_8x16b = _mm_slli_epi32(src_p2_8x16b, 31);
  938|  6.25M|            src_q2_8x16b = _mm_srai_epi32(src_q2_8x16b, 31);
  939|  6.25M|            src_p2_8x16b = _mm_srai_epi32(src_p2_8x16b, 31);
  940|       |
  941|       |            //combining mask delta1
  942|  6.25M|            tmp_pq_str1_8x16b = _mm_and_si128(tmp_pq_str0_8x16b, src_q2_8x16b);
  943|       |            // clipping delta1
  944|  6.25M|            tmp_delta1_8x16b = _mm_min_epi16(tmp_delta1_8x16b, consttc_8x16b);
  945|       |            //combining mask delat0
  946|  6.25M|            tmp_pq_str0_8x16b = _mm_and_si128(tmp_pq_str0_8x16b, src_p2_8x16b);
  947|       |            // clipping delta1
  948|  6.25M|            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.25M|            tmp_delta1_8x16b = _mm_and_si128(tmp_delta1_8x16b, tmp_pq_str1_8x16b);
  953|  6.25M|            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.25M|            tmp_pq_str0_8x16b = _mm_unpacklo_epi64(tmp_delta0_8x16b, tmp0_const_8x16b);
  956|  6.25M|            tmp_pq_str1_8x16b = _mm_unpackhi_epi64(tmp_delta0_8x16b, tmp0_const_8x16b);
  957|  6.25M|            src_p0_8x16b = _mm_unpacklo_epi8(src_p0_8x16b, tmp0_const_8x16b);
  958|  6.25M|            src_q0_8x16b = _mm_unpacklo_epi8(src_q0_8x16b, tmp0_const_8x16b);
  959|  6.25M|            src_p0_8x16b = _mm_add_epi16(src_p0_8x16b, tmp_pq_str0_8x16b);
  960|  6.25M|            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.25M|            tmp_pq_str0_8x16b = _mm_unpacklo_epi64(tmp_delta1_8x16b, tmp0_const_8x16b);
  963|  6.25M|            tmp_pq_str1_8x16b = _mm_unpackhi_epi64(tmp_delta1_8x16b, tmp0_const_8x16b);
  964|  6.25M|            src_p1_8x16b = _mm_unpacklo_epi8(src_p1_8x16b, tmp0_const_8x16b);
  965|  6.25M|            src_q1_8x16b = _mm_unpacklo_epi8(src_q1_8x16b, tmp0_const_8x16b);
  966|  6.25M|            src_p1_8x16b = _mm_add_epi16(src_p1_8x16b, tmp_pq_str0_8x16b);
  967|  6.25M|            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.25M|            src_p1_8x16b = _mm_packus_epi16(src_p1_8x16b, src_q1_8x16b);
  970|  6.25M|            src_p0_8x16b = _mm_packus_epi16(src_p0_8x16b, src_q0_8x16b);
  971|       |
  972|  6.25M|            src_q1_8x16b = _mm_srli_si128(src_p1_8x16b, 8);
  973|  6.25M|            src_q0_8x16b = _mm_srli_si128(src_p0_8x16b, 8);
  974|       |
  975|  6.25M|            _mm_storel_epi64((__m128i *)(pu1_src - 2 * src_strd), src_p1_8x16b);
  976|  6.25M|            _mm_storel_epi64((__m128i *)(pu1_src - src_strd), src_p0_8x16b);
  977|  6.25M|            _mm_storel_epi64((__m128i *)(pu1_src), src_q0_8x16b);
  978|  6.25M|            _mm_storel_epi64((__m128i *)(pu1_src + src_strd), src_q1_8x16b);
  979|       |
  980|       |
  981|  6.25M|        }
  982|       |
  983|       |
  984|       |
  985|  70.4M|    }
  986|       |
  987|  69.6M|}
ihevc_deblk_chroma_vert_ssse3:
  999|  21.3M|{
 1000|  21.3M|    WORD32 qp_indx_u, qp_chroma_u;
 1001|  21.3M|    WORD32 qp_indx_v, qp_chroma_v;
 1002|  21.3M|    WORD32 tc_indx_u, tc_u;
 1003|  21.3M|    WORD32 tc_indx_v, tc_v;
 1004|       |
 1005|  21.3M|    __m128i src_row_0_16x8b, tmp_pxl_0_16x8b, src_row_2_16x8b, tmp_pxl_1_16x8b;
 1006|  21.3M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  21.3M|#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|  21.3M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
 1011|  21.3M|    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|  21.3M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1014:8): [True: 18.4E, False: 21.3M]
  |  Branch (1014:51): [True: 18.4E, False: 21.3M]
  ------------------
 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|  21.3M|    else
 1020|  21.3M|    {
 1021|  21.3M|        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: 21.0k, False: 21.3M]
  |  Branch (1021:52): [True: 3.93k, False: 21.3M]
  ------------------
 1022|  21.3M|        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: 10.7k, False: 21.3M]
  |  Branch (1022:52): [True: 2.18k, False: 21.3M]
  ------------------
 1023|  21.3M|    }
 1024|       |
 1025|  21.3M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  21.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.93k, False: 21.3M]
  |  |  |  Branch (40:53): [True: 9.33k, False: 21.3M]
  |  |  ------------------
  ------------------
 1026|  21.3M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
 1027|       |
 1028|  21.3M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  21.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.18k, False: 21.3M]
  |  |  |  Branch (40:53): [True: 1.28k, False: 21.3M]
  |  |  ------------------
  ------------------
 1029|  21.3M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
 1030|       |
 1031|  21.3M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (1031:8): [True: 452k, False: 20.9M]
  |  Branch (1031:21): [True: 448k, False: 3.86k]
  ------------------
 1032|   448k|    {
 1033|   448k|        return;
 1034|   448k|    }
 1035|  20.9M|    src_row_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src - 4));
 1036|  20.9M|    tmp_pxl_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd - 4));
 1037|  20.9M|    src_row_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd - 4));
 1038|  20.9M|    tmp_pxl_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd - 4));
 1039|       |
 1040|  20.9M|    {
 1041|  20.9M|        LWORD64 mask_tc, mask_flag, mask;
 1042|  20.9M|        __m128i delta_vu0_16x8b, delta_vu1_16x8b;
 1043|  20.9M|        __m128i mask_tc_16x8, mask_16x8b, mask_flag_p_16x8b, mask_flag_q_16x8b;
 1044|  20.9M|        __m128i min_0_16x8b;
 1045|  20.9M|        __m128i const_16x8b;
 1046|  20.9M|        mask_flag = (((LWORD64)filter_flag_p) << 31) | (((LWORD64)filter_flag_q) << 63);
 1047|  20.9M|        mask_tc = (((LWORD64)tc_v) << 16) | ((LWORD64)tc_u);
 1048|  20.9M|        mask = 0xffff00000000ffffLL;
 1049|       |
 1050|  20.9M|        src_row_0_16x8b = _mm_unpacklo_epi64(src_row_0_16x8b, tmp_pxl_0_16x8b);
 1051|  20.9M|        src_row_2_16x8b = _mm_unpacklo_epi64(src_row_2_16x8b, tmp_pxl_1_16x8b);
 1052|       |
 1053|  20.9M|        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.9M|        delta_vu0_16x8b = _mm_shuffle_epi8(src_row_0_16x8b, mask_16x8b);
 1057|  20.9M|        delta_vu1_16x8b = _mm_shuffle_epi8(src_row_2_16x8b, mask_16x8b);
 1058|       |
 1059|  20.9M|        tmp_pxl_0_16x8b = _mm_unpacklo_epi64(delta_vu0_16x8b, delta_vu1_16x8b);
 1060|  20.9M|        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.9M|        delta_vu0_16x8b = _mm_load_si128((__m128i *)delta0);
 1064|  20.9M|        delta_vu1_16x8b = _mm_load_si128((__m128i *)delta1);
 1065|       |
 1066|  20.9M|        delta_vu0_16x8b = _mm_maddubs_epi16(tmp_pxl_0_16x8b, delta_vu0_16x8b);
 1067|  20.9M|        delta_vu1_16x8b = _mm_maddubs_epi16(tmp_pxl_1_16x8b, delta_vu1_16x8b);
 1068|       |
 1069|       |        //generating offset 4
 1070|  20.9M|        const_16x8b = _mm_cmpeq_epi16(tmp_pxl_0_16x8b, tmp_pxl_0_16x8b);
 1071|       |        // filter flag mask and tc mask
 1072|  20.9M|        mask_tc_16x8 = _mm_loadl_epi64((__m128i *)(&mask_tc));
 1073|  20.9M|        mask_flag_q_16x8b = _mm_loadl_epi64((__m128i *)(&mask_flag));
 1074|       |
 1075|  20.9M|        mask_tc_16x8 = _mm_shuffle_epi32(mask_tc_16x8, 0x00);
 1076|  20.9M|        mask_flag_q_16x8b = _mm_srai_epi32(mask_flag_q_16x8b, 31);
 1077|       |        //-tc
 1078|  20.9M|        min_0_16x8b = _mm_sign_epi16(mask_tc_16x8, const_16x8b);
 1079|       |        //converting const 1
 1080|  20.9M|        const_16x8b = _mm_srli_epi16(const_16x8b, 15);
 1081|       |
 1082|       |        //filterp and filterq flag
 1083|  20.9M|        mask_flag_p_16x8b = _mm_shuffle_epi32(mask_flag_q_16x8b, 0x00);
 1084|  20.9M|        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.9M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, delta_vu1_16x8b);
 1088|       |        //converting const 4
 1089|  20.9M|        const_16x8b = _mm_slli_epi16(const_16x8b, 2);
 1090|       |
 1091|  20.9M|        mask_16x8b = _mm_loadl_epi64((__m128i *)(&mask));
 1092|       |        //offset addition
 1093|  20.9M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, const_16x8b);
 1094|       |        //eliminating q1
 1095|  20.9M|        tmp_pxl_1_16x8b = _mm_slli_epi16(tmp_pxl_1_16x8b, 8);
 1096|       |
 1097|  20.9M|        const_16x8b = _mm_setzero_si128();
 1098|       |        //filter after normalisation
 1099|  20.9M|        delta_vu0_16x8b = _mm_srai_epi16(delta_vu0_16x8b, 3);
 1100|  20.9M|        mask_16x8b = _mm_shuffle_epi32(mask_16x8b, 0x44);
 1101|       |
 1102|       |        //clipping MAX
 1103|  20.9M|        delta_vu0_16x8b = _mm_min_epi16(delta_vu0_16x8b, mask_tc_16x8);
 1104|       |        //getting p0 and eliminating p1
 1105|  20.9M|        tmp_pxl_0_16x8b = _mm_srli_epi16(tmp_pxl_0_16x8b, 8);
 1106|       |        //clipping MIN
 1107|  20.9M|        delta_vu0_16x8b = _mm_max_epi16(delta_vu0_16x8b, min_0_16x8b);
 1108|       |        //getting q0
 1109|  20.9M|        tmp_pxl_1_16x8b = _mm_srli_epi16(tmp_pxl_1_16x8b, 8);
 1110|       |        //masking filter flag
 1111|  20.9M|        delta_vu1_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_q_16x8b);
 1112|  20.9M|        delta_vu0_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_p_16x8b);
 1113|       |
 1114|       |        // q-delta ,p+delta
 1115|  20.9M|        tmp_pxl_1_16x8b = _mm_sub_epi16(tmp_pxl_1_16x8b, delta_vu1_16x8b);
 1116|  20.9M|        tmp_pxl_0_16x8b = _mm_add_epi16(tmp_pxl_0_16x8b, delta_vu0_16x8b);
 1117|       |        //merging q0 and p0 of respective rows
 1118|  20.9M|        delta_vu1_16x8b = _mm_unpackhi_epi32(tmp_pxl_0_16x8b, tmp_pxl_1_16x8b);
 1119|  20.9M|        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.9M|        delta_vu0_16x8b = _mm_packus_epi16(delta_vu0_16x8b, const_16x8b);
 1122|  20.9M|        delta_vu1_16x8b = _mm_packus_epi16(delta_vu1_16x8b, const_16x8b);
 1123|       |        //removing older pixel values
 1124|  20.9M|        src_row_0_16x8b = _mm_and_si128(src_row_0_16x8b, mask_16x8b);
 1125|  20.9M|        src_row_2_16x8b = _mm_and_si128(src_row_2_16x8b, mask_16x8b);
 1126|       |        //arranging modified pixels
 1127|  20.9M|        delta_vu0_16x8b = _mm_shuffle_epi32(delta_vu0_16x8b, 0xd8);
 1128|  20.9M|        delta_vu1_16x8b = _mm_shuffle_epi32(delta_vu1_16x8b, 0xd8);
 1129|  20.9M|        delta_vu0_16x8b = _mm_slli_epi64(delta_vu0_16x8b, 16);
 1130|  20.9M|        delta_vu1_16x8b = _mm_slli_epi64(delta_vu1_16x8b, 16);
 1131|       |        //plugging the modified values
 1132|  20.9M|        src_row_0_16x8b = _mm_or_si128(src_row_0_16x8b, delta_vu0_16x8b);
 1133|  20.9M|        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.9M|        tmp_pxl_0_16x8b = _mm_srli_si128(src_row_0_16x8b, 8);
 1138|  20.9M|        tmp_pxl_1_16x8b = _mm_srli_si128(src_row_2_16x8b, 8);
 1139|       |
 1140|  20.9M|        _mm_storel_epi64((__m128i *)(pu1_src - 4), src_row_0_16x8b);
 1141|  20.9M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + src_strd), tmp_pxl_0_16x8b);
 1142|  20.9M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 2 * src_strd), src_row_2_16x8b);
 1143|  20.9M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 3 * src_strd), tmp_pxl_1_16x8b);
 1144|  20.9M|    }
 1145|       |
 1146|       |
 1147|       |
 1148|  20.9M|}
ihevc_deblk_chroma_horz_ssse3:
 1160|  21.4M|{
 1161|  21.4M|    WORD32 qp_indx_u, qp_chroma_u;
 1162|  21.4M|    WORD32 qp_indx_v, qp_chroma_v;
 1163|  21.4M|    WORD32 tc_indx_u, tc_u;
 1164|  21.4M|    WORD32 tc_indx_v, tc_v;
 1165|       |
 1166|       |
 1167|  21.4M|    __m128i tmp_p0_16x8b, src_p0_16x8b, src_q0_16x8b, tmp_q0_16x8b;
 1168|       |
 1169|  21.4M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  21.4M|#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|  21.4M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
 1174|  21.4M|    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|  21.4M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1177:8): [True: 18.4E, False: 21.4M]
  |  Branch (1177:51): [True: 18.4E, False: 21.4M]
  ------------------
 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|  21.4M|    else
 1183|  21.4M|    {
 1184|  21.4M|        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: 20.8k, False: 21.4M]
  |  Branch (1184:52): [True: 3.50k, False: 21.4M]
  ------------------
 1185|  21.4M|        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: 9.46k, False: 21.4M]
  |  Branch (1185:52): [True: 2.27k, False: 21.4M]
  ------------------
 1186|  21.4M|    }
 1187|       |
 1188|  21.4M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  21.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.50k, False: 21.4M]
  |  |  |  Branch (40:53): [True: 8.08k, False: 21.4M]
  |  |  ------------------
  ------------------
 1189|  21.4M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
 1190|       |
 1191|  21.4M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  21.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.27k, False: 21.4M]
  |  |  |  Branch (40:53): [True: 1.48k, False: 21.4M]
  |  |  ------------------
  ------------------
 1192|  21.4M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
 1193|       |
 1194|  21.4M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (1194:8): [True: 545k, False: 20.9M]
  |  Branch (1194:21): [True: 539k, False: 5.43k]
  ------------------
 1195|   539k|    {
 1196|   539k|        return;
 1197|   539k|    }
 1198|  20.9M|    tmp_p0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src - 2 * src_strd));
 1199|  20.9M|    src_p0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src - src_strd));
 1200|  20.9M|    src_q0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 1201|  20.9M|    tmp_q0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1202|       |
 1203|  20.9M|    {
 1204|  20.9M|        LWORD64 mask_tc, mask_flag;
 1205|  20.9M|        __m128i delta_vu0_16x8b, delta_vu1_16x8b;
 1206|  20.9M|        __m128i mask_tc_16x8, mask_16x8b, mask_flag_p_16x8b, mask_flag_q_16x8b;
 1207|  20.9M|        __m128i min_0_16x8b;
 1208|  20.9M|        __m128i const_16x8b;
 1209|  20.9M|        mask_flag = (((LWORD64)filter_flag_p) << 31) | (((LWORD64)filter_flag_q) << 63);
 1210|  20.9M|        mask_tc = (((LWORD64)tc_v) << 16) | ((LWORD64)tc_u);
 1211|       |
 1212|  20.9M|        tmp_p0_16x8b = _mm_unpacklo_epi8(tmp_p0_16x8b, src_p0_16x8b);
 1213|  20.9M|        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.9M|        delta_vu0_16x8b = _mm_load_si128((__m128i *)delta0);
 1218|  20.9M|        delta_vu1_16x8b = _mm_load_si128((__m128i *)delta1);
 1219|       |
 1220|  20.9M|        delta_vu0_16x8b = _mm_maddubs_epi16(tmp_p0_16x8b, delta_vu0_16x8b);
 1221|  20.9M|        delta_vu1_16x8b = _mm_maddubs_epi16(tmp_q0_16x8b, delta_vu1_16x8b);
 1222|       |
 1223|       |
 1224|       |        // filter flag mask and tc mask
 1225|  20.9M|        mask_tc_16x8 = _mm_loadl_epi64((__m128i *)(&mask_tc));
 1226|  20.9M|        mask_flag_q_16x8b = _mm_loadl_epi64((__m128i *)(&mask_flag));
 1227|       |
 1228|       |        //generating offset 4
 1229|  20.9M|        const_16x8b = _mm_cmpeq_epi16(tmp_p0_16x8b, tmp_p0_16x8b);
 1230|       |        // filter flag mask and tc mask
 1231|  20.9M|        mask_tc_16x8 = _mm_shuffle_epi32(mask_tc_16x8, 0x00);
 1232|  20.9M|        mask_flag_q_16x8b = _mm_srai_epi32(mask_flag_q_16x8b, 31);
 1233|       |        //-tc
 1234|  20.9M|        min_0_16x8b = _mm_sign_epi16(mask_tc_16x8, const_16x8b);
 1235|       |        //converting const 1
 1236|  20.9M|        const_16x8b = _mm_srli_epi16(const_16x8b, 15);
 1237|       |
 1238|       |        //filterp
 1239|  20.9M|        mask_flag_p_16x8b = _mm_shuffle_epi32(mask_flag_q_16x8b, 0x00);
 1240|       |
 1241|       |
 1242|       |        //converting const 4
 1243|  20.9M|        const_16x8b = _mm_slli_epi16(const_16x8b, 2);
 1244|       |        //modified delta with a filter (1 -4 4 -1) available in 16 bit
 1245|  20.9M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, delta_vu1_16x8b);
 1246|       |
 1247|       |        //filterq flag
 1248|  20.9M|        mask_flag_q_16x8b = _mm_shuffle_epi32(mask_flag_q_16x8b, 0x55);
 1249|       |        //offset addition
 1250|  20.9M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, const_16x8b);
 1251|  20.9M|        mask_16x8b = _mm_setzero_si128();
 1252|       |        //filter after normalisation
 1253|  20.9M|        delta_vu0_16x8b = _mm_srai_epi16(delta_vu0_16x8b, 3);
 1254|       |
 1255|       |        //converting p0 to 16bit
 1256|  20.9M|        src_p0_16x8b = _mm_unpacklo_epi8(src_p0_16x8b, mask_16x8b);
 1257|       |        //clipping MAX
 1258|  20.9M|        delta_vu0_16x8b = _mm_min_epi16(delta_vu0_16x8b, mask_tc_16x8);
 1259|       |        //converting q0 to 16bit
 1260|  20.9M|        src_q0_16x8b = _mm_unpacklo_epi8(src_q0_16x8b, mask_16x8b);
 1261|       |        //clipping MIN
 1262|  20.9M|        delta_vu0_16x8b = _mm_max_epi16(delta_vu0_16x8b, min_0_16x8b);
 1263|       |
 1264|       |        //masking filter flag
 1265|  20.9M|        delta_vu1_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_q_16x8b);
 1266|  20.9M|        delta_vu0_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_p_16x8b);
 1267|       |
 1268|       |        // q-delta ,p+delta
 1269|  20.9M|        src_q0_16x8b = _mm_sub_epi16(src_q0_16x8b, delta_vu1_16x8b);
 1270|  20.9M|        src_p0_16x8b = _mm_add_epi16(src_p0_16x8b, delta_vu0_16x8b);
 1271|       |
 1272|       |        // p0 and q0 packed
 1273|  20.9M|        src_q0_16x8b = _mm_packus_epi16(src_q0_16x8b, mask_16x8b);
 1274|  20.9M|        src_p0_16x8b = _mm_packus_epi16(src_p0_16x8b, mask_16x8b);
 1275|       |
 1276|       |
 1277|       |
 1278|  20.9M|        _mm_storel_epi64((__m128i *)(pu1_src - src_strd), src_p0_16x8b);
 1279|  20.9M|        _mm_storel_epi64((__m128i *)(pu1_src), src_q0_16x8b);
 1280|       |
 1281|  20.9M|    }
 1282|       |
 1283|       |
 1284|  20.9M|}

ihevc_inter_pred_luma_copy_w16out_sse42:
  115|  17.7M|{
  116|  17.7M|    WORD32 row, col;
  117|  17.7M|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  118|  17.7M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  17.7M|#define UNUSED(x) ((void)(x))
  ------------------
  119|  17.7M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  17.7M|#define ASSERT(x) {}
  ------------------
  120|  17.7M|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  17.7M|#define ASSERT(x) {}
  ------------------
  121|       |
  122|  17.7M|    if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (122:8): [True: 17.6M, False: 14.0k]
  ------------------
  123|  17.6M|    {
  124|  54.7M|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (124:22): [True: 37.0M, False: 17.6M]
  ------------------
  125|  37.0M|        {
  126|  81.7M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (126:26): [True: 44.7M, False: 37.0M]
  ------------------
  127|  44.7M|            {
  128|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  129|  44.7M|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  130|  44.7M|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  131|  44.7M|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  132|  44.7M|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  133|       |
  134|  44.7M|                src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  135|  44.7M|                src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  136|  44.7M|                src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  137|  44.7M|                src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  138|       |
  139|  44.7M|                src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  44.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  140|  44.7M|                src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  44.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  141|  44.7M|                src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  44.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  142|  44.7M|                src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  44.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  143|       |
  144|       |                /* storing 16 8-bit output values */
  145|  44.7M|                _mm_storeu_si128((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  146|  44.7M|                _mm_storeu_si128((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  147|  44.7M|                _mm_storeu_si128((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  148|  44.7M|                _mm_storeu_si128((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  149|       |
  150|  44.7M|                pu1_src += 8; /* pointer update */
  151|  44.7M|                pi2_dst += 8; /* pointer update */
  152|  44.7M|            } /* inner for loop ends here(8-output values in single iteration) */
  153|       |
  154|  37.0M|            pu1_src += 4 * src_strd - wd; /* pointer update */
  155|  37.0M|            pi2_dst += 4 * dst_strd - wd; /* pointer update */
  156|  37.0M|        }
  157|  17.6M|    }
  158|  14.0k|    else /* wd = multiple of 4 case */
  159|  14.0k|    {
  160|  72.2k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (160:22): [True: 58.1k, False: 14.0k]
  ------------------
  161|  58.1k|        {
  162|   171k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (162:26): [True: 113k, False: 58.1k]
  ------------------
  163|   113k|            {
  164|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  165|   113k|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  166|   113k|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  167|   113k|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  168|   113k|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  169|       |
  170|   113k|                src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  171|   113k|                src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  172|   113k|                src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  173|   113k|                src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  174|       |
  175|   113k|                src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   113k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   113k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  176|   113k|                src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   113k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   113k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  177|   113k|                src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   113k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   113k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  178|   113k|                src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   113k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   113k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  179|       |
  180|       |                /* storing 16 8-bit output values */
  181|   113k|                _mm_storel_epi64((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  182|   113k|                _mm_storel_epi64((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  183|   113k|                _mm_storel_epi64((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  184|   113k|                _mm_storel_epi64((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  185|       |
  186|   113k|                pu1_src += 4; /* pointer update */
  187|   113k|                pi2_dst += 4; /* pointer update */
  188|   113k|            } /* inner for loop ends here(4-output values in single iteration) */
  189|       |
  190|  58.1k|            pu1_src += 4 * src_strd - wd; /* pointer update */
  191|  58.1k|            pi2_dst += 4 * dst_strd - wd; /* pointer update */
  192|  58.1k|        }
  193|  14.0k|    }
  194|  17.7M|}
ihevc_inter_pred_chroma_copy_sse42:
  242|   302k|{
  243|   302k|    WORD32 row, col, wdx2;
  244|   302k|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  245|       |
  246|   302k|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   302k|#define ASSERT(x) {}
  ------------------
  247|   302k|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   302k|#define ASSERT(x) {}
  ------------------
  248|   302k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   302k|#define UNUSED(x) ((void)(x))
  ------------------
  249|   302k|    wdx2 = wd * 2;
  250|       |
  251|   302k|    if(0 == (ht & 3)) /* ht multiple of 4 */
  ------------------
  |  Branch (251:8): [True: 283k, False: 18.4k]
  ------------------
  252|   283k|    {
  253|   283k|        if(0 == (wdx2 & 15)) /* wdx2 multiple of 16 case */
  ------------------
  |  Branch (253:12): [True: 9.48k, False: 274k]
  ------------------
  254|  9.48k|        {
  255|  38.6k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (255:26): [True: 29.1k, False: 9.48k]
  ------------------
  256|  29.1k|            {
  257|  92.9k|                for(col = 0; col < wdx2; col += 16)
  ------------------
  |  Branch (257:30): [True: 63.8k, False: 29.1k]
  ------------------
  258|  63.8k|                {
  259|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  260|  63.8k|                    src0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                /* row =0 */
  261|  63.8k|                    src1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  262|  63.8k|                    src2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  263|  63.8k|                    src3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  264|       |
  265|       |                    /* storing 16 8-bit output values */
  266|  63.8k|                    _mm_storeu_si128((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  267|  63.8k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  268|  63.8k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  269|  63.8k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  270|       |
  271|  63.8k|                    pu1_src += 16; /* pointer update */
  272|  63.8k|                    pu1_dst += 16; /* pointer update */
  273|  63.8k|                } /* inner for loop ends here(16-output values in single iteration) */
  274|       |
  275|  29.1k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  276|  29.1k|                pu1_dst += 4 * dst_strd - wdx2; /* pointer update */
  277|  29.1k|            }
  278|       |
  279|  9.48k|        }
  280|   274k|        else if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (280:17): [True: 257k, False: 17.0k]
  ------------------
  281|   257k|        {
  282|   517k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (282:26): [True: 260k, False: 257k]
  ------------------
  283|   260k|            {
  284|   523k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (284:30): [True: 263k, False: 260k]
  ------------------
  285|   263k|                {
  286|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  287|   263k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  288|   263k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  289|   263k|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  290|   263k|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  291|       |
  292|       |                    /* storing 16 8-bit output values */
  293|   263k|                    _mm_storel_epi64((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  294|   263k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  295|   263k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  296|   263k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  297|       |
  298|   263k|                    pu1_src += 8; /* pointer update */
  299|   263k|                    pu1_dst += 8; /* pointer update */
  300|   263k|                } /*  inner for loop ends here(8-output values in single iteration) */
  301|       |
  302|   260k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  303|   260k|                pu1_dst += 4 * dst_strd - wdx2; /* pointer update */
  304|   260k|            }
  305|   257k|        }
  306|  17.0k|        else /* wdx2 = multiple of 4 case */
  307|  17.0k|        {
  308|  17.0k|            WORD32 dst0, dst1, dst2, dst3;
  309|  34.4k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (309:26): [True: 17.4k, False: 17.0k]
  ------------------
  310|  17.4k|            {
  311|  36.6k|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (311:30): [True: 19.1k, False: 17.4k]
  ------------------
  312|  19.1k|                {
  313|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  314|  19.1k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  315|  19.1k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  316|  19.1k|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  317|  19.1k|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  318|       |
  319|  19.1k|                    dst0 = _mm_cvtsi128_si32(src0_16x8b);
  320|  19.1k|                    dst1 = _mm_cvtsi128_si32(src1_16x8b);
  321|  19.1k|                    dst2 = _mm_cvtsi128_si32(src2_16x8b);
  322|  19.1k|                    dst3 = _mm_cvtsi128_si32(src3_16x8b);
  323|       |
  324|       |                    /* storing 4 8-bit output values */
  325|  19.1k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0; /* row =0 */
  326|  19.1k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1; /* row =1 */
  327|  19.1k|                    *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2; /* row =2 */
  328|  19.1k|                    *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3; /* row =3 */
  329|       |
  330|  19.1k|                    pu1_src += 4; /* pointer update */
  331|  19.1k|                    pu1_dst += 4; /* pointer update */
  332|  19.1k|                } /*  inner for loop ends here(4- output values in single iteration) */
  333|       |
  334|  17.4k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  335|  17.4k|                pu1_dst += 4 * dst_strd - wdx2; /* pointer update */
  336|  17.4k|            }
  337|  17.0k|        }
  338|   283k|    }
  339|  18.4k|    else /* ht multiple of 2 */
  340|  18.4k|    {
  341|  18.4k|        if(0 == (wdx2 & 15)) /* wdx2 multiple of 16 case */
  ------------------
  |  Branch (341:12): [True: 736, False: 17.7k]
  ------------------
  342|    736|        {
  343|  2.20k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (343:26): [True: 1.47k, False: 736]
  ------------------
  344|  1.47k|            {
  345|  2.94k|                for(col = 0; col < wdx2; col += 16)
  ------------------
  |  Branch (345:30): [True: 1.47k, False: 1.47k]
  ------------------
  346|  1.47k|                {
  347|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  348|  1.47k|                    src0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                /* row =0 */
  349|  1.47k|                    src1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  350|       |
  351|       |                    /* storing 16 8-bit output values */
  352|  1.47k|                    _mm_storeu_si128((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  353|  1.47k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  354|       |
  355|  1.47k|                    pu1_src += 16; /* pointer update */
  356|  1.47k|                    pu1_dst += 16; /* pointer update */
  357|  1.47k|                } /* inner for loop ends here(16-output values in single iteration) */
  358|       |
  359|  1.47k|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  360|  1.47k|                pu1_dst += 2 * dst_strd - wdx2; /* pointer update */
  361|  1.47k|            }
  362|       |
  363|    736|        }
  364|  17.7k|        else if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (364:17): [True: 18.3k, False: 18.4E]
  ------------------
  365|  18.3k|        {
  366|  36.6k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (366:26): [True: 18.3k, False: 18.3k]
  ------------------
  367|  18.3k|            {
  368|  36.6k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (368:30): [True: 18.3k, False: 18.3k]
  ------------------
  369|  18.3k|                {
  370|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  371|  18.3k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  372|  18.3k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  373|       |
  374|       |                    /* storing 16 8-bit output values */
  375|  18.3k|                    _mm_storel_epi64((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  376|  18.3k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  377|       |
  378|  18.3k|                    pu1_src += 8; /* pointer update */
  379|  18.3k|                    pu1_dst += 8; /* pointer update */
  380|  18.3k|                } /*  inner for loop ends here(8-output values in single iteration) */
  381|       |
  382|  18.3k|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  383|  18.3k|                pu1_dst += 2 * dst_strd - wdx2; /* pointer update */
  384|  18.3k|            }
  385|  18.3k|        }
  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|  18.4k|    }
  414|   302k|}
ihevc_inter_pred_chroma_copy_w16out_sse42:
  463|  17.3M|{
  464|  17.3M|    WORD32 row, col, wdx2;
  465|  17.3M|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  466|       |
  467|  17.3M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  17.3M|#define ASSERT(x) {}
  ------------------
  468|  17.3M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  17.3M|#define ASSERT(x) {}
  ------------------
  469|  17.3M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  17.3M|#define UNUSED(x) ((void)(x))
  ------------------
  470|  17.3M|    wdx2 = wd * 2;
  471|       |
  472|  17.3M|    if(0 == (ht & 3)) /* multiple of 4 case */
  ------------------
  |  Branch (472:8): [True: 17.3M, False: 3.21k]
  ------------------
  473|  17.3M|    {
  474|  17.3M|        if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (474:12): [True: 17.3M, False: 14.5k]
  ------------------
  475|  17.3M|        {
  476|  35.5M|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (476:26): [True: 18.2M, False: 17.3M]
  ------------------
  477|  18.2M|            {
  478|  40.2M|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (478:30): [True: 22.0M, False: 18.2M]
  ------------------
  479|  22.0M|                {
  480|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  481|  22.0M|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  482|  22.0M|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  483|  22.0M|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  484|  22.0M|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  485|       |
  486|  22.0M|                    src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  487|  22.0M|                    src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  488|  22.0M|                    src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  489|  22.0M|                    src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  490|       |
  491|  22.0M|                    src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  22.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  492|  22.0M|                    src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  22.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  493|  22.0M|                    src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  22.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  494|  22.0M|                    src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  22.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  495|       |
  496|       |                    /* storing 16 8-bit output values */
  497|  22.0M|                    _mm_storeu_si128((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  498|  22.0M|                    _mm_storeu_si128((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  499|  22.0M|                    _mm_storeu_si128((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  500|  22.0M|                    _mm_storeu_si128((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  501|       |
  502|  22.0M|                    pu1_src += 8; /* pointer update */
  503|  22.0M|                    pi2_dst += 8; /* pointer update */
  504|  22.0M|                } /* inner for loop ends here(8-output values in single iteration) */
  505|       |
  506|  18.2M|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  507|  18.2M|                pi2_dst += 4 * dst_strd - wdx2; /* pointer update */
  508|  18.2M|            }
  509|  17.3M|        }
  510|  14.5k|        else /* wdx2 = multiple of 4 case */
  511|  14.5k|        {
  512|  42.9k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (512:26): [True: 28.3k, False: 14.5k]
  ------------------
  513|  28.3k|            {
  514|  83.3k|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (514:30): [True: 55.0k, False: 28.3k]
  ------------------
  515|  55.0k|                {
  516|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  517|  55.0k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  518|  55.0k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  519|  55.0k|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  520|  55.0k|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  521|       |
  522|  55.0k|                    src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  523|  55.0k|                    src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  524|  55.0k|                    src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  525|  55.0k|                    src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  526|       |
  527|  55.0k|                    src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  55.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  55.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  528|  55.0k|                    src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  55.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  55.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  529|  55.0k|                    src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  55.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  55.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  530|  55.0k|                    src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  55.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  55.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  531|       |
  532|       |                    /* storing 16 8-bit output values */
  533|  55.0k|                    _mm_storel_epi64((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  534|  55.0k|                    _mm_storel_epi64((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  535|  55.0k|                    _mm_storel_epi64((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  536|  55.0k|                    _mm_storel_epi64((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  537|       |
  538|  55.0k|                    pu1_src += 4; /* pointer update */
  539|  55.0k|                    pi2_dst += 4; /* pointer update */
  540|  55.0k|                } /* inner for loop ends here(4-output values in single iteration) */
  541|       |
  542|  28.3k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  543|  28.3k|                pi2_dst += 4 * dst_strd - wdx2; /* pointer update */
  544|  28.3k|            }
  545|  14.5k|        }
  546|  17.3M|    }
  547|  3.21k|    else  /* ht multiple of 2 case */
  548|  3.21k|    {
  549|  3.21k|        if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (549:12): [True: 4.33k, False: 18.4E]
  ------------------
  550|  4.33k|        {
  551|  12.3k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (551:26): [True: 8.04k, False: 4.33k]
  ------------------
  552|  8.04k|            {
  553|  23.6k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (553:30): [True: 15.5k, False: 8.04k]
  ------------------
  554|  15.5k|                {
  555|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  556|  15.5k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  557|  15.5k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  558|       |
  559|  15.5k|                    src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  560|  15.5k|                    src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  561|       |
  562|  15.5k|                    src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  15.5k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  15.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  563|  15.5k|                    src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  15.5k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  15.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  564|       |
  565|       |                    /* storing 16 8-bit output values */
  566|  15.5k|                    _mm_storeu_si128((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  567|  15.5k|                    _mm_storeu_si128((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  568|       |
  569|  15.5k|                    pu1_src += 8; /* pointer update */
  570|  15.5k|                    pi2_dst += 8; /* pointer update */
  571|  15.5k|                } /* inner for loop ends here(8-output values in single iteration) */
  572|       |
  573|  8.04k|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  574|  8.04k|                pi2_dst += 2 * dst_strd - wdx2; /* pointer update */
  575|  8.04k|            }
  576|  4.33k|        }
  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.21k|    }
  606|  17.3M|}

ihevc_inter_pred_luma_copy_ssse3:
  124|  2.47M|{
  125|       |
  126|  2.47M|    WORD32 row, col;
  127|  2.47M|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  128|  2.47M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  2.47M|#define UNUSED(x) ((void)(x))
  ------------------
  129|  2.47M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  2.47M|#define ASSERT(x) {}
  ------------------
  130|  2.47M|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  2.47M|#define ASSERT(x) {}
  ------------------
  131|       |
  132|       |/*  outer for loop starts from here */
  133|  2.47M|    if(0 == (wd & 15)) /* wd multiple of 16 case */
  ------------------
  |  Branch (133:8): [True: 43.9k, False: 2.43M]
  ------------------
  134|  43.9k|    {
  135|   310k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (135:22): [True: 267k, False: 43.9k]
  ------------------
  136|   267k|        {
  137|   848k|            for(col = 0; col < wd; col += 16)
  ------------------
  |  Branch (137:26): [True: 581k, False: 267k]
  ------------------
  138|   581k|            {
  139|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  140|   581k|                src0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                /* row =0 */
  141|   581k|                src1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  142|   581k|                src2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  143|   581k|                src3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  144|       |
  145|       |                /* storing 16 8-bit output values */
  146|   581k|                _mm_storeu_si128((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  147|   581k|                _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  148|   581k|                _mm_storeu_si128((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  149|   581k|                _mm_storeu_si128((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  150|       |
  151|   581k|                pu1_src += 16; /* pointer update */
  152|   581k|                pu1_dst += 16; /* pointer update */
  153|   581k|            } /* inner for loop ends here(16-output values in single iteration) */
  154|       |
  155|   267k|            pu1_src += 4 * src_strd - wd; /* pointer update */
  156|   267k|            pu1_dst += 4 * dst_strd - wd; /* pointer update */
  157|   267k|        }
  158|       |
  159|  43.9k|    }
  160|  2.43M|    else if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (160:13): [True: 2.32M, False: 109k]
  ------------------
  161|  2.32M|    {
  162|  6.90M|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (162:22): [True: 4.57M, False: 2.32M]
  ------------------
  163|  4.57M|        {
  164|  9.17M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (164:26): [True: 4.59M, False: 4.57M]
  ------------------
  165|  4.59M|            {
  166|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  167|  4.59M|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  168|  4.59M|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  169|  4.59M|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  170|  4.59M|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  171|       |
  172|       |                /* storing 16 8-bit output values */
  173|  4.59M|                _mm_storel_epi64((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  174|  4.59M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  175|  4.59M|                _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  176|  4.59M|                _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  177|       |
  178|  4.59M|                pu1_src += 8; /* pointer update */
  179|  4.59M|                pu1_dst += 8; /* pointer update */
  180|  4.59M|            } /*  inner for loop ends here(8-output values in single iteration) */
  181|       |
  182|  4.57M|            pu1_src += 4 * src_strd - wd; /* pointer update */
  183|  4.57M|            pu1_dst += 4 * dst_strd - wd; /* pointer update */
  184|  4.57M|        }
  185|  2.32M|    }
  186|   109k|    else /* wd = multiple of 4 case */
  187|   109k|    {
  188|   109k|        WORD32 dst0, dst1, dst2, dst3;
  189|   312k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (189:22): [True: 202k, False: 109k]
  ------------------
  190|   202k|        {
  191|   429k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (191:26): [True: 226k, False: 202k]
  ------------------
  192|   226k|            {
  193|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  194|   226k|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  195|   226k|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  196|   226k|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  197|   226k|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  198|       |
  199|   226k|                dst0 = _mm_cvtsi128_si32(src0_16x8b);
  200|   226k|                dst1 = _mm_cvtsi128_si32(src1_16x8b);
  201|   226k|                dst2 = _mm_cvtsi128_si32(src2_16x8b);
  202|   226k|                dst3 = _mm_cvtsi128_si32(src3_16x8b);
  203|       |
  204|       |                /* storing 4 8-bit output values */
  205|   226k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0; /* row =0 */
  206|   226k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1; /* row =1 */
  207|   226k|                *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2; /* row =2 */
  208|   226k|                *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3; /* row =3 */
  209|       |
  210|   226k|                pu1_src += 4; /* pointer update */
  211|   226k|                pu1_dst += 4; /* pointer update */
  212|   226k|            } /*  inner for loop ends here(4- output values in single iteration) */
  213|       |
  214|   202k|            pu1_src += 4 * src_strd - wd; /* pointer update */
  215|   202k|            pu1_dst += 4 * dst_strd - wd; /* pointer update */
  216|   202k|        }
  217|   109k|    }
  218|  2.47M|}
ihevc_inter_pred_luma_horz_ssse3:
  268|  1.67M|{
  269|  1.67M|    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.67M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b;
  274|  1.67M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
  275|  1.67M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
  276|  1.67M|    __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.67M|    __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.67M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
  279|  1.67M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b, control_mask_3_8x16b, control_mask_4_8x16b;
  280|       |
  281|  1.67M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.67M|#define ASSERT(x) {}
  ------------------
  282|       |
  283|  1.67M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.67M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  284|  1.67M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.67M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  285|  1.67M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.67M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  286|  1.67M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.67M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  287|  1.67M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.67M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  288|  1.67M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.67M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  289|       |
  290|       |    /* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
  291|  1.67M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
  292|  1.67M|    zero_8x16b = _mm_set1_epi32(0);
  293|  1.67M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.67M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.67M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.67M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  294|       |
  295|  1.67M|    mask_low_32b = _mm_cmpeq_epi16(zero_8x16b, zero_8x16b);
  296|  1.67M|    mask_high_96b = _mm_srli_si128(mask_low_32b, 12);
  297|  1.67M|    mask_low_32b = _mm_slli_si128(mask_low_32b, 4);
  298|       |
  299|  1.67M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
  300|  1.67M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
  301|  1.67M|    control_mask_3_8x16b = _mm_set1_epi32(0x05040504); /* Control Mask register */
  302|  1.67M|    control_mask_4_8x16b = _mm_set1_epi32(0x07060706); /* Control Mask register */
  303|       |
  304|  1.67M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
  305|  1.67M|    coeff2_3_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_2_8x16b);  /* pi1_coeff[4] */
  306|       |
  307|  1.67M|    coeff4_5_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_3_8x16b);  /* pi1_coeff[4] */
  308|  1.67M|    coeff6_7_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_4_8x16b);  /* pi1_coeff[4] */
  309|       |
  310|  1.67M|    if(0 == (ht & 1)) /* ht multiple of 2 case */
  ------------------
  |  Branch (310:8): [True: 1.67M, False: 18.4E]
  ------------------
  311|  1.67M|    {
  312|       |
  313|  1.67M|        if(0 == (wd & 7)) /* wd = multiple of 8 case */
  ------------------
  |  Branch (313:12): [True: 1.63M, False: 38.7k]
  ------------------
  314|  1.63M|        {
  315|  8.22M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (315:26): [True: 6.59M, False: 1.63M]
  ------------------
  316|  6.59M|            {
  317|       |
  318|  6.59M|                int offset = 0;
  319|       |
  320|  6.59M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  6.59M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  321|  6.59M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  6.59M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  322|       |
  323|       |
  324|  13.8M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (324:30): [True: 7.21M, False: 6.59M]
  ------------------
  325|  7.21M|                {
  326|       |                    /*load 16 pixel values from row 0*/
  327|  7.21M|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));         /* row = 0 */
  328|       |
  329|       |                    /*load 16 pixel values from row 1*/
  330|  7.21M|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
  331|       |
  332|  7.21M|                    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|  7.21M|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  335|  7.21M|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
  336|       |                                                                                           /* row = 0 */
  337|  7.21M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  338|  7.21M|                    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|  7.21M|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  341|  7.21M|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
  342|       |
  343|  7.21M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  344|  7.21M|                    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|  7.21M|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  347|  7.21M|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
  348|       |
  349|  7.21M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  350|  7.21M|                    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|  7.21M|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  353|  7.21M|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
  354|       |
  355|  7.21M|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  356|  7.21M|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
  357|  7.21M|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
  358|       |
  359|  7.21M|                    res_temp6_8x16b = _mm_adds_epi16(res_temp5_8x16b, offset_8x16b);             /* row = 0 */
  360|  7.21M|                    res_temp6_8x16b = _mm_srai_epi16(res_temp6_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|  7.21M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  7.21M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  361|  7.21M|                    res_temp5_8x16b = _mm_packus_epi16(res_temp6_8x16b, res_temp6_8x16b);        /* row = 0 */
  362|       |
  363|  7.21M|                    _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp5_8x16b);
  364|       |
  365|  7.21M|                    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|  7.21M|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  368|  7.21M|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
  369|       |                                                                                              /* row = 1 */
  370|  7.21M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  371|  7.21M|                    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|  7.21M|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  374|  7.21M|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
  375|       |
  376|  7.21M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  377|  7.21M|                    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|  7.21M|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  380|  7.21M|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
  381|       |
  382|  7.21M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  383|  7.21M|                    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|  7.21M|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  386|  7.21M|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
  387|       |
  388|  7.21M|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
  389|  7.21M|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
  390|  7.21M|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
  391|       |
  392|  7.21M|                    res_temp16_8x16b = _mm_adds_epi16(res_temp15_8x16b, offset_8x16b);             /* row = 1 */
  393|  7.21M|                    res_temp16_8x16b = _mm_srai_epi16(res_temp16_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 1 */
  ------------------
  |  |   41|  7.21M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  7.21M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  394|  7.21M|                    res_temp15_8x16b = _mm_packus_epi16(res_temp16_8x16b, res_temp16_8x16b);       /* row = 1 */
  395|       |
  396|       |                    /* to store the 1st 4 pixels res. */
  397|  7.21M|                    _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp15_8x16b);
  398|       |
  399|  7.21M|                    offset += 8; /* To pointer updates*/
  400|  7.21M|                }
  401|  6.59M|                pu1_src += 2 * src_strd;  /* pointer updates*/
  402|  6.59M|                pu1_dst += 2 * dst_strd;  /* pointer updates*/
  403|  6.59M|            }
  404|  1.63M|        }
  405|  38.7k|        else /* wd = multiple of 4 case */
  406|  38.7k|        {
  407|   217k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (407:26): [True: 179k, False: 38.7k]
  ------------------
  408|   179k|            {
  409|   179k|                int offset = 0;
  410|       |
  411|   179k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   179k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  412|   179k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   179k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  413|       |
  414|       |
  415|   405k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (415:30): [True: 226k, False: 179k]
  ------------------
  416|   226k|                {
  417|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
  418|   226k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
  419|   226k|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
  420|       |
  421|   226k|                    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|   226k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  424|   226k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
  425|       |                                                                                           /* row = 0 */
  426|   226k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  427|   226k|                    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|   226k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  430|   226k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
  431|       |
  432|   226k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  433|   226k|                    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|   226k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  436|   226k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
  437|       |
  438|   226k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  439|   226k|                    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|   226k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  442|   226k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
  443|       |
  444|   226k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  445|   226k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
  446|   226k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
  447|       |
  448|   226k|                    res_temp6_8x16b = _mm_adds_epi16(res_temp5_8x16b, offset_8x16b);             /* row = 0 */
  449|   226k|                    res_temp6_8x16b = _mm_srai_epi16(res_temp6_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|   226k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   226k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  450|   226k|                    res_temp5_8x16b = _mm_packus_epi16(res_temp6_8x16b, res_temp6_8x16b);        /* row = 0 */
  451|       |
  452|   226k|                    res_temp7_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + offset));
  453|   226k|                    res_temp8_8x16b =  _mm_and_si128(res_temp7_8x16b, mask_low_32b);
  454|   226k|                    res_temp7_8x16b =  _mm_and_si128(res_temp5_8x16b, mask_high_96b);
  455|   226k|                    res_temp5_8x16b = _mm_or_si128(res_temp7_8x16b, res_temp8_8x16b);
  456|       |
  457|   226k|                    _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp5_8x16b);
  458|       |
  459|   226k|                    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|   226k|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  462|   226k|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
  463|       |                                                                                              /* row = 1 */
  464|   226k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  465|   226k|                    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|   226k|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  468|   226k|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
  469|       |
  470|   226k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  471|   226k|                    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|   226k|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  474|   226k|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
  475|       |
  476|   226k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  477|   226k|                    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|   226k|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  480|   226k|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
  481|       |
  482|   226k|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
  483|   226k|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
  484|   226k|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
  485|       |
  486|   226k|                    res_temp16_8x16b = _mm_adds_epi16(res_temp15_8x16b, offset_8x16b);             /* row = 1 */
  487|   226k|                    res_temp16_8x16b = _mm_srai_epi16(res_temp16_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 1 */
  ------------------
  |  |   41|   226k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   226k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  488|   226k|                    res_temp15_8x16b = _mm_packus_epi16(res_temp16_8x16b, res_temp16_8x16b);       /* row = 1 */
  489|       |
  490|   226k|                    res_temp17_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd + offset));
  491|   226k|                    res_temp18_8x16b =  _mm_and_si128(res_temp17_8x16b, mask_low_32b);
  492|   226k|                    res_temp17_8x16b =  _mm_and_si128(res_temp15_8x16b, mask_high_96b);
  493|   226k|                    res_temp15_8x16b = _mm_or_si128(res_temp17_8x16b, res_temp18_8x16b);
  494|       |
  495|       |                    /* to store the 1st 4 pixels res. */
  496|   226k|                    _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp15_8x16b);
  497|       |
  498|   226k|                    offset += 4; /* To pointer updates*/
  499|   226k|                }
  500|   179k|                pu1_src += 2 * src_strd;  /* Pointer update */
  501|   179k|                pu1_dst += 2 * dst_strd;  /* Pointer update */
  502|   179k|            }
  503|  38.7k|        }
  504|  1.67M|    }
  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.67M|}
ihevc_inter_pred_luma_vert_ssse3:
  761|  1.61M|{
  762|  1.61M|    WORD32 row, col;
  763|  1.61M|    UWORD8 *pu1_src_copy;
  764|  1.61M|    UWORD8 *pu1_dst_copy;
  765|  1.61M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
  766|  1.61M|    __m128i s0_8x16b, s1_8x16b, s2_8x16b, s3_8x16b, s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
  767|  1.61M|    __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.61M|    __m128i s3_0_16x8b, s3_1_16x8b, s3_2_16x8b, s3_3_16x8b, s3_4_16x8b;
  769|  1.61M|    __m128i s4_0_16x8b, s4_1_16x8b, s4_2_16x8b, s4_3_16x8b, s4_4_16x8b;
  770|  1.61M|    __m128i s10_8x16b, s11_8x16b, s12_8x16b, s13_8x16b, s14_8x16b, s15_8x16b, s16_8x16b, s17_8x16b, s18_8x16b, s19_8x16b;
  771|  1.61M|    __m128i s20_8x16b, s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b, s26_8x16b, s27_8x16b, s28_8x16b, s29_8x16b;
  772|  1.61M|    __m128i s30_8x16b, s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b, s36_8x16b, s37_8x16b, s38_8x16b, s39_8x16b;
  773|       |
  774|  1.61M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b;
  775|  1.61M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b, control_mask_3_8x16b, control_mask_4_8x16b;
  776|       |
  777|  1.61M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  778|  1.61M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  779|  1.61M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  780|  1.61M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  781|  1.61M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  782|  1.61M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  783|  1.61M|    PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  784|  1.61M|    PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.61M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  785|       |
  786|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
  787|  1.61M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
  788|       |
  789|  1.61M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
  790|  1.61M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
  791|  1.61M|    control_mask_3_8x16b = _mm_set1_epi32(0x05040504); /* Control Mask register */
  792|  1.61M|    control_mask_4_8x16b = _mm_set1_epi32(0x07060706); /* Control Mask register */
  793|       |
  794|  1.61M|    coeff0_1_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_1_8x16b);  /* pi1_coeff[4] */
  795|  1.61M|    coeff2_3_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_2_8x16b);  /* pi1_coeff[4] */
  796|       |
  797|  1.61M|    coeff4_5_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_3_8x16b);  /* pi1_coeff[4] */
  798|  1.61M|    coeff6_7_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_4_8x16b);  /* pi1_coeff[4] */
  799|       |
  800|       |/*  seting  values in register */
  801|  1.61M|    zero_8x16b = _mm_setzero_si128(); /* for saturated clipping */
  802|  1.61M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.61M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.61M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.61M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  1.61M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
  804|  1.61M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
  805|       |
  806|       |/*  outer for loop starts from here */
  807|  1.61M|    if(wd % 8 == 0)
  ------------------
  |  Branch (807:8): [True: 1.57M, False: 35.8k]
  ------------------
  808|  1.57M|    { /* wd = multiple of 8 case */
  809|       |
  810|  1.57M|        pu1_src_copy = pu1_src;
  811|  1.57M|        pu1_dst_copy = pu1_dst;
  812|       |
  813|  3.19M|        for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (813:22): [True: 1.62M, False: 1.57M]
  ------------------
  814|  1.62M|        {
  815|       |
  816|  1.62M|            pu1_src = pu1_src_copy + col;
  817|  1.62M|            pu1_dst = pu1_dst_copy + col;
  818|       |
  819|  1.62M|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.62M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  820|  1.62M|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.62M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  821|  1.62M|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.62M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  822|  1.62M|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.62M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  823|       |
  824|       |            /*load 8 pixel values.*/
  825|  1.62M|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
  826|       |
  827|       |            /*load 8 pixel values*/
  828|  1.62M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
  829|       |
  830|  1.62M|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
  831|       |
  832|  1.62M|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
  833|       |
  834|       |            /*load 8 pixel values*/
  835|  1.62M|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
  836|       |
  837|       |            /*load 8 pixel values*/
  838|  1.62M|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
  839|       |
  840|  1.62M|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
  841|       |
  842|  1.62M|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
  843|       |
  844|       |            /*load 8 pixel values*/
  845|  1.62M|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
  846|       |
  847|       |            /*load 8 pixel values*/
  848|  1.62M|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
  849|       |
  850|  1.62M|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
  851|       |
  852|  1.62M|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
  853|       |
  854|       |            /*load 8 pixel values*/
  855|  1.62M|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
  856|       |
  857|       |            /*load 8 pixel values*/
  858|  1.62M|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
  859|       |
  860|  1.62M|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
  861|       |
  862|  1.62M|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
  863|       |
  864|  1.62M|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
  865|  1.62M|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
  866|  1.62M|            s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
  867|       |
  868|  1.62M|            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.62M|            s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  872|       |
  873|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  874|  1.62M|            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.62M|            _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
  879|       |
  880|       |            /* ROW 2*/
  881|  1.62M|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
  882|  1.62M|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
  883|  1.62M|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
  884|       |
  885|       |            /*load 8 pixel values*/
  886|  1.62M|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
  887|       |
  888|       |            /*load 8 pixel values*/
  889|  1.62M|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
  890|       |
  891|  1.62M|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
  892|       |
  893|  1.62M|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
  894|       |
  895|  1.62M|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
  896|  1.62M|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
  897|  1.62M|            s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
  898|       |
  899|  1.62M|            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.62M|            s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  903|       |
  904|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  905|  1.62M|            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.62M|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
  910|       |
  911|       |
  912|       |            /*ROW 1*/
  913|  1.62M|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
  914|       |
  915|  1.62M|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
  916|       |
  917|  1.62M|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
  918|       |
  919|  1.62M|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
  920|       |
  921|  1.62M|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
  922|       |
  923|  1.62M|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
  924|       |
  925|  1.62M|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
  926|       |
  927|  1.62M|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
  928|       |
  929|  1.62M|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
  930|  1.62M|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
  931|  1.62M|            s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
  932|       |
  933|  1.62M|            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.62M|            s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  937|       |
  938|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  939|  1.62M|            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.62M|            _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd)), s19_8x16b);
  944|       |
  945|       |
  946|       |            /* ROW 3*/
  947|  1.62M|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
  948|  1.62M|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
  949|  1.62M|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
  950|       |
  951|       |            /*load 8 pixel values*/
  952|  1.62M|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
  953|       |
  954|  1.62M|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
  955|       |
  956|  1.62M|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
  957|       |
  958|  1.62M|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
  959|  1.62M|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
  960|  1.62M|            s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
  961|       |
  962|  1.62M|            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.62M|            s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  966|       |
  967|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  968|  1.62M|            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.62M|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
  973|       |
  974|  1.62M|            pu1_src += (8 * src_strd);
  975|  1.62M|            pu1_dst += (4 * dst_strd);
  976|       |
  977|  3.67M|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (977:26): [True: 2.05M, False: 1.62M]
  ------------------
  978|  2.05M|            {
  979|  2.05M|                PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.05M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  980|  2.05M|                PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.05M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  981|  2.05M|                PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.05M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  982|  2.05M|                PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.05M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  983|       |
  984|       |
  985|  2.05M|                s3_0_16x8b = s3_2_16x8b;
  986|  2.05M|                s3_1_16x8b = s3_3_16x8b;
  987|  2.05M|                s3_2_16x8b = s3_4_16x8b;
  988|       |
  989|  2.05M|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
  990|  2.05M|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
  991|  2.05M|                s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
  992|       |
  993|       |                /*load 8 pixel values from (cur_row + 4)th row*/
  994|  2.05M|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
  995|       |
  996|  2.05M|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
  997|  2.05M|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
  998|       |
  999|  2.05M|                s4_0_16x8b = s4_2_16x8b;
 1000|  2.05M|                s4_1_16x8b = s4_3_16x8b;
 1001|  2.05M|                s4_2_16x8b = s4_4_16x8b;
 1002|       |
 1003|  2.05M|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 1004|  2.05M|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 1005|  2.05M|                s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 1006|       |
 1007|  2.05M|                s7_8x16b = _mm_add_epi16(s6_8x16b, offset_8x16b);
 1008|       |
 1009|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1010|  2.05M|                s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.05M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.05M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1011|       |
 1012|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1013|  2.05M|                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|  2.05M|                _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 1018|       |
 1019|       |                /* row + 2*/
 1020|  2.05M|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 1021|  2.05M|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 1022|  2.05M|                s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 1023|       |
 1024|       |                /*load 8 pixel values from (cur_row + 5)th row*/
 1025|  2.05M|                s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1026|       |
 1027|       |                /*load 8 pixel values from (cur_row + 6)th row*/
 1028|  2.05M|                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|  2.05M|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 1032|       |
 1033|  2.05M|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 1034|       |
 1035|  2.05M|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 1036|  2.05M|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 1037|  2.05M|                s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 1038|       |
 1039|  2.05M|                s27_8x16b = _mm_add_epi16(s26_8x16b, offset_8x16b);
 1040|       |
 1041|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1042|  2.05M|                s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.05M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.05M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1043|       |
 1044|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1045|  2.05M|                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|  2.05M|                _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
 1050|       |
 1051|       |
 1052|       |                /*row + 1*/
 1053|  2.05M|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 1054|  2.05M|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 1055|  2.05M|                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|  2.05M|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 1059|  2.05M|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 1060|       |
 1061|  2.05M|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 1062|  2.05M|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 1063|  2.05M|                s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 1064|       |
 1065|  2.05M|                s17_8x16b = _mm_add_epi16(s16_8x16b, offset_8x16b);
 1066|       |
 1067|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1068|  2.05M|                s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.05M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.05M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1069|       |
 1070|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1071|  2.05M|                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|  2.05M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s19_8x16b);
 1076|       |
 1077|       |
 1078|       |                /* row + 3*/
 1079|  2.05M|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 1080|  2.05M|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 1081|  2.05M|                s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 1082|       |
 1083|       |                /*load 8 pixel values from (cur_row + 7)th row*/
 1084|  2.05M|                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|  2.05M|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 1088|       |
 1089|  2.05M|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 1090|       |
 1091|  2.05M|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 1092|  2.05M|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 1093|  2.05M|                s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 1094|       |
 1095|  2.05M|                s37_8x16b = _mm_add_epi16(s36_8x16b, offset_8x16b);
 1096|       |
 1097|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1098|  2.05M|                s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.05M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.05M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1099|       |
 1100|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1101|  2.05M|                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|  2.05M|                _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
 1106|       |
 1107|  2.05M|                s2_10_16x8b = s2_3_16x8b;
 1108|       |
 1109|  2.05M|                pu1_src += 4 * src_strd; /* pointer update */
 1110|  2.05M|                pu1_dst += 4 * dst_strd; /* pointer update */
 1111|  2.05M|            }
 1112|  1.62M|        }
 1113|  1.57M|    }
 1114|  35.8k|    else /* wd = multiple of 8 case */
 1115|  35.8k|    {
 1116|       |
 1117|  35.8k|        pu1_src_copy = pu1_src;
 1118|  35.8k|        pu1_dst_copy = pu1_dst;
 1119|       |
 1120|  77.3k|        for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1120:22): [True: 41.4k, False: 35.8k]
  ------------------
 1121|  41.4k|        {
 1122|       |
 1123|  41.4k|            pu1_src = pu1_src_copy + col;
 1124|  41.4k|            pu1_dst = pu1_dst_copy + col;
 1125|       |
 1126|  41.4k|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  41.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1127|  41.4k|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  41.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1128|  41.4k|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  41.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1129|  41.4k|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  41.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1130|       |
 1131|       |
 1132|       |            /*load 8 pixel values */
 1133|  41.4k|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
 1134|       |
 1135|       |            /*load 8 pixel values */
 1136|  41.4k|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
 1137|       |
 1138|  41.4k|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 1139|       |
 1140|  41.4k|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 1141|       |
 1142|       |            /*load 8 pixel values */
 1143|  41.4k|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 1144|       |
 1145|       |            /*load 8 pixel values */
 1146|  41.4k|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 1147|       |
 1148|  41.4k|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 1149|       |
 1150|  41.4k|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 1151|       |
 1152|       |            /*load 8 pixel values */
 1153|  41.4k|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 1154|       |
 1155|       |            /*load 8 pixel values */
 1156|  41.4k|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 1157|       |
 1158|  41.4k|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
 1159|       |
 1160|  41.4k|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 1161|       |
 1162|       |            /*load 8 pixel values */
 1163|  41.4k|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 1164|       |
 1165|       |            /*load 8 pixel values */
 1166|  41.4k|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
 1167|       |
 1168|  41.4k|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
 1169|       |
 1170|  41.4k|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 1171|       |
 1172|  41.4k|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 1173|  41.4k|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 1174|  41.4k|            s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 1175|       |
 1176|  41.4k|            s7_8x16b = _mm_add_epi16(s6_8x16b, offset_8x16b);
 1177|       |
 1178|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1179|  41.4k|            s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  41.4k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  41.4k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1180|       |
 1181|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1182|  41.4k|            s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 1183|  41.4k|            s5_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 1184|  41.4k|            s6_8x16b =  _mm_and_si128(s5_8x16b, mask_low_32b);
 1185|  41.4k|            s7_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 1186|  41.4k|            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|  41.4k|            _mm_storel_epi64((__m128i *)(pu1_dst), s8_8x16b);
 1190|       |
 1191|       |            /* ROW 2*/
 1192|  41.4k|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 1193|  41.4k|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 1194|  41.4k|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 1195|       |
 1196|       |            /*load 8 pixel values */
 1197|  41.4k|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
 1198|       |
 1199|       |            /*load 8 pixel values */
 1200|  41.4k|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
 1201|       |
 1202|  41.4k|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
 1203|       |
 1204|  41.4k|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 1205|       |
 1206|  41.4k|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 1207|  41.4k|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 1208|  41.4k|            s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 1209|       |
 1210|  41.4k|            s27_8x16b = _mm_add_epi16(s26_8x16b, offset_8x16b);
 1211|       |
 1212|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1213|  41.4k|            s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  41.4k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  41.4k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1214|       |
 1215|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1216|  41.4k|            s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 1217|  41.4k|            s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 1218|  41.4k|            s26_8x16b =  _mm_and_si128(s25_8x16b, mask_low_32b);
 1219|  41.4k|            s27_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 1220|  41.4k|            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|  41.4k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s28_8x16b);
 1224|       |
 1225|       |
 1226|       |            /*ROW 1*/
 1227|  41.4k|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 1228|       |
 1229|  41.4k|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 1230|       |
 1231|  41.4k|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
 1232|       |
 1233|  41.4k|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 1234|       |
 1235|  41.4k|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
 1236|       |
 1237|  41.4k|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 1238|       |
 1239|  41.4k|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
 1240|       |
 1241|  41.4k|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 1242|       |
 1243|  41.4k|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 1244|  41.4k|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 1245|  41.4k|            s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 1246|       |
 1247|  41.4k|            s17_8x16b = _mm_add_epi16(s16_8x16b, offset_8x16b);
 1248|       |
 1249|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1250|  41.4k|            s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  41.4k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  41.4k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1251|       |
 1252|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1253|  41.4k|            s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 1254|  41.4k|            s15_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 1255|  41.4k|            s16_8x16b =  _mm_and_si128(s15_8x16b, mask_low_32b);
 1256|  41.4k|            s17_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 1257|  41.4k|            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|  41.4k|            _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd)), s18_8x16b);
 1261|       |
 1262|       |
 1263|       |            /* ROW 3*/
 1264|  41.4k|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 1265|  41.4k|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 1266|  41.4k|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 1267|       |
 1268|       |            /*load 8 pixel values */
 1269|  41.4k|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
 1270|       |
 1271|  41.4k|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
 1272|       |
 1273|  41.4k|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 1274|       |
 1275|  41.4k|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 1276|  41.4k|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 1277|  41.4k|            s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 1278|       |
 1279|  41.4k|            s37_8x16b = _mm_add_epi16(s36_8x16b, offset_8x16b);
 1280|       |
 1281|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1282|  41.4k|            s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  41.4k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  41.4k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1283|       |
 1284|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1285|  41.4k|            s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 1286|       |
 1287|  41.4k|            s35_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 1288|  41.4k|            s36_8x16b =  _mm_and_si128(s35_8x16b, mask_low_32b);
 1289|  41.4k|            s37_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 1290|  41.4k|            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|  41.4k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s38_8x16b);
 1295|       |
 1296|  41.4k|            pu1_src += (8 * src_strd);
 1297|  41.4k|            pu1_dst += (4 * dst_strd);
 1298|       |
 1299|  99.0k|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (1299:26): [True: 57.6k, False: 41.4k]
  ------------------
 1300|  57.6k|            {
 1301|       |
 1302|  57.6k|                PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  57.6k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1303|  57.6k|                PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  57.6k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1304|  57.6k|                PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  57.6k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1305|  57.6k|                PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  57.6k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1306|       |
 1307|       |
 1308|  57.6k|                s3_0_16x8b = s3_2_16x8b;
 1309|  57.6k|                s3_1_16x8b = s3_3_16x8b;
 1310|  57.6k|                s3_2_16x8b = s3_4_16x8b;
 1311|       |
 1312|  57.6k|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 1313|  57.6k|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 1314|  57.6k|                s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 1315|       |
 1316|       |                /*load 16 pixel values from (cur_row + 4)th row*/
 1317|  57.6k|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 1318|       |
 1319|  57.6k|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
 1320|  57.6k|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 1321|       |
 1322|  57.6k|                s4_0_16x8b = s4_2_16x8b;
 1323|  57.6k|                s4_1_16x8b = s4_3_16x8b;
 1324|  57.6k|                s4_2_16x8b = s4_4_16x8b;
 1325|       |
 1326|  57.6k|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 1327|  57.6k|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 1328|  57.6k|                s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 1329|       |
 1330|  57.6k|                s7_8x16b = _mm_add_epi16(s6_8x16b, offset_8x16b);
 1331|       |
 1332|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1333|  57.6k|                s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  57.6k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  57.6k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1334|       |
 1335|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1336|  57.6k|                s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 1337|       |
 1338|  57.6k|                s5_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 1339|  57.6k|                s6_8x16b =  _mm_and_si128(s5_8x16b, mask_low_32b);
 1340|  57.6k|                s7_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 1341|  57.6k|                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|  57.6k|                _mm_storel_epi64((__m128i *)(pu1_dst), s8_8x16b);
 1346|       |
 1347|       |                /* row + 2*/
 1348|  57.6k|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 1349|  57.6k|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 1350|  57.6k|                s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 1351|       |
 1352|       |                /*load 16 pixel values from (cur_row + 5)th row*/
 1353|  57.6k|                s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1354|       |
 1355|       |                /*load 16 pixel values from (cur_row + 6)th row*/
 1356|  57.6k|                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|  57.6k|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 1360|       |
 1361|  57.6k|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 1362|       |
 1363|  57.6k|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 1364|  57.6k|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 1365|  57.6k|                s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 1366|       |
 1367|  57.6k|                s27_8x16b = _mm_add_epi16(s26_8x16b, offset_8x16b);
 1368|       |
 1369|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1370|  57.6k|                s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  57.6k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  57.6k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1371|       |
 1372|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1373|  57.6k|                s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 1374|       |
 1375|  57.6k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 1376|  57.6k|                s26_8x16b =  _mm_and_si128(s25_8x16b, mask_low_32b);
 1377|  57.6k|                s27_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 1378|  57.6k|                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|  57.6k|                _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s28_8x16b);
 1383|       |
 1384|       |
 1385|       |                /*row + 1*/
 1386|  57.6k|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 1387|  57.6k|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 1388|  57.6k|                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|  57.6k|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 1392|  57.6k|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 1393|       |
 1394|  57.6k|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 1395|  57.6k|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 1396|  57.6k|                s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 1397|       |
 1398|  57.6k|                s17_8x16b = _mm_add_epi16(s16_8x16b, offset_8x16b);
 1399|       |
 1400|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1401|  57.6k|                s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  57.6k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  57.6k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1402|       |
 1403|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1404|  57.6k|                s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 1405|       |
 1406|  57.6k|                s15_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 1407|  57.6k|                s16_8x16b =  _mm_and_si128(s15_8x16b, mask_low_32b);
 1408|  57.6k|                s17_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 1409|  57.6k|                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|  57.6k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s18_8x16b);
 1414|       |
 1415|       |
 1416|       |                /* row + 3*/
 1417|  57.6k|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 1418|  57.6k|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 1419|  57.6k|                s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 1420|       |
 1421|       |                /*load 16 pixel values from (cur_row + 7)th row*/
 1422|  57.6k|                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|  57.6k|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 1426|       |
 1427|  57.6k|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 1428|       |
 1429|  57.6k|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 1430|  57.6k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 1431|  57.6k|                s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 1432|       |
 1433|  57.6k|                s37_8x16b = _mm_add_epi16(s36_8x16b, offset_8x16b);
 1434|       |
 1435|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1436|  57.6k|                s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  57.6k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  57.6k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1437|       |
 1438|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1439|  57.6k|                s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 1440|       |
 1441|  57.6k|                s35_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 1442|  57.6k|                s36_8x16b =  _mm_and_si128(s35_8x16b, mask_low_32b);
 1443|  57.6k|                s37_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 1444|  57.6k|                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|  57.6k|                _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s38_8x16b);
 1449|       |
 1450|  57.6k|                s2_10_16x8b = s2_3_16x8b;
 1451|       |
 1452|  57.6k|                pu1_src += 4 * src_strd; /* pointer update */
 1453|  57.6k|                pu1_dst += 4 * dst_strd; /* pointer update */
 1454|  57.6k|            }
 1455|  41.4k|        }
 1456|  35.8k|    }
 1457|  1.61M|}
ihevc_inter_pred_luma_copy_w16out_ssse3:
 1507|  41.7M|{
 1508|  41.7M|    WORD32 row, col;
 1509|  41.7M|    __m128i  s3, zero_8x16b;
 1510|       |
 1511|  41.7M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  41.7M|#define ASSERT(x) {}
  ------------------
 1512|  41.7M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  41.7M|#define ASSERT(x) {}
  ------------------
 1513|  41.7M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  41.7M|#define UNUSED(x) ((void)(x))
  ------------------
 1514|  41.7M|    zero_8x16b = _mm_setzero_si128();
 1515|       |/*  outer for loop starts from here */
 1516|  41.7M|    if(wd % 8 == 0) /* wd = multiple of 8 case */
  ------------------
  |  Branch (1516:8): [True: 41.6M, False: 17.2k]
  ------------------
 1517|  41.6M|    {
 1518|   211M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1518:22): [True: 169M, False: 41.6M]
  ------------------
 1519|   169M|        {
 1520|   169M|            int offset = 0;
 1521|   356M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1521:26): [True: 186M, False: 169M]
  ------------------
 1522|   186M|            {
 1523|       |/* row =0 */
 1524|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 1525|   186M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 1526|   186M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1527|       |
 1528|   186M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   186M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   186M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1529|       |
 1530|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1531|   186M|                _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|   186M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col] */
 1536|   186M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1537|       |
 1538|   186M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   186M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   186M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1539|       |
 1540|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1541|   186M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd + offset), s3);
 1542|       |
 1543|   186M|                offset += 8; /* To pointer update */
 1544|   186M|            } /* inner for loop ends here(8-output values in single iteration) */
 1545|       |
 1546|   169M|            pu1_src += 2 * src_strd; /* pointer update */
 1547|   169M|            pi2_dst += 2 * dst_strd; /* pointer update */
 1548|   169M|        }
 1549|  41.6M|    }
 1550|  17.2k|    else /* wd = multiple of 4 case */
 1551|  17.2k|    {
 1552|   183k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1552:22): [True: 165k, False: 17.2k]
  ------------------
 1553|   165k|        {
 1554|   165k|            int offset = 0;
 1555|   472k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1555:26): [True: 306k, False: 165k]
  ------------------
 1556|   306k|            {
 1557|       |/* row =0 */
 1558|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 1559|   306k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 1560|   306k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1561|       |
 1562|   306k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   306k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   306k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1563|       |
 1564|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1565|   306k|                _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|   306k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col] */
 1570|   306k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1571|       |
 1572|   306k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   306k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   306k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1573|       |
 1574|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1575|   306k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), s3);
 1576|   306k|                offset += 4; /* To pointer update */
 1577|   306k|            } /* inner for loop ends here(4-output values in single iteration) */
 1578|       |
 1579|   165k|            pu1_src += 2 * src_strd; /* pointer update */
 1580|   165k|            pi2_dst += 2 * dst_strd; /* pointer update */
 1581|   165k|        }
 1582|  17.2k|    }
 1583|       |
 1584|  41.7M|}
ihevc_inter_pred_luma_horz_w16out_ssse3:
 1633|  9.65M|{
 1634|  9.65M|    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|  9.65M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
 1640|  9.65M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
 1641|  9.65M|    __m128i res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b, res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b;
 1642|  9.65M|    __m128i res_temp11_8x16b, res_temp12_8x16b, res_temp13_8x16b, res_temp14_8x16b, res_temp15_8x16b, res_temp16_8x16b;
 1643|  9.65M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
 1644|  9.65M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b, control_mask_3_8x16b, control_mask_4_8x16b;
 1645|       |
 1646|  9.65M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  9.65M|#define ASSERT(x) {}
  ------------------
 1647|       |
 1648|  9.65M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  9.65M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1649|  9.65M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  9.65M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1650|  9.65M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  9.65M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1651|  9.65M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  9.65M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1652|  9.65M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  9.65M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1653|  9.65M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  9.65M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1654|       |
 1655|       |    /* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 1656|  9.65M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 1657|       |
 1658|       |
 1659|  9.65M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 1660|  9.65M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 1661|  9.65M|    control_mask_3_8x16b = _mm_set1_epi32(0x05040504); /* Control Mask register */
 1662|  9.65M|    control_mask_4_8x16b = _mm_set1_epi32(0x07060706); /* Control Mask register */
 1663|       |
 1664|  9.65M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 1665|  9.65M|    coeff2_3_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 1666|       |
 1667|  9.65M|    coeff4_5_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_3_8x16b);  /* pi1_coeff[4] */
 1668|  9.65M|    coeff6_7_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_4_8x16b);  /* pi1_coeff[4] */
 1669|       |
 1670|  9.65M|    if(0 == (ht & 1)) /* ht multiple of 2 case */
  ------------------
  |  Branch (1670:8): [True: 3.12M, False: 6.52M]
  ------------------
 1671|  3.12M|    {
 1672|       |
 1673|  3.12M|        if(0 == (wd & 7)) /* wd = multiple of 8 case */
  ------------------
  |  Branch (1673:12): [True: 3.11M, False: 15.0k]
  ------------------
 1674|  3.11M|        {
 1675|  16.1M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1675:26): [True: 13.0M, False: 3.11M]
  ------------------
 1676|  13.0M|            {
 1677|       |
 1678|  13.0M|                int offset = 0;
 1679|       |
 1680|  13.0M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.0M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1681|  13.0M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.0M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1682|       |
 1683|       |
 1684|       |
 1685|  28.5M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1685:30): [True: 15.5M, False: 13.0M]
  ------------------
 1686|  15.5M|                {
 1687|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1688|  15.5M|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
 1689|  15.5M|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
 1690|       |
 1691|  15.5M|                    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|  15.5M|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1694|  15.5M|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1695|       |                    /* row = 0 */
 1696|  15.5M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1697|  15.5M|                    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|  15.5M|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1700|  15.5M|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1701|       |
 1702|  15.5M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1703|  15.5M|                    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|  15.5M|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1706|  15.5M|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1707|       |
 1708|  15.5M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1709|  15.5M|                    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|  15.5M|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1712|  15.5M|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1713|       |
 1714|  15.5M|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1715|  15.5M|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1716|  15.5M|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1717|       |
 1718|  15.5M|                    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|  15.5M|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1721|  15.5M|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
 1722|       |                                                                                              /* row = 1 */
 1723|  15.5M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1724|  15.5M|                    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|  15.5M|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1727|  15.5M|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
 1728|       |
 1729|  15.5M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1730|  15.5M|                    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|  15.5M|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1733|  15.5M|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
 1734|       |
 1735|  15.5M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1736|  15.5M|                    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|  15.5M|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1739|  15.5M|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
 1740|       |
 1741|  15.5M|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 1742|  15.5M|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
 1743|  15.5M|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
 1744|       |
 1745|       |                    /* to store the 1st 4 pixels res. */
 1746|  15.5M|                    _mm_store_si128((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1747|  15.5M|                    _mm_store_si128((__m128i *)(pi2_dst + dst_strd + offset), res_temp15_8x16b);
 1748|       |
 1749|  15.5M|                    offset += 8; /* To pointer updates*/
 1750|  15.5M|                }
 1751|  13.0M|                pu1_src += 2 * src_strd;  /* pointer updates*/
 1752|  13.0M|                pi2_dst += 2 * dst_strd;  /* pointer updates*/
 1753|  13.0M|            }
 1754|  3.11M|        }
 1755|  15.0k|        else /* wd = multiple of 4 case */
 1756|  15.0k|        {
 1757|  86.5k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1757:26): [True: 71.4k, False: 15.0k]
  ------------------
 1758|  71.4k|            {
 1759|  71.4k|                int offset = 0;
 1760|       |
 1761|  71.4k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  71.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1762|  71.4k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  71.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1763|       |
 1764|       |
 1765|   205k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1765:30): [True: 133k, False: 71.4k]
  ------------------
 1766|   133k|                {
 1767|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1768|   133k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
 1769|   133k|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
 1770|       |
 1771|   133k|                    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|   133k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1774|   133k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1775|       |                    /* row = 0 */
 1776|   133k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1777|   133k|                    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|   133k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1780|   133k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1781|       |
 1782|   133k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1783|   133k|                    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|   133k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1786|   133k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1787|       |
 1788|   133k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1789|   133k|                    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|   133k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1792|   133k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1793|       |
 1794|   133k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1795|   133k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1796|   133k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1797|       |
 1798|   133k|                    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|   133k|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1801|   133k|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
 1802|       |                                                                                              /* row = 1 */
 1803|   133k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1804|   133k|                    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|   133k|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1807|   133k|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
 1808|       |
 1809|   133k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1810|   133k|                    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|   133k|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1813|   133k|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
 1814|       |
 1815|   133k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1816|   133k|                    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|   133k|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1819|   133k|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
 1820|       |
 1821|   133k|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 1822|   133k|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
 1823|   133k|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
 1824|       |
 1825|       |                    /* to store the 1st 4 pixels res. */
 1826|   133k|                    _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1827|   133k|                    _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), res_temp15_8x16b);
 1828|       |
 1829|   133k|                    offset += 4; /* To pointer updates*/
 1830|   133k|                }
 1831|  71.4k|                pu1_src += 2 * src_strd;  /* Pointer update */
 1832|  71.4k|                pi2_dst += 2 * dst_strd;  /* Pointer update */
 1833|  71.4k|            }
 1834|  15.0k|        }
 1835|  3.12M|    }
 1836|  6.52M|    else /* odd ht */
 1837|  6.52M|    {
 1838|  6.52M|        if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (1838:12): [True: 6.48M, False: 44.9k]
  ------------------
 1839|  6.48M|        {
 1840|   105M|            for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1840:26): [True: 98.6M, False: 6.48M]
  ------------------
 1841|  98.6M|            {
 1842|  98.6M|                int offset = 0;
 1843|       |
 1844|  98.6M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  98.6M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1845|       |
 1846|       |
 1847|   209M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1847:30): [True: 110M, False: 98.6M]
  ------------------
 1848|   110M|                {
 1849|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1850|   110M|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));  /* row = 0 */
 1851|       |
 1852|   110M|                    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|   110M|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1855|   110M|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1856|       |                    /* row = 0 */
 1857|   110M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1858|   110M|                    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|   110M|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1861|   110M|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1862|       |
 1863|   110M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1864|   110M|                    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|   110M|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1867|   110M|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1868|       |
 1869|   110M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1870|   110M|                    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|   110M|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1873|   110M|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1874|       |
 1875|   110M|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1876|   110M|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1877|   110M|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1878|       |
 1879|       |                    /* to store the 1st 4 pixels res. */
 1880|   110M|                    _mm_store_si128((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1881|       |
 1882|   110M|                    offset += 8; /* To pointer updates*/
 1883|   110M|                }
 1884|  98.6M|                pu1_src += src_strd;    /* pointer updates*/
 1885|  98.6M|                pi2_dst += dst_strd;    /* pointer updates*/
 1886|  98.6M|            }
 1887|  6.48M|        }
 1888|  44.9k|        else  /* wd = multiple of 4 case */
 1889|  44.9k|        {
 1890|   618k|            for(row = 0; row < (ht - 1); row += 2)
  ------------------
  |  Branch (1890:26): [True: 573k, False: 44.9k]
  ------------------
 1891|   573k|            {
 1892|   573k|                int offset = 0;
 1893|       |
 1894|       |
 1895|   573k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   573k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1896|   573k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   573k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1897|       |
 1898|       |
 1899|  1.32M|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1899:30): [True: 752k, False: 573k]
  ------------------
 1900|   752k|                {
 1901|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1902|   752k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
 1903|   752k|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
 1904|       |
 1905|   752k|                    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|   752k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1908|   752k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1909|       |                                                                                           /* row = 0 */
 1910|   752k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1911|   752k|                    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|   752k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1914|   752k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1915|       |
 1916|   752k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1917|   752k|                    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|   752k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1920|   752k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1921|       |
 1922|   752k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1923|   752k|                    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|   752k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1926|   752k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1927|       |
 1928|   752k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1929|   752k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1930|   752k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1931|       |
 1932|   752k|                    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|   752k|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1935|   752k|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
 1936|       |                                                                                              /* row = 1 */
 1937|   752k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1938|   752k|                    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|   752k|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1941|   752k|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
 1942|       |
 1943|   752k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1944|   752k|                    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|   752k|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1947|   752k|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
 1948|       |
 1949|   752k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1950|   752k|                    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|   752k|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1953|   752k|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
 1954|       |
 1955|   752k|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 1956|   752k|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
 1957|   752k|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
 1958|       |
 1959|       |                    /* to store the 1st 4 pixels res. */
 1960|   752k|                    _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1961|   752k|                    _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), res_temp15_8x16b);
 1962|       |
 1963|   752k|                    offset += 4; /* To pointer updates*/
 1964|   752k|                }
 1965|   573k|                pu1_src += 2 * src_strd;  /* Pointer update */
 1966|   573k|                pi2_dst += 2 * dst_strd;  /* Pointer update */
 1967|   573k|            }
 1968|  44.9k|            { /* last repeat at outside the loop */
 1969|  44.9k|                int offset = 0;
 1970|   134k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1970:30): [True: 89.2k, False: 44.9k]
  ------------------
 1971|  89.2k|                {
 1972|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1973|  89.2k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));  /* row = 0 */
 1974|       |
 1975|  89.2k|                    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|  89.2k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1978|  89.2k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1979|       |                                                                                           /* row = 0 */
 1980|  89.2k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1981|  89.2k|                    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|  89.2k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1984|  89.2k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1985|       |
 1986|  89.2k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1987|  89.2k|                    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|  89.2k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1990|  89.2k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1991|       |
 1992|  89.2k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1993|  89.2k|                    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|  89.2k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1996|  89.2k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1997|       |
 1998|  89.2k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1999|  89.2k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 2000|  89.2k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 2001|       |
 2002|       |                    /* to store the 1st 4 pixels res. */
 2003|  89.2k|                    _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 2004|       |
 2005|  89.2k|                    offset += 4; /* To pointer updates*/
 2006|  89.2k|                }
 2007|  44.9k|            }
 2008|  44.9k|        }
 2009|  6.52M|    }
 2010|  9.65M|}
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.22M, False: 7.85k]
  ------------------
 2092|  4.22M|    { /* wd = multiple of 8 case */
 2093|       |
 2094|  4.22M|        pu1_src_copy = pu1_src;
 2095|  4.22M|        pi2_dst_copy = pi2_dst;
 2096|       |
 2097|  8.60M|        for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (2097:22): [True: 4.38M, False: 4.22M]
  ------------------
 2098|  4.38M|        {
 2099|       |
 2100|  4.38M|            pu1_src = pu1_src_copy + col;
 2101|  4.38M|            pi2_dst = pi2_dst_copy + col;
 2102|       |
 2103|  4.38M|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.38M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2104|  4.38M|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.38M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2105|  4.38M|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.38M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2106|  4.38M|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.38M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2107|       |
 2108|       |            /*load 8 pixel values */
 2109|  4.38M|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
 2110|       |
 2111|       |            /*load 8 pixel values */
 2112|  4.38M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
 2113|       |
 2114|  4.38M|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2115|       |
 2116|  4.38M|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2117|       |
 2118|       |            /*load 8 pixel values */
 2119|  4.38M|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 2120|       |
 2121|       |            /*load 8 pixel values */
 2122|  4.38M|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 2123|       |
 2124|  4.38M|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2125|       |
 2126|  4.38M|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2127|       |
 2128|       |            /*load 8 pixel values */
 2129|  4.38M|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 2130|       |
 2131|       |            /*load 8 pixel values */
 2132|  4.38M|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 2133|       |
 2134|  4.38M|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
 2135|       |
 2136|  4.38M|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2137|       |
 2138|       |            /*load 8 pixel values */
 2139|  4.38M|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 2140|       |
 2141|       |            /*load 8 pixel values */
 2142|  4.38M|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
 2143|       |
 2144|  4.38M|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
 2145|       |
 2146|  4.38M|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2147|       |
 2148|  4.38M|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2149|  4.38M|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2150|  4.38M|            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.38M|            _mm_store_si128((__m128i *)(pi2_dst), s6_8x16b);
 2155|       |
 2156|       |            /* ROW 2*/
 2157|  4.38M|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2158|  4.38M|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2159|  4.38M|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2160|       |
 2161|       |            /*load 8 pixel values */
 2162|  4.38M|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
 2163|       |
 2164|       |            /*load 8 pixel values */
 2165|  4.38M|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
 2166|       |
 2167|  4.38M|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
 2168|       |
 2169|  4.38M|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2170|       |
 2171|  4.38M|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2172|  4.38M|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2173|  4.38M|            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.38M|            _mm_store_si128((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2178|       |
 2179|       |
 2180|       |            /*ROW 1*/
 2181|  4.38M|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2182|       |
 2183|  4.38M|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2184|       |
 2185|  4.38M|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
 2186|       |
 2187|  4.38M|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2188|       |
 2189|  4.38M|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
 2190|       |
 2191|  4.38M|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2192|       |
 2193|  4.38M|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
 2194|       |
 2195|  4.38M|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2196|       |
 2197|  4.38M|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2198|  4.38M|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2199|  4.38M|            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.38M|            _mm_store_si128((__m128i *)(pi2_dst + (dst_strd)), s16_8x16b);
 2205|       |
 2206|       |
 2207|       |            /* ROW 3*/
 2208|  4.38M|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2209|  4.38M|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2210|  4.38M|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2211|       |
 2212|       |            /*load 8 pixel values */
 2213|  4.38M|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
 2214|       |
 2215|  4.38M|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
 2216|       |
 2217|  4.38M|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2218|       |
 2219|  4.38M|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2220|  4.38M|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2221|  4.38M|            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.38M|            _mm_store_si128((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2227|       |
 2228|  4.38M|            pu1_src += (8 * src_strd);
 2229|  4.38M|            pi2_dst += (4 * dst_strd);
 2230|       |
 2231|  10.2M|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (2231:26): [True: 5.87M, False: 4.38M]
  ------------------
 2232|  5.87M|            {
 2233|       |
 2234|  5.87M|                PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.87M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2235|  5.87M|                PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.87M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2236|  5.87M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.87M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2237|  5.87M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.87M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2238|       |
 2239|  5.87M|                s3_0_16x8b = s3_2_16x8b;
 2240|  5.87M|                s3_1_16x8b = s3_3_16x8b;
 2241|  5.87M|                s3_2_16x8b = s3_4_16x8b;
 2242|       |
 2243|  5.87M|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2244|  5.87M|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2245|  5.87M|                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.87M|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2249|       |
 2250|  5.87M|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
 2251|  5.87M|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2252|       |
 2253|  5.87M|                s4_0_16x8b = s4_2_16x8b;
 2254|  5.87M|                s4_1_16x8b = s4_3_16x8b;
 2255|  5.87M|                s4_2_16x8b = s4_4_16x8b;
 2256|       |
 2257|  5.87M|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2258|  5.87M|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2259|  5.87M|                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.87M|                _mm_store_si128((__m128i *)(pi2_dst), s6_8x16b);
 2264|       |
 2265|       |                /* row + 2*/
 2266|  5.87M|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2267|  5.87M|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2268|  5.87M|                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.87M|                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.87M|                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.87M|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2278|       |
 2279|  5.87M|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2280|       |
 2281|  5.87M|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2282|  5.87M|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2283|  5.87M|                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.87M|                _mm_store_si128((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2288|       |
 2289|       |
 2290|       |                /*row + 1*/
 2291|  5.87M|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2292|  5.87M|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2293|  5.87M|                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.87M|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2297|  5.87M|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2298|       |
 2299|  5.87M|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2300|  5.87M|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2301|  5.87M|                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.87M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s16_8x16b);
 2307|       |
 2308|       |
 2309|       |                /* row + 3*/
 2310|  5.87M|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2311|  5.87M|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2312|  5.87M|                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.87M|                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.87M|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2319|       |
 2320|  5.87M|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2321|       |
 2322|  5.87M|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2323|  5.87M|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2324|  5.87M|                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.87M|                _mm_store_si128((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2329|       |
 2330|  5.87M|                s2_10_16x8b = s2_3_16x8b;
 2331|       |
 2332|       |
 2333|  5.87M|                pu1_src += 4 * src_strd; /* pointer update */
 2334|  5.87M|                pi2_dst += 4 * dst_strd; /* pointer update */
 2335|  5.87M|            }
 2336|  4.38M|        }
 2337|  4.22M|    }
 2338|  7.85k|    else /* wd = multiple of 8 case */
 2339|  7.85k|    {
 2340|       |
 2341|  7.85k|        pu1_src_copy = pu1_src;
 2342|  7.85k|        pi2_dst_copy = pi2_dst;
 2343|       |
 2344|  21.3k|        for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (2344:22): [True: 13.4k, False: 7.85k]
  ------------------
 2345|  13.4k|        {
 2346|       |
 2347|  13.4k|            pu1_src = pu1_src_copy + col;
 2348|  13.4k|            pi2_dst = pi2_dst_copy + col;
 2349|       |
 2350|  13.4k|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2351|  13.4k|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2352|  13.4k|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2353|  13.4k|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.4k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2354|       |
 2355|       |            /*load 8 pixel values */
 2356|  13.4k|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
 2357|       |
 2358|       |            /*load 8 pixel values */
 2359|  13.4k|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
 2360|       |
 2361|  13.4k|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2362|       |
 2363|  13.4k|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2364|       |
 2365|       |            /*load 8 pixel values */
 2366|  13.4k|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 2367|       |
 2368|       |            /*load 8 pixel values */
 2369|  13.4k|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 2370|       |
 2371|  13.4k|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2372|       |
 2373|  13.4k|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2374|       |
 2375|       |            /*load 8 pixel values */
 2376|  13.4k|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 2377|       |
 2378|       |            /*load 8 pixel values */
 2379|  13.4k|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 2380|       |
 2381|  13.4k|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
 2382|       |
 2383|  13.4k|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2384|       |
 2385|       |            /*load 8 pixel values */
 2386|  13.4k|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 2387|       |
 2388|       |            /*load 8 pixel values */
 2389|  13.4k|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
 2390|       |
 2391|  13.4k|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
 2392|       |
 2393|  13.4k|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2394|       |
 2395|  13.4k|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2396|  13.4k|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2397|  13.4k|            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|  13.4k|            _mm_storel_epi64((__m128i *)(pi2_dst), s6_8x16b);
 2402|       |
 2403|       |            /* ROW 2*/
 2404|  13.4k|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2405|  13.4k|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2406|  13.4k|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2407|       |
 2408|       |            /*load 8 pixel values */
 2409|  13.4k|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
 2410|       |
 2411|       |            /*load 8 pixel values */
 2412|  13.4k|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
 2413|       |
 2414|  13.4k|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
 2415|       |
 2416|  13.4k|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2417|       |
 2418|  13.4k|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2419|  13.4k|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2420|  13.4k|            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|  13.4k|            _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2425|       |
 2426|       |
 2427|       |            /*ROW 1*/
 2428|  13.4k|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2429|       |
 2430|  13.4k|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2431|       |
 2432|  13.4k|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
 2433|       |
 2434|  13.4k|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2435|       |
 2436|  13.4k|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
 2437|       |
 2438|  13.4k|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2439|       |
 2440|  13.4k|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
 2441|       |
 2442|  13.4k|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2443|       |
 2444|  13.4k|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2445|  13.4k|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2446|  13.4k|            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|  13.4k|            _mm_storel_epi64((__m128i *)(pi2_dst + (dst_strd)), s16_8x16b);
 2452|       |
 2453|       |
 2454|       |            /* ROW 3*/
 2455|  13.4k|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2456|  13.4k|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2457|  13.4k|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2458|       |
 2459|       |            /*load 8 pixel values */
 2460|  13.4k|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
 2461|       |
 2462|  13.4k|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
 2463|       |
 2464|  13.4k|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2465|       |
 2466|  13.4k|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2467|  13.4k|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2468|  13.4k|            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|  13.4k|            _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2473|       |
 2474|  13.4k|            pu1_src += (8 * src_strd);
 2475|  13.4k|            pi2_dst += (4 * dst_strd);
 2476|       |
 2477|  44.7k|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (2477:26): [True: 31.2k, False: 13.4k]
  ------------------
 2478|  31.2k|            {
 2479|       |
 2480|  31.2k|                PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.2k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2481|  31.2k|                PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.2k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2482|  31.2k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.2k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2483|  31.2k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.2k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2484|       |
 2485|  31.2k|                s3_0_16x8b = s3_2_16x8b;
 2486|  31.2k|                s3_1_16x8b = s3_3_16x8b;
 2487|  31.2k|                s3_2_16x8b = s3_4_16x8b;
 2488|       |
 2489|  31.2k|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2490|  31.2k|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2491|  31.2k|                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.2k|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2495|       |
 2496|  31.2k|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
 2497|  31.2k|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2498|       |
 2499|  31.2k|                s4_0_16x8b = s4_2_16x8b;
 2500|  31.2k|                s4_1_16x8b = s4_3_16x8b;
 2501|  31.2k|                s4_2_16x8b = s4_4_16x8b;
 2502|       |
 2503|  31.2k|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2504|  31.2k|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2505|  31.2k|                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.2k|                _mm_storel_epi64((__m128i *)(pi2_dst), s6_8x16b);
 2510|       |
 2511|       |                /* row + 2*/
 2512|  31.2k|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2513|  31.2k|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2514|  31.2k|                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.2k|                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.2k|                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.2k|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2524|       |
 2525|  31.2k|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2526|       |
 2527|  31.2k|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2528|  31.2k|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2529|  31.2k|                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.2k|                _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2534|       |
 2535|       |
 2536|       |                /*row + 1*/
 2537|  31.2k|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2538|  31.2k|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2539|  31.2k|                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.2k|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2543|  31.2k|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2544|       |
 2545|  31.2k|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2546|  31.2k|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2547|  31.2k|                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.2k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s16_8x16b);
 2552|       |
 2553|       |
 2554|       |                /* row + 3*/
 2555|  31.2k|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2556|  31.2k|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2557|  31.2k|                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.2k|                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.2k|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2564|       |
 2565|  31.2k|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2566|       |
 2567|  31.2k|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2568|  31.2k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2569|  31.2k|                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.2k|                _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2574|       |
 2575|  31.2k|                s2_10_16x8b = s2_3_16x8b;
 2576|       |
 2577|  31.2k|                pu1_src += 4 * src_strd; /* pointer update */
 2578|  31.2k|                pi2_dst += 4 * dst_strd; /* pointer update */
 2579|  31.2k|            }
 2580|  13.4k|        }
 2581|  7.85k|    }
 2582|  4.22M|}
ihevc_inter_pred_luma_vert_w16inp_ssse3:
 2632|  2.14M|{
 2633|  2.14M|    WORD32 row, col;
 2634|  2.14M|    WORD16 *pi2_src_copy;
 2635|  2.14M|    UWORD8 *pu1_dst_copy;
 2636|  2.14M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
 2637|  2.14M|    __m128i s0_8x16b, s1_8x16b, s2_8x16b, s3_8x16b, s4_8x16b, s5_8x16b, s6_8x16b, s8_8x16b, s9_8x16b;
 2638|  2.14M|    __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.14M|    __m128i s3_0_16x8b, s3_1_16x8b, s3_2_16x8b, s3_3_16x8b, s3_4_16x8b;
 2640|  2.14M|    __m128i s4_0_16x8b, s4_1_16x8b, s4_2_16x8b, s4_3_16x8b, s4_4_16x8b;
 2641|  2.14M|    __m128i s10_8x16b, s11_8x16b, s12_8x16b, s13_8x16b, s14_8x16b, s15_8x16b, s16_8x16b, s18_8x16b, s19_8x16b;
 2642|  2.14M|    __m128i s20_8x16b, s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b, s26_8x16b, s28_8x16b, s29_8x16b;
 2643|  2.14M|    __m128i s30_8x16b, s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b, s36_8x16b, s38_8x16b, s39_8x16b;
 2644|       |
 2645|  2.14M|    __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.14M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 2649|       |
 2650|  2.14M|    zero_8x16b = _mm_setzero_si128();
 2651|  2.14M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 2652|  2.14M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 2653|       |
 2654|  2.14M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 2655|  2.14M|    coeff2_3_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(1, 1, 1, 1));  /* pi1_coeff[4] */
 2656|       |
 2657|  2.14M|    coeff4_5_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(2, 2, 2, 2));  /* pi1_coeff[4] */
 2658|  2.14M|    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.14M|    offset_8x16b = _mm_set1_epi32(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  2.14M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  2.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  2.14M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2663|  2.14M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
 2664|  2.14M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
 2665|       |
 2666|       |
 2667|  2.14M|    pi2_src_copy = pi2_src;
 2668|  2.14M|    pu1_dst_copy = pu1_dst;
 2669|       |
 2670|       |/*  outer for loop starts from here */
 2671|  6.50M|    for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (2671:18): [True: 4.35M, False: 2.14M]
  ------------------
 2672|  4.35M|    {
 2673|       |
 2674|  4.35M|        pi2_src = pi2_src_copy + col;
 2675|  4.35M|        pu1_dst = pu1_dst_copy + col;
 2676|       |
 2677|       |        /*load 4 pixel values */
 2678|  4.35M|        s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-3 * src_strd)));
 2679|       |
 2680|       |        /*load 4 pixel values */
 2681|  4.35M|        s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-2 * src_strd)));
 2682|       |
 2683|  4.35M|        s3_0_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 2684|       |
 2685|  4.35M|        s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2686|       |
 2687|       |        /*load 4 pixel values */
 2688|  4.35M|        s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 2689|       |
 2690|       |        /*load 4 pixel values */
 2691|  4.35M|        s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 2692|       |
 2693|  4.35M|        s3_1_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 2694|       |
 2695|  4.35M|        s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2696|       |
 2697|       |        /*load 4 pixel values */
 2698|  4.35M|        s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 2699|       |
 2700|       |        /*load 4 pixel values */
 2701|  4.35M|        s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 2702|       |
 2703|  4.35M|        s3_2_16x8b = _mm_unpacklo_epi16(s2_4_16x8b, s2_5_16x8b);
 2704|       |
 2705|  4.35M|        s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2706|       |
 2707|       |        /*load 4 pixel values */
 2708|  4.35M|        s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 2709|       |
 2710|       |        /*load 4 pixel values */
 2711|  4.35M|        s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (4 * src_strd)));
 2712|       |
 2713|  4.35M|        s3_3_16x8b = _mm_unpacklo_epi16(s2_6_16x8b, s2_7_16x8b);
 2714|       |
 2715|  4.35M|        s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2716|       |
 2717|  4.35M|        s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 2718|  4.35M|        s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 2719|  4.35M|        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.35M|        s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2723|       |
 2724|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2725|  4.35M|        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.35M|        s8_8x16b = _mm_srai_epi32(s9_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2729|       |
 2730|  4.35M|        s8_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 2731|       |
 2732|       |
 2733|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2734|  4.35M|        s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 2735|       |
 2736|  4.35M|        s4_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 2737|  4.35M|        s5_8x16b =  _mm_and_si128(s4_8x16b, mask_low_32b);
 2738|  4.35M|        s6_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 2739|  4.35M|        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.35M|        _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 2744|       |
 2745|       |        /* ROW 2*/
 2746|  4.35M|        s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2747|  4.35M|        s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2748|  4.35M|        s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2749|       |
 2750|       |        /*load 4 pixel values */
 2751|  4.35M|        s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (5 * src_strd)));
 2752|       |
 2753|       |        /*load 4 pixel values */
 2754|  4.35M|        s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (6 * src_strd)));
 2755|       |
 2756|  4.35M|        s3_4_16x8b = _mm_unpacklo_epi16(s2_8_16x8b, s2_9_16x8b);
 2757|       |
 2758|  4.35M|        s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2759|       |
 2760|  4.35M|        s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 2761|  4.35M|        s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 2762|  4.35M|        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.35M|        s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2766|       |
 2767|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2768|  4.35M|        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.35M|        s28_8x16b = _mm_srai_epi32(s29_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2772|       |
 2773|  4.35M|        s28_8x16b = _mm_packs_epi32(s28_8x16b, zero_8x16b);
 2774|       |
 2775|       |
 2776|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2777|  4.35M|        s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 2778|       |
 2779|  4.35M|        s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 2780|  4.35M|        s25_8x16b =  _mm_and_si128(s24_8x16b, mask_low_32b);
 2781|  4.35M|        s26_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 2782|  4.35M|        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.35M|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
 2787|       |
 2788|       |
 2789|       |        /*ROW 1*/
 2790|  4.35M|        s4_0_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 2791|       |
 2792|  4.35M|        s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2793|       |
 2794|  4.35M|        s4_1_16x8b = _mm_unpacklo_epi16(s2_3_16x8b, s2_4_16x8b);
 2795|       |
 2796|  4.35M|        s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2797|       |
 2798|  4.35M|        s4_2_16x8b = _mm_unpacklo_epi16(s2_5_16x8b, s2_6_16x8b);
 2799|       |
 2800|  4.35M|        s12_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2801|       |
 2802|  4.35M|        s4_3_16x8b = _mm_unpacklo_epi16(s2_7_16x8b, s2_8_16x8b);
 2803|       |
 2804|  4.35M|        s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2805|       |
 2806|  4.35M|        s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 2807|  4.35M|        s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 2808|  4.35M|        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.35M|        s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2812|       |
 2813|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2814|  4.35M|        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.35M|        s18_8x16b = _mm_srai_epi32(s19_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2818|       |
 2819|  4.35M|        s18_8x16b = _mm_packs_epi32(s18_8x16b, zero_8x16b);
 2820|       |
 2821|       |
 2822|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2823|  4.35M|        s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 2824|       |
 2825|  4.35M|        s14_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (dst_strd)));
 2826|  4.35M|        s15_8x16b =  _mm_and_si128(s14_8x16b, mask_low_32b);
 2827|  4.35M|        s16_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 2828|  4.35M|        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.35M|        _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd)), s19_8x16b);
 2833|       |
 2834|       |
 2835|       |        /* ROW 3*/
 2836|  4.35M|        s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2837|  4.35M|        s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2838|  4.35M|        s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2839|       |
 2840|       |        /*load 4 pixel values */
 2841|  4.35M|        s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (7 * src_strd)));
 2842|       |
 2843|  4.35M|        s4_4_16x8b = _mm_unpacklo_epi16(s2_9_16x8b, s2_10_16x8b);
 2844|       |
 2845|  4.35M|        s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2846|       |
 2847|  4.35M|        s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 2848|  4.35M|        s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 2849|  4.35M|        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.35M|        s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2853|       |
 2854|       |
 2855|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2856|  4.35M|        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.35M|        s38_8x16b = _mm_srai_epi32(s39_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.35M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.35M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2860|       |
 2861|  4.35M|        s38_8x16b = _mm_packs_epi32(s38_8x16b, zero_8x16b);
 2862|       |
 2863|       |
 2864|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2865|  4.35M|        s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 2866|       |
 2867|  4.35M|        s34_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 2868|  4.35M|        s35_8x16b =  _mm_and_si128(s34_8x16b, mask_low_32b);
 2869|  4.35M|        s36_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 2870|  4.35M|        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.35M|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
 2875|       |
 2876|  4.35M|        pi2_src += (8 * src_strd);
 2877|  4.35M|        pu1_dst += (4 * dst_strd);
 2878|       |
 2879|  9.66M|        for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (2879:22): [True: 5.30M, False: 4.35M]
  ------------------
 2880|  5.30M|        {
 2881|       |
 2882|  5.30M|            s3_0_16x8b = s3_2_16x8b;
 2883|  5.30M|            s3_1_16x8b = s3_3_16x8b;
 2884|  5.30M|            s3_2_16x8b = s3_4_16x8b;
 2885|       |
 2886|  5.30M|            s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2887|  5.30M|            s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2888|  5.30M|            s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2889|       |
 2890|       |            /*load 4 pixel values from (cur_row + 4)th row*/
 2891|  5.30M|            s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src));
 2892|       |
 2893|  5.30M|            s3_3_16x8b = _mm_unpacklo_epi16(s2_10_16x8b, s2_0_16x8b);
 2894|  5.30M|            s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2895|       |
 2896|  5.30M|            s4_0_16x8b = s4_2_16x8b;
 2897|  5.30M|            s4_1_16x8b = s4_3_16x8b;
 2898|  5.30M|            s4_2_16x8b = s4_4_16x8b;
 2899|       |
 2900|  5.30M|            s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 2901|  5.30M|            s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 2902|  5.30M|            s6_8x16b = _mm_add_epi32(s4_8x16b, s5_8x16b);
 2903|       |
 2904|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2905|  5.30M|            s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2906|       |
 2907|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2908|  5.30M|            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|  5.30M|            s8_8x16b = _mm_srai_epi32(s9_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2912|       |
 2913|  5.30M|            s8_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 2914|       |
 2915|       |
 2916|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 2917|  5.30M|            s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 2918|       |
 2919|  5.30M|            s4_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 2920|  5.30M|            s5_8x16b =  _mm_and_si128(s4_8x16b, mask_low_32b);
 2921|  5.30M|            s6_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 2922|  5.30M|            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|  5.30M|            _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 2927|       |
 2928|       |/* row + 2*/
 2929|  5.30M|            s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2930|  5.30M|            s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2931|  5.30M|            s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2932|       |
 2933|       |            /*load 4 pixel values from (cur_row + 5)th row*/
 2934|  5.30M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + src_strd));
 2935|       |
 2936|       |            /*load 4 pixel values from (cur_row + 6)th row*/
 2937|  5.30M|            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|  5.30M|            s3_4_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 2941|       |
 2942|  5.30M|            s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2943|       |
 2944|  5.30M|            s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 2945|  5.30M|            s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 2946|  5.30M|            s26_8x16b = _mm_add_epi32(s24_8x16b, s25_8x16b);
 2947|       |
 2948|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2949|  5.30M|            s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2950|       |
 2951|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2952|  5.30M|            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|  5.30M|            s28_8x16b = _mm_srai_epi32(s29_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2956|       |
 2957|  5.30M|            s28_8x16b = _mm_packs_epi32(s28_8x16b, zero_8x16b);
 2958|       |
 2959|       |
 2960|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 2961|  5.30M|            s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 2962|       |
 2963|  5.30M|            s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 2964|  5.30M|            s25_8x16b =  _mm_and_si128(s24_8x16b, mask_low_32b);
 2965|  5.30M|            s26_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 2966|  5.30M|            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|  5.30M|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
 2971|       |
 2972|       |
 2973|       |/*row + 1*/
 2974|  5.30M|            s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2975|  5.30M|            s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2976|  5.30M|            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|  5.30M|            s4_3_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 2980|  5.30M|            s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2981|       |
 2982|  5.30M|            s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 2983|  5.30M|            s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 2984|  5.30M|            s16_8x16b = _mm_add_epi32(s14_8x16b, s15_8x16b);
 2985|       |
 2986|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2987|  5.30M|            s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2988|       |
 2989|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2990|  5.30M|            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|  5.30M|            s18_8x16b = _mm_srai_epi32(s19_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2994|       |
 2995|  5.30M|            s18_8x16b = _mm_packs_epi32(s18_8x16b, zero_8x16b);
 2996|       |
 2997|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 2998|  5.30M|            s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 2999|       |
 3000|  5.30M|            s14_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 3001|  5.30M|            s15_8x16b =  _mm_and_si128(s14_8x16b, mask_low_32b);
 3002|  5.30M|            s16_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 3003|  5.30M|            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|  5.30M|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s19_8x16b);
 3008|       |
 3009|       |
 3010|       |/* row + 3*/
 3011|  5.30M|            s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 3012|  5.30M|            s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 3013|  5.30M|            s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 3014|       |
 3015|       |            /*load 4 pixel values from (cur_row + 7)th row*/
 3016|  5.30M|            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|  5.30M|            s4_4_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 3020|       |
 3021|  5.30M|            s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 3022|       |
 3023|  5.30M|            s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 3024|  5.30M|            s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 3025|  5.30M|            s36_8x16b = _mm_add_epi32(s34_8x16b, s35_8x16b);
 3026|       |
 3027|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3028|  5.30M|            s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3029|       |
 3030|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3031|  5.30M|            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|  5.30M|            s38_8x16b = _mm_srai_epi32(s39_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  5.30M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  5.30M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3035|       |
 3036|  5.30M|            s38_8x16b = _mm_packs_epi32(s38_8x16b, zero_8x16b);
 3037|       |
 3038|       |
 3039|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 3040|  5.30M|            s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 3041|       |
 3042|  5.30M|            s34_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 3043|  5.30M|            s35_8x16b =  _mm_and_si128(s34_8x16b, mask_low_32b);
 3044|  5.30M|            s36_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 3045|  5.30M|            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|  5.30M|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
 3050|       |
 3051|  5.30M|            s2_10_16x8b = s2_3_16x8b;
 3052|       |
 3053|  5.30M|            pi2_src += 4 * src_strd; /* pointer update */
 3054|  5.30M|            pu1_dst += 4 * dst_strd; /* pointer update */
 3055|  5.30M|        }
 3056|  4.35M|    }
 3057|       |
 3058|  2.14M|}
ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3:
 3109|  4.55M|{
 3110|  4.55M|    WORD32 row, col;
 3111|  4.55M|    WORD16 *pi2_src_copy;
 3112|  4.55M|    WORD16 *pi2_dst_copy;
 3113|  4.55M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
 3114|  4.55M|    __m128i s0_8x16b, s1_8x16b, s2_8x16b, s3_8x16b, s4_8x16b, s5_8x16b, s6_8x16b, s8_8x16b, s9_8x16b;
 3115|  4.55M|    __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|  4.55M|    __m128i s3_0_16x8b, s3_1_16x8b, s3_2_16x8b, s3_3_16x8b, s3_4_16x8b;
 3117|  4.55M|    __m128i s4_0_16x8b, s4_1_16x8b, s4_2_16x8b, s4_3_16x8b, s4_4_16x8b;
 3118|  4.55M|    __m128i s10_8x16b, s11_8x16b, s12_8x16b, s13_8x16b, s14_8x16b, s15_8x16b, s16_8x16b, s18_8x16b, s19_8x16b;
 3119|  4.55M|    __m128i s20_8x16b, s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b, s26_8x16b, s28_8x16b, s29_8x16b;
 3120|  4.55M|    __m128i s30_8x16b, s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b, s36_8x16b, s38_8x16b, s39_8x16b;
 3121|       |
 3122|  4.55M|    __m128i zero_8x16b, offset_8x16b, sign_reg;
 3123|       |
 3124|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 3125|  4.55M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 3126|       |
 3127|  4.55M|    zero_8x16b = _mm_setzero_si128();
 3128|  4.55M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 3129|  4.55M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 3130|       |
 3131|  4.55M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 3132|  4.55M|    coeff2_3_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(1, 1, 1, 1));  /* pi1_coeff[4] */
 3133|       |
 3134|  4.55M|    coeff4_5_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(2, 2, 2, 2));  /* pi1_coeff[4] */
 3135|  4.55M|    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|  4.55M|    offset_8x16b = _mm_set1_epi32(OFFSET14); /* for offset addition */
  ------------------
  |  |   43|  4.55M|#define OFFSET14 (1 << (14 - 1))
  ------------------
 3140|       |
 3141|  4.55M|    pi2_src_copy = pi2_src;
 3142|  4.55M|    pi2_dst_copy = pi2_dst;
 3143|       |
 3144|       |/*  outer for loop starts from here */
 3145|  14.0M|    for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (3145:18): [True: 9.51M, False: 4.55M]
  ------------------
 3146|  9.51M|    {
 3147|       |
 3148|  9.51M|        pi2_src = pi2_src_copy + col;
 3149|  9.51M|        pi2_dst = pi2_dst_copy + col;
 3150|       |
 3151|       |        /*load 4 pixel values*/
 3152|  9.51M|        s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-3 * src_strd)));
 3153|       |
 3154|       |        /*load 4 pixel values*/
 3155|  9.51M|        s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-2 * src_strd)));
 3156|       |
 3157|  9.51M|        s3_0_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 3158|       |
 3159|  9.51M|        s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 3160|       |
 3161|       |        /*load 4 pixel values*/
 3162|  9.51M|        s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 3163|       |
 3164|       |        /*load 4 pixel values*/
 3165|  9.51M|        s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 3166|       |
 3167|  9.51M|        s3_1_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 3168|       |
 3169|  9.51M|        s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 3170|       |
 3171|       |        /*load 4 pixel values*/
 3172|  9.51M|        s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 3173|       |
 3174|       |        /*load 4 pixel values*/
 3175|  9.51M|        s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 3176|       |
 3177|  9.51M|        s3_2_16x8b = _mm_unpacklo_epi16(s2_4_16x8b, s2_5_16x8b);
 3178|       |
 3179|  9.51M|        s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 3180|       |
 3181|       |        /*load 4 pixel values*/
 3182|  9.51M|        s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 3183|       |
 3184|       |        /*load 4 pixel values*/
 3185|  9.51M|        s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (4 * src_strd)));
 3186|       |
 3187|  9.51M|        s3_3_16x8b = _mm_unpacklo_epi16(s2_6_16x8b, s2_7_16x8b);
 3188|       |
 3189|  9.51M|        s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 3190|       |
 3191|  9.51M|        s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 3192|  9.51M|        s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 3193|  9.51M|        s6_8x16b = _mm_add_epi32(s4_8x16b, s5_8x16b);
 3194|       |
 3195|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3196|  9.51M|        s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  9.51M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  9.51M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3197|       |
 3198|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3199|  9.51M|        s9_8x16b = _mm_sub_epi32(s8_8x16b, offset_8x16b);
 3200|       |
 3201|  9.51M|        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|  9.51M|        _mm_storel_epi64((__m128i *)(pi2_dst), s8_8x16b);
 3206|       |
 3207|       |        /* ROW 2*/
 3208|  9.51M|        s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 3209|  9.51M|        s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 3210|  9.51M|        s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 3211|       |
 3212|       |        /*load 4 pixel values*/
 3213|  9.51M|        s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (5 * src_strd)));
 3214|       |
 3215|       |        /*load 4 pixel values*/
 3216|  9.51M|        s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (6 * src_strd)));
 3217|       |
 3218|  9.51M|        s3_4_16x8b = _mm_unpacklo_epi16(s2_8_16x8b, s2_9_16x8b);
 3219|       |
 3220|  9.51M|        s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 3221|       |
 3222|  9.51M|        s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 3223|  9.51M|        s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 3224|  9.51M|        s26_8x16b = _mm_add_epi32(s24_8x16b, s25_8x16b);
 3225|       |
 3226|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3227|  9.51M|        s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  9.51M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  9.51M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3228|       |
 3229|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3230|  9.51M|        s29_8x16b = _mm_sub_epi32(s28_8x16b, offset_8x16b);
 3231|       |
 3232|  9.51M|        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|  9.51M|        _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s28_8x16b);
 3237|       |
 3238|       |
 3239|       |        /*ROW 1*/
 3240|  9.51M|        s4_0_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 3241|       |
 3242|  9.51M|        s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 3243|       |
 3244|  9.51M|        s4_1_16x8b = _mm_unpacklo_epi16(s2_3_16x8b, s2_4_16x8b);
 3245|       |
 3246|  9.51M|        s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 3247|       |
 3248|  9.51M|        s4_2_16x8b = _mm_unpacklo_epi16(s2_5_16x8b, s2_6_16x8b);
 3249|       |
 3250|  9.51M|        s12_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff4_5_8x16b);
 3251|       |
 3252|  9.51M|        s4_3_16x8b = _mm_unpacklo_epi16(s2_7_16x8b, s2_8_16x8b);
 3253|       |
 3254|  9.51M|        s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 3255|       |
 3256|  9.51M|        s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 3257|  9.51M|        s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 3258|  9.51M|        s16_8x16b = _mm_add_epi32(s14_8x16b, s15_8x16b);
 3259|       |
 3260|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3261|  9.51M|        s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  9.51M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  9.51M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3262|       |
 3263|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3264|  9.51M|        s19_8x16b = _mm_sub_epi32(s18_8x16b, offset_8x16b);
 3265|       |
 3266|  9.51M|        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|  9.51M|        _mm_storel_epi64((__m128i *)(pi2_dst + (dst_strd)), s18_8x16b);
 3271|       |
 3272|       |
 3273|       |        /* ROW 3*/
 3274|  9.51M|        s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 3275|  9.51M|        s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 3276|  9.51M|        s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 3277|       |
 3278|       |        /*load 4 pixel values*/
 3279|  9.51M|        s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (7 * src_strd)));
 3280|       |
 3281|  9.51M|        s4_4_16x8b = _mm_unpacklo_epi16(s2_9_16x8b, s2_10_16x8b);
 3282|       |
 3283|  9.51M|        s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 3284|       |
 3285|  9.51M|        s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 3286|  9.51M|        s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 3287|  9.51M|        s36_8x16b = _mm_add_epi32(s34_8x16b, s35_8x16b);
 3288|       |
 3289|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3290|  9.51M|        s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  9.51M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  9.51M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3291|       |
 3292|       |
 3293|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3294|  9.51M|        s39_8x16b = _mm_sub_epi32(s38_8x16b, offset_8x16b);
 3295|       |
 3296|  9.51M|        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|  9.51M|        _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s38_8x16b);
 3301|       |
 3302|  9.51M|        pi2_src += (8 * src_strd);
 3303|  9.51M|        pi2_dst += (4 * dst_strd);
 3304|       |
 3305|  23.2M|        for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (3305:22): [True: 13.7M, False: 9.51M]
  ------------------
 3306|  13.7M|        {
 3307|       |
 3308|  13.7M|            s3_0_16x8b = s3_2_16x8b;
 3309|  13.7M|            s3_1_16x8b = s3_3_16x8b;
 3310|  13.7M|            s3_2_16x8b = s3_4_16x8b;
 3311|       |
 3312|  13.7M|            s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 3313|  13.7M|            s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 3314|  13.7M|            s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 3315|       |
 3316|       |            /*load 4 pixel values from (cur_row + 4)th row*/
 3317|  13.7M|            s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src));
 3318|       |
 3319|  13.7M|            s3_3_16x8b = _mm_unpacklo_epi16(s2_10_16x8b, s2_0_16x8b);
 3320|  13.7M|            s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 3321|       |
 3322|  13.7M|            s4_0_16x8b = s4_2_16x8b;
 3323|  13.7M|            s4_1_16x8b = s4_3_16x8b;
 3324|  13.7M|            s4_2_16x8b = s4_4_16x8b;
 3325|       |
 3326|  13.7M|            s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 3327|  13.7M|            s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 3328|  13.7M|            s6_8x16b = _mm_add_epi32(s4_8x16b, s5_8x16b);
 3329|       |
 3330|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3331|  13.7M|            s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3332|       |
 3333|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3334|  13.7M|            s9_8x16b = _mm_sub_epi32(s8_8x16b, offset_8x16b);
 3335|       |
 3336|  13.7M|            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|  13.7M|            _mm_storel_epi64((__m128i *)(pi2_dst), s8_8x16b);
 3341|       |
 3342|       |/* row + 2*/
 3343|  13.7M|            s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 3344|  13.7M|            s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 3345|  13.7M|            s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 3346|       |
 3347|       |            /*load 4 pixel values from (cur_row + 5)th row*/
 3348|  13.7M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + src_strd));
 3349|       |
 3350|       |            /*load 4 pixel values from (cur_row + 6)th row*/
 3351|  13.7M|            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|  13.7M|            s3_4_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 3355|       |
 3356|  13.7M|            s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 3357|       |
 3358|  13.7M|            s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 3359|  13.7M|            s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 3360|  13.7M|            s26_8x16b = _mm_add_epi32(s24_8x16b, s25_8x16b);
 3361|       |
 3362|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3363|  13.7M|            s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3364|       |
 3365|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3366|  13.7M|            s29_8x16b = _mm_sub_epi32(s28_8x16b, offset_8x16b);
 3367|       |
 3368|  13.7M|            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|  13.7M|            _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s28_8x16b);
 3373|       |
 3374|       |
 3375|       |/*row + 1*/
 3376|  13.7M|            s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 3377|  13.7M|            s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 3378|  13.7M|            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|  13.7M|            s4_3_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 3382|  13.7M|            s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 3383|       |
 3384|  13.7M|            s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 3385|  13.7M|            s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 3386|  13.7M|            s16_8x16b = _mm_add_epi32(s14_8x16b, s15_8x16b);
 3387|       |
 3388|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3389|  13.7M|            s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3390|       |
 3391|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3392|  13.7M|            s19_8x16b = _mm_sub_epi32(s18_8x16b, offset_8x16b);
 3393|       |
 3394|  13.7M|            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|  13.7M|            _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s18_8x16b);
 3399|       |
 3400|       |
 3401|       |/* row + 3*/
 3402|  13.7M|            s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 3403|  13.7M|            s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 3404|  13.7M|            s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 3405|       |
 3406|       |            /*load 4 pixel values from (cur_row + 7)th row*/
 3407|  13.7M|            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|  13.7M|            s4_4_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 3411|       |
 3412|  13.7M|            s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 3413|       |
 3414|  13.7M|            s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 3415|  13.7M|            s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 3416|  13.7M|            s36_8x16b = _mm_add_epi32(s34_8x16b, s35_8x16b);
 3417|       |
 3418|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3419|  13.7M|            s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3420|       |
 3421|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3422|  13.7M|            s39_8x16b = _mm_sub_epi32(s38_8x16b, offset_8x16b);
 3423|       |
 3424|  13.7M|            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|  13.7M|            _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s38_8x16b);
 3429|       |
 3430|  13.7M|            s2_10_16x8b = s2_3_16x8b;
 3431|       |
 3432|  13.7M|            pi2_src += 4 * src_strd; /* pointer update */
 3433|  13.7M|            pi2_dst += 4 * dst_strd; /* pointer update */
 3434|  13.7M|        }
 3435|  9.51M|    }
 3436|       |
 3437|  4.55M|}
ihevc_inter_pred_chroma_copy_ssse3:
 3485|  1.01M|{
 3486|  1.01M|    WORD32 row, col;
 3487|  1.01M|    __m128i  s3, mask_4x32b;
 3488|  1.01M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  1.01M|#define UNUSED(x) ((void)(x))
  ------------------
 3489|  1.01M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.01M|#define ASSERT(x) {}
  ------------------
 3490|  1.01M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.01M|#define ASSERT(x) {}
  ------------------
 3491|       |
 3492|  1.01M|    mask_4x32b = _mm_set_epi32(0, 0, 0, 0x80808080); /* Mask register */
 3493|       |
 3494|       |/*  for loop starts from here */
 3495|  1.01M|    if(wd % 8 == 0)
  ------------------
  |  Branch (3495:8): [True: 29.8k, False: 983k]
  ------------------
 3496|  29.8k|    {
 3497|   217k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3497:22): [True: 187k, False: 29.8k]
  ------------------
 3498|   187k|        {
 3499|   187k|            int offset = 0;
 3500|   603k|            for(col = 0; col < 2 * wd; col += 16)
  ------------------
  |  Branch (3500:26): [True: 415k, False: 187k]
  ------------------
 3501|   415k|            {
 3502|       |/* row =0 */
 3503|       |
 3504|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 3505|   415k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]; */
 3506|       |                /* storing 16 8-bit output values */
 3507|   415k|                _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|   415k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col]; */
 3512|       |                /* storing 8 8-bit output values */
 3513|   415k|                _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd + offset), s3); /* pu1_dst[col] = pu1_src[col]*/
 3514|       |
 3515|   415k|                offset += 16; /*To pointer update */
 3516|   415k|            } /*  inner for loop ends here(16-output values in single iteration) */
 3517|       |
 3518|   187k|            pu1_src += 2 * src_strd; /* pointer update */
 3519|   187k|            pu1_dst += 2 * dst_strd; /* pointer update */
 3520|   187k|        }
 3521|  29.8k|    }
 3522|   983k|    else if(wd % 4 == 0)
  ------------------
  |  Branch (3522:13): [True: 937k, False: 45.9k]
  ------------------
 3523|   937k|    {
 3524|  2.78M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3524:22): [True: 1.84M, False: 937k]
  ------------------
 3525|  1.84M|        {
 3526|  1.84M|            int offset = 0;
 3527|  3.69M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (3527:26): [True: 1.85M, False: 1.84M]
  ------------------
 3528|  1.85M|            {
 3529|       |/* row =0  */
 3530|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 3531|  1.85M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]; */
 3532|       |                /* storing 8 8-bit output values */
 3533|  1.85M|                _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.85M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col]; */
 3537|       |                /* storing 8 8-bit output values */
 3538|  1.85M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), s3); /* pu1_dst[col] = pu1_src[col]; */
 3539|       |
 3540|  1.85M|                offset += 8; /* To pointer update */
 3541|  1.85M|            } /* inner for loop ends here(8-output values in single iteration) */
 3542|       |
 3543|  1.84M|            pu1_src += 2 * src_strd;  /* pointer update */
 3544|  1.84M|            pu1_dst += 2 * dst_strd;  /* pointer update */
 3545|  1.84M|        }
 3546|   937k|    }
 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|   213k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (3552:26): [True: 112k, False: 101k]
  ------------------
 3553|   112k|            {
 3554|       |/* row =0 */
 3555|   112k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 3556|       |                /* storing four 8-bit output values */
 3557|   112k|                _mm_maskmoveu_si128(s3, mask_4x32b, (char *)(pu1_dst + offset)); /* pu1_dst[col] = pu1_src[col]; */
 3558|       |/* row =1 */
 3559|       |                /* pu1_src[col] */
 3560|   112k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 3561|       |
 3562|       |                /* storing four 8-bit output values */
 3563|   112k|                _mm_maskmoveu_si128(s3, mask_4x32b, (char *)(pu1_dst + dst_strd + offset)); /* pu1_dst[col] = pu1_src[col]; */
 3564|       |
 3565|   112k|                offset += 4; /* To pointer update */
 3566|   112k|            } /*  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|  1.01M|}
ihevc_inter_pred_chroma_horz_ssse3:
 3620|  1.44M|{
 3621|  1.44M|    WORD32 row, col;
 3622|       |
 3623|  1.44M|    __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.44M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
 3625|  1.44M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
 3626|  1.44M|    __m128i res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b, res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b, res_temp7_8x16b;
 3627|  1.44M|    __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.44M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.44M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3630|  1.44M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.44M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3631|  1.44M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.44M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3632|  1.44M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.44M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3633|  1.44M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.44M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3634|  1.44M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.44M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3635|       |
 3636|  1.44M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.44M|#define ASSERT(x) {}
  ------------------
 3637|       |
 3638|       |/* loading four 8-bit coefficients  */
 3639|  1.44M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 3640|       |
 3641|  1.44M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.44M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.44M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.44M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3642|  1.44M|    mask_low_32b = _mm_cmpeq_epi16(offset_8x16b, offset_8x16b);
 3643|  1.44M|    mask_high_96b = _mm_srli_si128(mask_low_32b, 12);
 3644|  1.44M|    mask_low_32b = _mm_slli_si128(mask_low_32b, 4);
 3645|       |
 3646|  1.44M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 3647|  1.44M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 3648|       |
 3649|  1.44M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 3650|  1.44M|    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.45M|    if(wd % 2 == 0 && wd % 4 != 0)
  ------------------
  |  Branch (3653:8): [True: 1.45M, False: 18.4E]
  |  Branch (3653:23): [True: 54.1k, False: 1.40M]
  ------------------
 3654|  54.1k|    {
 3655|       |
 3656|   175k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3656:22): [True: 120k, False: 54.1k]
  ------------------
 3657|   120k|        {
 3658|   120k|            int offset = 0;
 3659|       |
 3660|   120k|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   120k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3661|   120k|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   120k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3662|       |
 3663|       |
 3664|   268k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (3664:26): [True: 147k, False: 120k]
  ------------------
 3665|   147k|            {
 3666|       |
 3667|       |
 3668|       |                /*load 16 pixel values from row 0*/
 3669|   147k|                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|   147k|                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|   147k|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3676|       |
 3677|   147k|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 3678|       |
 3679|       |                /*Derive the source pixels for processing the 3rd pixel*/
 3680|   147k|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 3681|       |
 3682|       |                /*Derive the source pixels for processing the 4th pixel*/
 3683|   147k|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 3684|       |
 3685|   147k|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 3686|       |
 3687|       |                /*Derive the source pixels for processing the 2nd pixel*/
 3688|   147k|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 3689|       |
 3690|   147k|                src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b);
 3691|       |
 3692|       |                /*Derive the source pixels for processing the 3rd pixel*/
 3693|   147k|                src_temp13_16x8b = _mm_srli_si128(src_temp11_16x8b, 4);
 3694|       |                /*Derive the source pixels for processing the 4th pixel*/
 3695|   147k|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 3696|       |
 3697|   147k|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 3698|       |
 3699|   147k|                res_temp1_8x16b = _mm_unpacklo_epi64(src_temp5_16x8b, src_temp15_16x8b);
 3700|   147k|                res_temp2_8x16b = _mm_unpacklo_epi64(src_temp6_16x8b, src_temp16_16x8b);
 3701|   147k|                res_temp11_8x16b = _mm_maddubs_epi16(res_temp1_8x16b, coeff0_1_8x16b);
 3702|   147k|                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|   147k|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 3706|       |
 3707|   147k|                res_temp14_8x16b = _mm_adds_epi16(res_temp13_8x16b, offset_8x16b);             /* row = 0 */
 3708|   147k|                res_temp15_8x16b = _mm_srai_epi16(res_temp14_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|   147k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   147k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3709|   147k|                res_temp13_8x16b = _mm_packus_epi16(res_temp15_8x16b, res_temp15_8x16b);       /* row = 0 */
 3710|       |
 3711|   147k|                res_temp3_8x16b = _mm_srli_si128(res_temp13_8x16b, 4);
 3712|       |
 3713|   147k|                res_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + offset));
 3714|   147k|                res_temp5_8x16b =  _mm_and_si128(res_temp4_8x16b, mask_low_32b);
 3715|   147k|                res_temp6_8x16b =  _mm_and_si128(res_temp13_8x16b, mask_high_96b);
 3716|   147k|                res_temp7_8x16b = _mm_or_si128(res_temp5_8x16b, res_temp6_8x16b);
 3717|       |
 3718|       |                /* store 4 16-bit values */
 3719|   147k|                _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp7_8x16b); /* pu1_dst[col] = i2_tmp_u  */
 3720|       |
 3721|   147k|                res_temp14_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd + offset));
 3722|   147k|                res_temp15_8x16b =  _mm_and_si128(res_temp14_8x16b, mask_low_32b);
 3723|   147k|                res_temp16_8x16b =  _mm_and_si128(res_temp3_8x16b, mask_high_96b);
 3724|   147k|                res_temp17_8x16b = _mm_or_si128(res_temp15_8x16b, res_temp16_8x16b);
 3725|       |
 3726|       |                /* store 4 16-bit values */
 3727|   147k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp17_8x16b); /* pu1_dst[col] = i2_tmp_u  */
 3728|       |
 3729|       |
 3730|   147k|                offset += 4; /* To pointer update*/
 3731|       |
 3732|   147k|            } /* inner loop ends here(8- output values in single iteration)*/
 3733|       |
 3734|   120k|            pu1_src += 2 * src_strd; /*pointer update*/
 3735|   120k|            pu1_dst += 2 * dst_strd; /*pointer update*/
 3736|   120k|        }
 3737|  54.1k|    }
 3738|  1.39M|    else
 3739|  1.39M|    {
 3740|       |
 3741|  4.24M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3741:22): [True: 2.84M, False: 1.39M]
  ------------------
 3742|  2.84M|        {
 3743|  2.84M|            int offset = 0;
 3744|       |
 3745|  2.84M|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.84M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3746|  2.84M|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.84M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3747|       |
 3748|       |
 3749|  5.97M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (3749:26): [True: 3.12M, False: 2.84M]
  ------------------
 3750|  3.12M|            {
 3751|       |
 3752|       |                /*load 16 pixel values from row 0*/
 3753|  3.12M|                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|  3.12M|                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|  3.12M|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3760|       |
 3761|  3.12M|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 3762|       |
 3763|       |                /*Derive the source pixels for processing the 3rd pixel*/
 3764|  3.12M|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 3765|       |
 3766|       |                /*Derive the source pixels for processing the 4th pixel*/
 3767|  3.12M|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 3768|       |
 3769|  3.12M|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 3770|       |
 3771|  3.12M|                res_temp1_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff0_1_8x16b);
 3772|  3.12M|                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|  3.12M|                res_temp3_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 3776|       |
 3777|  3.12M|                res_temp4_8x16b = _mm_adds_epi16(res_temp3_8x16b, offset_8x16b);             /* row = 0 */
 3778|  3.12M|                res_temp5_8x16b = _mm_srai_epi16(res_temp4_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|  3.12M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  3.12M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3779|  3.12M|                res_temp6_8x16b = _mm_packus_epi16(res_temp5_8x16b, res_temp5_8x16b);        /* row = 0 */
 3780|       |
 3781|       |                /* store 4 16-bit values */
 3782|  3.12M|                _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|  3.12M|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 3786|       |
 3787|  3.12M|                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|  3.12M|                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|  3.12M|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 3794|       |
 3795|  3.12M|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 3796|       |
 3797|  3.12M|                res_temp11_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff0_1_8x16b);
 3798|  3.12M|                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|  3.12M|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 3802|       |
 3803|  3.12M|                res_temp14_8x16b = _mm_adds_epi16(res_temp13_8x16b, offset_8x16b);             /* row = 0 */
 3804|  3.12M|                res_temp15_8x16b = _mm_srai_epi16(res_temp14_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|  3.12M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  3.12M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3805|  3.12M|                res_temp16_8x16b = _mm_packus_epi16(res_temp15_8x16b, res_temp15_8x16b);       /* row = 0 */
 3806|       |
 3807|       |                /* store 4 16-bit values */
 3808|  3.12M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp16_8x16b); /* pu1_dst[col] = i2_tmp_u  */
 3809|       |
 3810|       |
 3811|  3.12M|                offset += 8; /* To pointer update*/
 3812|       |
 3813|  3.12M|            } /* inner loop ends here(8- output values in single iteration)*/
 3814|       |
 3815|  2.84M|            pu1_src += 2 * src_strd; /*pointer update*/
 3816|  2.84M|            pu1_dst += 2 * dst_strd; /*pointer update*/
 3817|  2.84M|        }
 3818|  1.39M|    }
 3819|  1.44M|}
ihevc_inter_pred_chroma_vert_ssse3:
 3868|  1.96M|{
 3869|  1.96M|    WORD32 row, col;
 3870|  1.96M|    UWORD8 *pu1_src_copy;
 3871|  1.96M|    UWORD8 *pu1_dst_copy;
 3872|  1.96M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 3873|  1.96M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
 3874|  1.96M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b;
 3875|  1.96M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 3876|  1.96M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b;
 3877|  1.96M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 3878|  1.96M|    __m128i s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b;
 3879|       |
 3880|  1.96M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.96M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3881|  1.96M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.96M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3882|  1.96M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.96M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3883|  1.96M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.96M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3884|  1.96M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.96M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3885|  1.96M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.96M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3886|       |
 3887|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 3888|  1.96M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 3889|       |
 3890|  1.96M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 3891|  1.96M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 3892|       |
 3893|  1.96M|    coeff0_1_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 3894|  1.96M|    coeff2_3_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 3895|       |
 3896|       |
 3897|       |/*  seting  values in register */
 3898|  1.96M|    zero_8x16b = _mm_setzero_si128(); /* for saturated clipping */
 3899|  1.96M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.96M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.96M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.96M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3900|  1.96M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
 3901|  1.96M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
 3902|       |
 3903|       |/*  outer for loop starts from here */
 3904|  1.96M|    if(wd % 8 == 0)
  ------------------
  |  Branch (3904:8): [True: 17.9k, False: 1.95M]
  ------------------
 3905|  17.9k|    { /* wd = multiple of 8 case */
 3906|       |
 3907|  17.9k|        pu1_src_copy = pu1_src;
 3908|  17.9k|        pu1_dst_copy = pu1_dst;
 3909|       |
 3910|  46.3k|        for(col = 0; col < 2 * wd; col += 16)
  ------------------
  |  Branch (3910:22): [True: 28.3k, False: 17.9k]
  ------------------
 3911|  28.3k|        {
 3912|       |
 3913|  28.3k|            pu1_src = pu1_src_copy + col;
 3914|  28.3k|            pu1_dst = pu1_dst_copy + col;
 3915|       |
 3916|       |
 3917|   251k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3917:26): [True: 222k, False: 28.3k]
  ------------------
 3918|   222k|            {
 3919|       |
 3920|   222k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   222k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3921|   222k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   222k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3922|       |
 3923|       |
 3924|       |                /*load 8 pixel values from -751:-768 pos. relative to cur. pos.*/
 3925|   222k|                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|   222k|                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|   222k|                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|   222k|                s24_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (2 * src_strd)));
 3936|       |
 3937|   222k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 3938|       |
 3939|   222k|                s31_8x16b = _mm_unpackhi_epi8(s21_8x16b, s22_8x16b);
 3940|       |
 3941|   222k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 3942|       |
 3943|   222k|                s33_8x16b = _mm_unpackhi_epi8(s23_8x16b, s24_8x16b);
 3944|       |
 3945|   222k|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 3946|       |
 3947|   222k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 3948|       |
 3949|   222k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 3950|       |
 3951|   222k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 3952|       |
 3953|   222k|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 3954|       |
 3955|   222k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s34_8x16b);
 3956|       |
 3957|   222k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 3958|       |
 3959|   222k|                s31_8x16b = _mm_add_epi16(s35_8x16b, offset_8x16b);
 3960|       |
 3961|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3962|   222k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   222k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   222k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3963|       |
 3964|   222k|                s32_8x16b = _mm_srai_epi16(s31_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   222k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   222k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3965|       |
 3966|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 3967|   222k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 3968|       |
 3969|   222k|                s33_8x16b =  _mm_packus_epi16(s32_8x16b, zero_8x16b);
 3970|       |
 3971|   222k|                s7_8x16b = _mm_unpacklo_epi64(s7_8x16b, s33_8x16b);
 3972|       |/* store 8 8-bit output values  */
 3973|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 3974|   222k|                _mm_storeu_si128((__m128i *)(pu1_dst), s7_8x16b);
 3975|       |
 3976|       |
 3977|   222k|                s25_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (3 * src_strd)));
 3978|       |
 3979|   222k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 3980|       |
 3981|   222k|                s31_8x16b = _mm_unpackhi_epi8(s22_8x16b, s23_8x16b);
 3982|       |
 3983|   222k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 3984|       |
 3985|   222k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 3986|       |
 3987|   222k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 3988|       |
 3989|   222k|                s33_8x16b = _mm_unpackhi_epi8(s24_8x16b, s25_8x16b);
 3990|       |
 3991|   222k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 3992|       |
 3993|   222k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 3994|       |
 3995|   222k|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 3996|       |
 3997|   222k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s34_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 3998|       |
 3999|   222k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4000|       |
 4001|   222k|                s31_8x16b = _mm_add_epi16(s35_8x16b, offset_8x16b);
 4002|       |
 4003|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4004|   222k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   222k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   222k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4005|       |
 4006|   222k|                s32_8x16b = _mm_srai_epi16(s31_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   222k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   222k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4007|       |
 4008|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4009|   222k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4010|       |
 4011|   222k|                s33_8x16b =  _mm_packus_epi16(s32_8x16b, zero_8x16b);
 4012|       |
 4013|   222k|                s7_8x16b = _mm_unpacklo_epi64(s7_8x16b, s33_8x16b);
 4014|       |/* store 8 8-bit output values  */
 4015|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 4016|   222k|                _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), s7_8x16b);
 4017|       |
 4018|   222k|                pu1_src += 2 * src_strd;
 4019|   222k|                pu1_dst += 2 * dst_strd;
 4020|       |
 4021|       |
 4022|   222k|            } /* inner for loop ends here(8-output values in single iteration) */
 4023|       |
 4024|  28.3k|        }
 4025|  17.9k|    }
 4026|  1.95M|    else if(wd % 4 == 0)
  ------------------
  |  Branch (4026:13): [True: 1.92M, False: 30.7k]
  ------------------
 4027|  1.92M|    { /* wd = multiple of 8 case */
 4028|       |
 4029|  5.74M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4029:22): [True: 3.82M, False: 1.92M]
  ------------------
 4030|  3.82M|        {
 4031|  3.82M|            pu1_src_copy = pu1_src;
 4032|  3.82M|            pu1_dst_copy = pu1_dst;
 4033|  7.65M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4033:26): [True: 3.83M, False: 3.82M]
  ------------------
 4034|  3.83M|            {
 4035|       |
 4036|  3.83M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  3.83M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4037|  3.83M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  3.83M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4038|       |
 4039|       |
 4040|       |                /*load 8 pixel values from -751:-768 pos. relative to cur. pos.*/
 4041|  3.83M|                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|  3.83M|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4045|       |
 4046|  3.83M|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4047|       |
 4048|  3.83M|                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|  3.83M|                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|  3.83M|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4055|       |
 4056|  3.83M|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4057|       |
 4058|  3.83M|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4059|       |
 4060|  3.83M|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4061|       |
 4062|  3.83M|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4063|       |
 4064|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4065|  3.83M|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  3.83M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  3.83M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4066|       |
 4067|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4068|  3.83M|                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|  3.83M|                _mm_storel_epi64((__m128i *)(pu1_dst), s7_8x16b);
 4073|       |
 4074|  3.83M|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4075|       |
 4076|  3.83M|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4077|  3.83M|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4078|       |
 4079|  3.83M|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4080|  3.83M|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4081|       |
 4082|  3.83M|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4083|       |
 4084|  3.83M|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4085|       |
 4086|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4087|  3.83M|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  3.83M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  3.83M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4088|       |
 4089|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4090|  3.83M|                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|  3.83M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s7_8x16b);
 4095|       |
 4096|  3.83M|                pu1_src += 8;    /* To pointer update */
 4097|  3.83M|                pu1_dst += 8;
 4098|       |
 4099|  3.83M|            } /* inner for loop ends here(8-output values in single iteration) */
 4100|       |
 4101|  3.82M|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4102|  3.82M|            pu1_dst = pu1_dst_copy + 2 * dst_strd; /* pointer update */
 4103|  3.82M|        }
 4104|  1.92M|    }
 4105|       |
 4106|  30.7k|    else
 4107|  30.7k|    { /* wd = multiple of 4 case */
 4108|       |
 4109|   106k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4109:22): [True: 75.5k, False: 30.7k]
  ------------------
 4110|  75.5k|        {
 4111|  75.5k|            pu1_src_copy = pu1_src;
 4112|  75.5k|            pu1_dst_copy = pu1_dst;
 4113|   163k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4113:26): [True: 87.8k, False: 75.5k]
  ------------------
 4114|  87.8k|            {
 4115|       |
 4116|  87.8k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  87.8k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4117|  87.8k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  87.8k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4118|       |
 4119|       |
 4120|       |                /*load 8 pixel values from -751:-768 pos. relative to cur. pos.*/
 4121|  87.8k|                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|  87.8k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4125|       |
 4126|  87.8k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4127|       |
 4128|  87.8k|                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|  87.8k|                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|  87.8k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4135|       |
 4136|  87.8k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4137|       |
 4138|  87.8k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4139|       |
 4140|  87.8k|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4141|       |
 4142|  87.8k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4143|       |
 4144|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4145|  87.8k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  87.8k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  87.8k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4146|       |
 4147|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4148|  87.8k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4149|       |
 4150|  87.8k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 4151|  87.8k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 4152|  87.8k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 4153|  87.8k|                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|  87.8k|                _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 4158|       |
 4159|  87.8k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4160|       |
 4161|  87.8k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4162|  87.8k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4163|       |
 4164|  87.8k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4165|  87.8k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4166|       |
 4167|  87.8k|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4168|       |
 4169|  87.8k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4170|       |
 4171|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4172|  87.8k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  87.8k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  87.8k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4173|       |
 4174|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4175|  87.8k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4176|       |
 4177|  87.8k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 4178|  87.8k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 4179|  87.8k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 4180|  87.8k|                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|  87.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s9_8x16b);
 4185|       |
 4186|  87.8k|                pu1_src += 4;   /* To pointer update */
 4187|  87.8k|                pu1_dst += 4;
 4188|  87.8k|            } /* inner for loop ends here(8-output values in single iteration) */
 4189|       |
 4190|  75.5k|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4191|  75.5k|            pu1_dst = pu1_dst_copy + 2 * dst_strd; /* pointer update */
 4192|  75.5k|        }
 4193|  30.7k|    }
 4194|  1.96M|}
ihevc_inter_pred_chroma_copy_w16out_ssse3:
 4243|  37.3M|{
 4244|  37.3M|    WORD32 row, col;
 4245|  37.3M|    __m128i  s3, zero_8x16b;
 4246|       |
 4247|  37.3M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  37.3M|#define ASSERT(x) {}
  ------------------
 4248|  37.3M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  37.3M|#define ASSERT(x) {}
  ------------------
 4249|       |
 4250|  37.3M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  37.3M|#define UNUSED(x) ((void)(x))
  ------------------
 4251|  37.3M|    zero_8x16b = _mm_setzero_si128();
 4252|       |/*  outer for loop starts from here */
 4253|  37.3M|    if(wd == 2) /* for wd =2 */
  ------------------
  |  Branch (4253:8): [True: 14.2k, False: 37.3M]
  ------------------
 4254|  14.2k|    {
 4255|  60.4k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4255:22): [True: 46.2k, False: 14.2k]
  ------------------
 4256|  46.2k|        {
 4257|  46.2k|            int offset = 0;
 4258|  92.4k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4258:26): [True: 46.2k, False: 46.2k]
  ------------------
 4259|  46.2k|            {
 4260|       |/* row =0 */
 4261|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 4262|  46.2k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 4263|  46.2k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4264|       |
 4265|  46.2k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  46.2k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  46.2k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4266|       |
 4267|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4268|  46.2k|                _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|  46.2k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4273|  46.2k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4274|       |
 4275|  46.2k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  46.2k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  46.2k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4276|       |
 4277|  46.2k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4278|  46.2k|                offset += 4; /* To pointer update */
 4279|  46.2k|            } /* inner for loop ends here */
 4280|       |
 4281|  46.2k|            pu1_src += 2 * src_strd; /* pointer update */
 4282|  46.2k|            pi2_dst += 2 * dst_strd; /* pointer update */
 4283|  46.2k|        }
 4284|  14.2k|    }
 4285|  37.3M|    else if(wd % 2 == 0 && wd % 4 != 0)
  ------------------
  |  Branch (4285:13): [True: 37.3M, False: 18.4E]
  |  Branch (4285:28): [True: 8.59k, False: 37.3M]
  ------------------
 4286|  8.59k|    {
 4287|  42.9k|        for(row = 0; row < ht / 2; row++)
  ------------------
  |  Branch (4287:22): [True: 34.3k, False: 8.59k]
  ------------------
 4288|  34.3k|        {
 4289|  34.3k|            int offset = 0;
 4290|  34.3k|            int count = (2 * wd) / 8;
 4291|  68.7k|            for(col = 0; col < count; col++)
  ------------------
  |  Branch (4291:26): [True: 34.3k, False: 34.3k]
  ------------------
 4292|  34.3k|            {
 4293|       |/* row =0 */
 4294|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 4295|  34.3k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]*/
 4296|  34.3k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4297|       |
 4298|       |                /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4299|  34.3k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  34.3k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  34.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4300|       |
 4301|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 4302|  34.3k|                _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|  34.3k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4306|  34.3k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4307|       |
 4308|  34.3k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  34.3k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  34.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4309|  34.3k|                _mm_storeu_si128((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4310|       |
 4311|  34.3k|                offset += 8; /* To pointer update*/
 4312|  34.3k|            } /*  inner for loop ends here(8-output values in single iteration) */
 4313|       |
 4314|       |/* finding last four values */
 4315|  34.3k|            s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 4316|  34.3k|            s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4317|       |
 4318|  34.3k|            s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  34.3k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  34.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4319|       |
 4320|       |            /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4321|  34.3k|            _mm_storel_epi64((__m128i *)(pi2_dst + offset), s3);
 4322|       |
 4323|       |            /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 4324|  34.3k|            s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4325|  34.3k|            s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4326|       |
 4327|  34.3k|            s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  34.3k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  34.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4328|  34.3k|            _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4329|       |
 4330|  34.3k|            pu1_src += 2 * src_strd; /* pointer update */
 4331|  34.3k|            pi2_dst += 2 * dst_strd;
 4332|  34.3k|        }
 4333|  8.59k|    }
 4334|  37.3M|    else
 4335|  37.3M|    {
 4336|   113M|        for(row = 0; row < ht / 2; row++)
  ------------------
  |  Branch (4336:22): [True: 76.3M, False: 37.3M]
  ------------------
 4337|  76.3M|        {
 4338|  76.3M|            int offset = 0;
 4339|   160M|            for(col = 0; col < 2 * wd / 8; col++)
  ------------------
  |  Branch (4339:26): [True: 84.1M, False: 76.3M]
  ------------------
 4340|  84.1M|            {
 4341|       |/* row =0 */
 4342|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 4343|  84.1M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]*/
 4344|  84.1M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4345|       |
 4346|       |                /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4347|  84.1M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  84.1M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  84.1M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4348|       |
 4349|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 4350|  84.1M|                _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|  84.1M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4354|  84.1M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4355|       |
 4356|  84.1M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  84.1M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  84.1M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4357|  84.1M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4358|       |
 4359|  84.1M|                offset += 8; /* To pointer update*/
 4360|  84.1M|            } /*  inner for loop ends here(8-output values in single iteration) */
 4361|       |
 4362|  76.3M|            pu1_src += 2 * src_strd; /* pointer update */
 4363|  76.3M|            pi2_dst += 2 * dst_strd;
 4364|  76.3M|        }
 4365|  37.3M|    }
 4366|  37.3M|}
ihevc_inter_pred_chroma_horz_w16out_ssse3:
 4415|  13.8M|{
 4416|  13.8M|    WORD32 row, col;
 4417|       |
 4418|  13.8M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, control_mask_1_8x16b, control_mask_2_8x16b, all_zero;
 4419|  13.8M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
 4420|  13.8M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
 4421|  13.8M|    __m128i res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b;
 4422|  13.8M|    __m128i res_temp11_8x16b, res_temp12_8x16b, res_temp13_8x16b;
 4423|       |
 4424|  13.8M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.8M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4425|  13.8M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.8M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4426|  13.8M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.8M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4427|  13.8M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.8M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4428|  13.8M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.8M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4429|  13.8M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  13.8M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4430|       |
 4431|  13.8M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  13.8M|#define ASSERT(x) {}
  ------------------
 4432|       |
 4433|       |/* loading four 8-bit coefficients and convert 8-bit into 16-bit */
 4434|  13.8M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 4435|       |
 4436|  13.8M|    all_zero = _mm_setzero_si128();
 4437|       |
 4438|  13.8M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 4439|  13.8M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 4440|       |
 4441|  13.8M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 4442|  13.8M|    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|  13.8M|    if(wd % 2 == 0 && wd % 4 != 0)
  ------------------
  |  Branch (4445:8): [True: 13.8M, False: 18.4E]
  |  Branch (4445:23): [True: 105k, False: 13.7M]
  ------------------
 4446|   105k|    {
 4447|   105k|        int offset = 0;
 4448|   465k|        for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (4448:23): [True: 360k, False: 105k]
  ------------------
 4449|   360k|        {
 4450|   360k|            offset = 0;
 4451|   360k|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   360k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4452|   360k|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   360k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4453|       |
 4454|       |
 4455|   857k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4455:26): [True: 496k, False: 360k]
  ------------------
 4456|   496k|            {
 4457|       |
 4458|       |                /*load 16 pixel values of row 0*/
 4459|   496k|                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|   496k|                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|   496k|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4466|       |
 4467|   496k|                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|   496k|                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|   496k|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4474|       |
 4475|   496k|                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|   496k|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 4479|       |
 4480|   496k|                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|   496k|                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|   496k|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 4487|       |
 4488|   496k|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 4489|       |
 4490|   496k|                res_temp1_8x16b = _mm_unpacklo_epi64(src_temp5_16x8b, src_temp15_16x8b);
 4491|   496k|                res_temp2_8x16b = _mm_unpacklo_epi64(src_temp6_16x8b, src_temp16_16x8b);
 4492|   496k|                res_temp11_8x16b = _mm_maddubs_epi16(res_temp1_8x16b, coeff0_1_8x16b);
 4493|   496k|                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|   496k|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 4497|       |
 4498|   496k|                res_temp3_8x16b = _mm_srli_si128(res_temp13_8x16b, 8);
 4499|       |
 4500|       |                /* store 4 16-bit values */
 4501|   496k|                _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|   496k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), res_temp3_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4507|       |
 4508|       |
 4509|   496k|                offset += 4; /* To pointer update*/
 4510|       |
 4511|   496k|            } /* inner loop ends here(8- output values in single iteration)*/
 4512|       |
 4513|   360k|            pu1_src += 2 * src_strd; /*pointer update*/
 4514|   360k|            pi2_dst += 2 * dst_strd; /*pointer update*/
 4515|   360k|        }
 4516|       |
 4517|       |        /*Epilogue to handle ht= odd case*/
 4518|   105k|        if(row)
  ------------------
  |  Branch (4518:12): [True: 95.5k, False: 9.50k]
  ------------------
 4519|  95.5k|        {
 4520|  95.5k|            offset = 0;
 4521|   212k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4521:26): [True: 116k, False: 95.5k]
  ------------------
 4522|   116k|            {
 4523|       |
 4524|       |                /*load 16 pixel values of row 0*/
 4525|   116k|                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|   116k|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4529|       |
 4530|   116k|                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|   116k|                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|   116k|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4537|       |
 4538|   116k|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 4539|       |
 4540|   116k|                res_temp1_8x16b = _mm_unpacklo_epi64(src_temp5_16x8b, all_zero);
 4541|   116k|                res_temp2_8x16b = _mm_unpacklo_epi64(src_temp6_16x8b, all_zero);
 4542|   116k|                res_temp11_8x16b = _mm_maddubs_epi16(res_temp1_8x16b, coeff0_1_8x16b);
 4543|   116k|                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|   116k|                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|   116k|                _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp13_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4552|       |
 4553|   116k|                offset += 4; /* To pointer update*/
 4554|       |
 4555|   116k|            }
 4556|  95.5k|        }
 4557|       |
 4558|   105k|    }
 4559|  13.7M|    else
 4560|  13.7M|    {
 4561|  13.7M|        int offset = 0;
 4562|       |
 4563|  50.9M|        for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (4563:23): [True: 37.2M, False: 13.7M]
  ------------------
 4564|  37.2M|        {
 4565|  37.2M|            offset = 0;
 4566|  37.2M|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  37.2M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4567|  37.2M|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  37.2M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4568|       |
 4569|       |
 4570|  79.2M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4570:26): [True: 42.0M, False: 37.2M]
  ------------------
 4571|  42.0M|            {
 4572|       |
 4573|       |                /*load 16 pixel values of row 0*/
 4574|  42.0M|                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|  42.0M|                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|  42.0M|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4581|       |
 4582|  42.0M|                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|  42.0M|                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|  42.0M|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4589|       |
 4590|  42.0M|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 4591|       |
 4592|  42.0M|                res_temp1_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff0_1_8x16b);
 4593|  42.0M|                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|  42.0M|                res_temp3_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 4597|       |
 4598|       |                /* store 8 16-bit values */
 4599|  42.0M|                _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|  42.0M|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 4603|       |
 4604|  42.0M|                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|  42.0M|                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|  42.0M|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 4611|       |
 4612|  42.0M|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 4613|       |
 4614|  42.0M|                res_temp11_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff0_1_8x16b);
 4615|  42.0M|                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|  42.0M|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 4619|       |
 4620|       |                /* store 8 16-bit values */
 4621|  42.0M|                _mm_storeu_si128((__m128i *)(pi2_dst + dst_strd + offset), res_temp13_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4622|       |
 4623|       |
 4624|  42.0M|                offset += 8; /* To pointer update*/
 4625|       |
 4626|  42.0M|            } /* inner loop ends here(8- output values in single iteration)*/
 4627|       |
 4628|  37.2M|            pu1_src += 2 * src_strd; /*pointer update*/
 4629|  37.2M|            pi2_dst += 2 * dst_strd; /*pointer update*/
 4630|  37.2M|        }
 4631|       |
 4632|       |        /*Epilogue to take care of odd ht*/
 4633|  13.7M|        if(row)
  ------------------
  |  Branch (4633:12): [True: 8.77M, False: 4.98M]
  ------------------
 4634|  8.77M|        {
 4635|  8.77M|            offset = 0;
 4636|  17.9M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4636:26): [True: 9.14M, False: 8.77M]
  ------------------
 4637|  9.14M|            {
 4638|       |
 4639|       |                /*load 16 pixel values of row 0*/
 4640|  9.14M|                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|  9.14M|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4644|       |
 4645|  9.14M|                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|  9.14M|                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|  9.14M|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4652|       |
 4653|  9.14M|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 4654|       |
 4655|  9.14M|                res_temp1_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff0_1_8x16b);
 4656|  9.14M|                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|  9.14M|                res_temp3_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 4660|       |
 4661|       |                /* store 8 16-bit values */
 4662|  9.14M|                _mm_storeu_si128((__m128i *)(pi2_dst + offset), res_temp3_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4663|       |
 4664|  9.14M|                offset += 8; /* To pointer update*/
 4665|       |
 4666|  9.14M|            }
 4667|  8.77M|        }
 4668|       |
 4669|  13.7M|    }
 4670|  13.8M|}
ihevc_inter_pred_chroma_vert_w16out_ssse3:
 4719|  5.60M|{
 4720|  5.60M|    WORD32 row, col;
 4721|  5.60M|    UWORD8 *pu1_src_copy;
 4722|  5.60M|    WORD16 *pi2_dst_copy;
 4723|  5.60M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 4724|  5.60M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s8_8x16b;
 4725|  5.60M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b;
 4726|  5.60M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 4727|  5.60M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 4728|  5.60M|    __m128i s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b;
 4729|       |
 4730|       |
 4731|  5.60M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.60M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4732|  5.60M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.60M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4733|  5.60M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.60M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4734|  5.60M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.60M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4735|  5.60M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.60M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4736|  5.60M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.60M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4737|       |
 4738|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 4739|  5.60M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 4740|       |
 4741|  5.60M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 4742|  5.60M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 4743|       |
 4744|  5.60M|    coeff0_1_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 4745|  5.60M|    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.60M|    if(wd % 8 == 0)
  ------------------
  |  Branch (4750:8): [True: 59.3k, False: 5.54M]
  ------------------
 4751|  59.3k|    { /* wd = multiple of 8 case */
 4752|       |
 4753|  59.3k|        pu1_src_copy = pu1_src;
 4754|  59.3k|        pi2_dst_copy = pi2_dst;
 4755|       |
 4756|   165k|        for(col = 0; col < 2 * wd; col += 16)
  ------------------
  |  Branch (4756:22): [True: 106k, False: 59.3k]
  ------------------
 4757|   106k|        {
 4758|       |
 4759|   106k|            pu1_src = pu1_src_copy + col;
 4760|   106k|            pi2_dst = pi2_dst_copy + col;
 4761|       |
 4762|       |
 4763|  1.04M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4763:26): [True: 939k, False: 106k]
  ------------------
 4764|   939k|            {
 4765|       |
 4766|   939k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   939k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4767|   939k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   939k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4768|       |
 4769|       |
 4770|       |                /*load 16 pixel values */
 4771|   939k|                s21_8x16b  = _mm_loadu_si128((__m128i *)(pu1_src + (-1 * src_strd)));
 4772|       |
 4773|       |                /*load 16 pixel values */
 4774|   939k|                s22_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (0 * src_strd)));
 4775|       |
 4776|       |
 4777|       |                /*load 16 pixel values */
 4778|   939k|                s23_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (1 * src_strd)));
 4779|       |
 4780|       |                /*load 16 pixel values */
 4781|   939k|                s24_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (2 * src_strd)));
 4782|       |
 4783|   939k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4784|       |
 4785|   939k|                s31_8x16b = _mm_unpackhi_epi8(s21_8x16b, s22_8x16b);
 4786|       |
 4787|   939k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4788|       |
 4789|   939k|                s33_8x16b = _mm_unpackhi_epi8(s23_8x16b, s24_8x16b);
 4790|       |
 4791|   939k|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4792|       |
 4793|   939k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 4794|       |
 4795|   939k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4796|       |
 4797|   939k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 4798|       |
 4799|   939k|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4800|       |
 4801|   939k|                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|   939k|                _mm_storeu_si128((__m128i *)(pi2_dst), s8_8x16b);
 4806|       |
 4807|   939k|                _mm_storeu_si128((__m128i *)(pi2_dst + 8), s35_8x16b);
 4808|       |
 4809|       |
 4810|   939k|                s25_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (3 * src_strd)));
 4811|       |
 4812|   939k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4813|       |
 4814|   939k|                s31_8x16b = _mm_unpackhi_epi8(s22_8x16b, s23_8x16b);
 4815|       |
 4816|   939k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4817|       |
 4818|   939k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 4819|       |
 4820|   939k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4821|       |
 4822|   939k|                s33_8x16b = _mm_unpackhi_epi8(s24_8x16b, s25_8x16b);
 4823|       |
 4824|   939k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4825|       |
 4826|   939k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 4827|       |
 4828|   939k|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4829|       |
 4830|   939k|                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|   939k|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s8_8x16b);
 4835|       |
 4836|   939k|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd + 8), s35_8x16b);
 4837|       |
 4838|       |
 4839|   939k|                pu1_src += 2 * src_strd;
 4840|   939k|                pi2_dst += 2 * dst_strd;
 4841|       |
 4842|       |
 4843|   939k|            } /* inner for loop ends here(8-output values in single iteration) */
 4844|       |
 4845|   106k|        }
 4846|  59.3k|    }
 4847|       |
 4848|  5.54M|    else if(wd % 4 == 0)
  ------------------
  |  Branch (4848:13): [True: 5.54M, False: 4.29k]
  ------------------
 4849|  5.54M|    { /* wd = multiple of 8 case */
 4850|       |
 4851|  16.6M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4851:22): [True: 11.1M, False: 5.54M]
  ------------------
 4852|  11.1M|        {
 4853|       |
 4854|  11.1M|            pu1_src_copy = pu1_src;
 4855|  11.1M|            pi2_dst_copy = pi2_dst;
 4856|       |
 4857|  22.2M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4857:26): [True: 11.1M, False: 11.1M]
  ------------------
 4858|  11.1M|            {
 4859|       |
 4860|  11.1M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  11.1M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4861|  11.1M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  11.1M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4862|       |
 4863|       |
 4864|       |                /*load 8 pixel values */
 4865|  11.1M|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 4866|       |
 4867|       |                /*load 8 pixel values */
 4868|  11.1M|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4869|       |
 4870|  11.1M|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4871|       |
 4872|  11.1M|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4873|       |
 4874|       |                /*load 8 pixel values */
 4875|  11.1M|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 4876|       |
 4877|       |                /*load 8 pixel values */
 4878|  11.1M|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4879|       |
 4880|  11.1M|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4881|       |
 4882|  11.1M|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4883|       |
 4884|  11.1M|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4885|       |
 4886|  11.1M|                _mm_storeu_si128((__m128i *)(pi2_dst), s8_8x16b);
 4887|       |
 4888|  11.1M|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4889|       |
 4890|  11.1M|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4891|  11.1M|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4892|       |
 4893|  11.1M|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4894|  11.1M|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4895|       |
 4896|  11.1M|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4897|       |
 4898|  11.1M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s8_8x16b);
 4899|       |
 4900|  11.1M|                pu1_src += 8;    /* To pointer update */
 4901|  11.1M|                pi2_dst += 8;
 4902|       |
 4903|  11.1M|            } /* inner for loop ends here(8-output values in single iteration) */
 4904|       |
 4905|  11.1M|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4906|  11.1M|            pi2_dst = pi2_dst_copy + 2 * dst_strd; /* pointer update */
 4907|  11.1M|        }
 4908|  5.54M|    }
 4909|       |
 4910|  4.29k|    else
 4911|  4.29k|    { /* wd = multiple of 4 case */
 4912|       |
 4913|  26.3k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4913:22): [True: 22.0k, False: 4.29k]
  ------------------
 4914|  22.0k|        {
 4915|  22.0k|            pu1_src_copy = pu1_src;
 4916|  22.0k|            pi2_dst_copy = pi2_dst;
 4917|  57.3k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4917:26): [True: 35.3k, False: 22.0k]
  ------------------
 4918|  35.3k|            {
 4919|       |
 4920|  35.3k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  35.3k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4921|  35.3k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  35.3k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4922|       |
 4923|       |
 4924|       |                /*load 8 pixel values */
 4925|  35.3k|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 4926|       |
 4927|       |                /*load 8 pixel values */
 4928|  35.3k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4929|       |
 4930|  35.3k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4931|       |
 4932|  35.3k|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4933|       |
 4934|       |                /*load 8 pixel values */
 4935|  35.3k|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 4936|       |
 4937|       |                /*load 8 pixel values */
 4938|  35.3k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4939|       |
 4940|  35.3k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4941|       |
 4942|  35.3k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4943|       |
 4944|  35.3k|                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.3k|                _mm_storel_epi64((__m128i *)(pi2_dst), s8_8x16b);
 4950|       |
 4951|  35.3k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4952|       |
 4953|  35.3k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4954|  35.3k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4955|       |
 4956|  35.3k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4957|  35.3k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4958|       |
 4959|  35.3k|                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.3k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s8_8x16b);
 4965|       |
 4966|  35.3k|                pu1_src += 4;   /* To pointer update */
 4967|  35.3k|                pi2_dst += 4;
 4968|  35.3k|            } /* inner for loop ends here(8-output values in single iteration) */
 4969|       |
 4970|  22.0k|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4971|  22.0k|            pi2_dst = pi2_dst_copy + 2 * dst_strd; /* pointer update */
 4972|  22.0k|        }
 4973|  4.29k|    }
 4974|  5.60M|}
ihevc_inter_pred_chroma_vert_w16inp_ssse3:
 5023|  3.02M|{
 5024|  3.02M|    WORD32 row, col;
 5025|  3.02M|    WORD16 *pi2_src_copy;
 5026|  3.02M|    UWORD8 *pu1_dst_copy;
 5027|  3.02M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 5028|  3.02M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
 5029|  3.02M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 5030|  3.02M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b, sign_reg;
 5031|  3.02M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 5032|  3.02M|    __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|  3.02M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 5037|       |
 5038|  3.02M|    zero_8x16b = _mm_setzero_si128();
 5039|  3.02M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 5040|  3.02M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 5041|       |
 5042|  3.02M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 5043|  3.02M|    coeff2_3_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(1, 1, 1, 1));  /* pi1_coeff[4] */
 5044|       |
 5045|       |/*  seting  values in register */
 5046|  3.02M|    offset_8x16b = _mm_set1_epi32(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  3.02M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  3.02M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  3.02M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5047|  3.02M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
 5048|  3.02M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
 5049|       |
 5050|       |/*  outer for loop starts from here */
 5051|  3.02M|    if(wd % 4 == 0)
  ------------------
  |  Branch (5051:8): [True: 2.94M, False: 78.3k]
  ------------------
 5052|  2.94M|    { /* wd = multiple of 8 case */
 5053|       |
 5054|  2.94M|        pi2_src_copy = pi2_src;
 5055|  2.94M|        pu1_dst_copy = pu1_dst;
 5056|       |
 5057|  5.97M|        for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (5057:22): [True: 3.02M, False: 2.94M]
  ------------------
 5058|  3.02M|        {
 5059|       |
 5060|  3.02M|            pi2_src = pi2_src_copy + col;
 5061|  3.02M|            pu1_dst = pu1_dst_copy + col;
 5062|       |
 5063|       |
 5064|  9.64M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5064:26): [True: 6.62M, False: 3.02M]
  ------------------
 5065|  6.62M|            {
 5066|       |
 5067|       |                /*load 16 pixel values */
 5068|  6.62M|                s21_8x16b  = _mm_load_si128((__m128i *)(pi2_src + (-1 * src_strd)));
 5069|       |
 5070|       |                /*load 16 pixel values */
 5071|  6.62M|                s22_8x16b = _mm_load_si128((__m128i *)(pi2_src + (0 * src_strd)));
 5072|       |
 5073|       |
 5074|       |                /*load 16 pixel values */
 5075|  6.62M|                s23_8x16b = _mm_load_si128((__m128i *)(pi2_src + (1 * src_strd)));
 5076|       |
 5077|       |                /*load 16 pixel values */
 5078|  6.62M|                s24_8x16b = _mm_load_si128((__m128i *)(pi2_src + (2 * src_strd)));
 5079|       |
 5080|  6.62M|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5081|       |
 5082|  6.62M|                s31_8x16b = _mm_unpackhi_epi16(s21_8x16b, s22_8x16b);
 5083|       |
 5084|  6.62M|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5085|       |
 5086|  6.62M|                s33_8x16b = _mm_unpackhi_epi16(s23_8x16b, s24_8x16b);
 5087|       |
 5088|  6.62M|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5089|       |
 5090|  6.62M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5091|       |
 5092|  6.62M|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5093|       |
 5094|  6.62M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5095|       |
 5096|  6.62M|                s8_8x16b = _mm_add_epi32(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5097|       |
 5098|  6.62M|                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.62M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5102|       |
 5103|  6.62M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5104|       |
 5105|       |
 5106|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5107|  6.62M|                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.62M|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5111|       |
 5112|  6.62M|                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.62M|                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.62M|                s34_8x16b = _mm_srai_epi32(s33_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5119|       |
 5120|  6.62M|                s35_8x16b = _mm_packs_epi32(s34_8x16b, zero_8x16b);
 5121|       |
 5122|       |
 5123|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5124|  6.62M|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5125|       |
 5126|  6.62M|                s33_8x16b =  _mm_packus_epi16(s35_8x16b, zero_8x16b);
 5127|       |
 5128|  6.62M|                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.62M|                _mm_storel_epi64((__m128i *)(pu1_dst), s7_8x16b);
 5132|       |
 5133|       |
 5134|  6.62M|                s25_8x16b = _mm_load_si128((__m128i *)(pi2_src + (3 * src_strd)));
 5135|       |
 5136|  6.62M|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5137|       |
 5138|  6.62M|                s31_8x16b = _mm_unpackhi_epi16(s22_8x16b, s23_8x16b);
 5139|       |
 5140|  6.62M|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5141|       |
 5142|  6.62M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5143|       |
 5144|  6.62M|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5145|       |
 5146|  6.62M|                s33_8x16b = _mm_unpackhi_epi16(s24_8x16b, s25_8x16b);
 5147|       |
 5148|  6.62M|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5149|       |
 5150|  6.62M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5151|       |
 5152|  6.62M|                s8_8x16b = _mm_add_epi32(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5153|       |
 5154|  6.62M|                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.62M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5158|       |
 5159|  6.62M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5160|       |
 5161|       |
 5162|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5163|  6.62M|                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.62M|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5167|       |
 5168|  6.62M|                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.62M|                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.62M|                s34_8x16b = _mm_srai_epi32(s33_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.62M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.62M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5175|       |
 5176|  6.62M|                s35_8x16b = _mm_packs_epi32(s34_8x16b, zero_8x16b);
 5177|       |
 5178|       |
 5179|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5180|  6.62M|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5181|       |
 5182|  6.62M|                s33_8x16b =  _mm_packus_epi16(s35_8x16b, zero_8x16b);
 5183|       |
 5184|  6.62M|                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.62M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s7_8x16b);
 5188|       |
 5189|  6.62M|                pi2_src += 2 * src_strd;
 5190|  6.62M|                pu1_dst += 2 * dst_strd;
 5191|       |
 5192|       |
 5193|  6.62M|            } /* inner for loop ends here(8-output values in single iteration) */
 5194|       |
 5195|  3.02M|        }
 5196|  2.94M|    }
 5197|  78.3k|    else
 5198|  78.3k|    { /* wd = multiple of 4 case */
 5199|       |
 5200|   256k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5200:22): [True: 178k, False: 78.3k]
  ------------------
 5201|   178k|        {
 5202|   178k|            pi2_src_copy = pi2_src;
 5203|   178k|            pu1_dst_copy = pu1_dst;
 5204|   392k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (5204:26): [True: 213k, False: 178k]
  ------------------
 5205|   213k|            {
 5206|       |
 5207|       |                /*load 8 pixel values  */
 5208|   213k|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 5209|       |
 5210|       |                /*load 8 pixel values */
 5211|   213k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 5212|       |
 5213|   213k|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5214|       |
 5215|   213k|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5216|       |
 5217|       |                /*load 8 pixel values */
 5218|   213k|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 5219|       |
 5220|       |                /*load 8 pixel values */
 5221|   213k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 5222|       |
 5223|   213k|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5224|       |
 5225|   213k|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5226|       |
 5227|   213k|                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|   213k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   213k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   213k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5232|       |
 5233|       |
 5234|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5235|   213k|                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|   213k|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   213k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   213k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5239|       |
 5240|   213k|                s9_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 5241|       |
 5242|       |
 5243|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5244|   213k|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5245|       |
 5246|   213k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 5247|   213k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 5248|   213k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 5249|   213k|                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|   213k|                _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 5254|       |
 5255|   213k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 5256|       |
 5257|   213k|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5258|   213k|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5259|       |
 5260|   213k|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5261|   213k|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5262|       |
 5263|   213k|                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|   213k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   213k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   213k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5267|       |
 5268|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5269|   213k|                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|   213k|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   213k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   213k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5273|       |
 5274|   213k|                s9_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 5275|       |
 5276|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5277|   213k|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5278|       |
 5279|   213k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 5280|   213k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 5281|   213k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 5282|   213k|                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|   213k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s9_8x16b);
 5287|       |
 5288|   213k|                pi2_src += 4;   /* To pointer update */
 5289|   213k|                pu1_dst += 4;
 5290|   213k|            } /* inner for loop ends here(8-output values in single iteration) */
 5291|       |
 5292|   178k|            pi2_src = pi2_src_copy + 2 * src_strd; /* pointer update */
 5293|   178k|            pu1_dst = pu1_dst_copy + 2 * dst_strd; /* pointer update */
 5294|   178k|        }
 5295|  78.3k|    }
 5296|       |
 5297|  3.02M|}
ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3:
 5348|  5.82M|{
 5349|  5.82M|    WORD32 row, col;
 5350|  5.82M|    WORD16 *pi2_src_copy;
 5351|  5.82M|    WORD16 *pi2_dst_copy;
 5352|  5.82M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 5353|  5.82M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
 5354|  5.82M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 5355|  5.82M|    __m128i zero_8x16b, sign_reg;
 5356|  5.82M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 5357|  5.82M|    __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.82M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 5362|       |
 5363|  5.82M|    zero_8x16b = _mm_setzero_si128();
 5364|  5.82M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 5365|  5.82M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 5366|       |
 5367|  5.82M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 5368|  5.82M|    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.82M|    if(wd % 4 == 0)
  ------------------
  |  Branch (5372:8): [True: 5.80M, False: 16.6k]
  ------------------
 5373|  5.80M|    { /* wd = multiple of 8 case */
 5374|       |
 5375|  5.80M|        pi2_src_copy = pi2_src;
 5376|  5.80M|        pi2_dst_copy = pi2_dst;
 5377|       |
 5378|  11.9M|        for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (5378:22): [True: 6.09M, False: 5.80M]
  ------------------
 5379|  6.09M|        {
 5380|       |
 5381|  6.09M|            pi2_src = pi2_src_copy + col;
 5382|  6.09M|            pi2_dst = pi2_dst_copy + col;
 5383|       |
 5384|       |
 5385|  20.9M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5385:26): [True: 14.8M, False: 6.09M]
  ------------------
 5386|  14.8M|            {
 5387|       |
 5388|       |                /*load 16 pixel values */
 5389|  14.8M|                s21_8x16b  = _mm_load_si128((__m128i *)(pi2_src + (-1 * src_strd)));
 5390|       |
 5391|       |                /*load 16 pixel values */
 5392|  14.8M|                s22_8x16b = _mm_load_si128((__m128i *)(pi2_src + (0 * src_strd)));
 5393|       |
 5394|       |
 5395|       |                /*load 16 pixel values */
 5396|  14.8M|                s23_8x16b = _mm_load_si128((__m128i *)(pi2_src + (1 * src_strd)));
 5397|       |
 5398|       |                /*load 16 pixel values */
 5399|  14.8M|                s24_8x16b = _mm_load_si128((__m128i *)(pi2_src + (2 * src_strd)));
 5400|       |
 5401|  14.8M|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5402|       |
 5403|  14.8M|                s31_8x16b = _mm_unpackhi_epi16(s21_8x16b, s22_8x16b);
 5404|       |
 5405|  14.8M|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5406|       |
 5407|  14.8M|                s33_8x16b = _mm_unpackhi_epi16(s23_8x16b, s24_8x16b);
 5408|       |
 5409|  14.8M|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5410|       |
 5411|  14.8M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5412|       |
 5413|  14.8M|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5414|       |
 5415|  14.8M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5416|       |
 5417|  14.8M|                s8_8x16b = _mm_add_epi32(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5418|       |
 5419|  14.8M|                s35_8x16b = _mm_add_epi32(s32_8x16b, s34_8x16b);
 5420|       |
 5421|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5422|  14.8M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  14.8M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  14.8M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5423|       |
 5424|  14.8M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  14.8M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  14.8M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5425|       |
 5426|  14.8M|                s9_8x16b = _mm_packs_epi32(s6_8x16b, zero_8x16b);
 5427|       |
 5428|  14.8M|                s35_8x16b = _mm_packs_epi32(s32_8x16b, zero_8x16b);
 5429|       |
 5430|  14.8M|                s7_8x16b = _mm_unpacklo_epi64(s9_8x16b, s35_8x16b);
 5431|       |/* store 8 8-bit output values  */
 5432|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 5433|  14.8M|                _mm_store_si128((__m128i *)(pi2_dst), s7_8x16b);
 5434|       |
 5435|       |
 5436|  14.8M|                s25_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + (3 * src_strd)));
 5437|       |
 5438|  14.8M|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5439|       |
 5440|  14.8M|                s31_8x16b = _mm_unpackhi_epi16(s22_8x16b, s23_8x16b);
 5441|       |
 5442|  14.8M|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5443|       |
 5444|  14.8M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5445|       |
 5446|  14.8M|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5447|       |
 5448|  14.8M|                s33_8x16b = _mm_unpackhi_epi16(s24_8x16b, s25_8x16b);
 5449|       |
 5450|  14.8M|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5451|       |
 5452|  14.8M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5453|       |
 5454|  14.8M|                s8_8x16b = _mm_add_epi32(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5455|       |
 5456|  14.8M|                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|  14.8M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  14.8M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  14.8M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5460|       |
 5461|  14.8M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  14.8M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  14.8M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5462|       |
 5463|  14.8M|                s9_8x16b = _mm_packs_epi32(s6_8x16b, zero_8x16b);
 5464|       |
 5465|  14.8M|                s35_8x16b = _mm_packs_epi32(s32_8x16b, zero_8x16b);
 5466|       |
 5467|  14.8M|                s7_8x16b = _mm_unpacklo_epi64(s9_8x16b, s35_8x16b);
 5468|       |/* store 8 8-bit output values  */
 5469|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 5470|  14.8M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s7_8x16b);
 5471|       |
 5472|  14.8M|                pi2_src += 2 * src_strd;
 5473|  14.8M|                pi2_dst += 2 * dst_strd;
 5474|       |
 5475|       |
 5476|  14.8M|            } /* inner for loop ends here(8-output values in single iteration) */
 5477|       |
 5478|  6.09M|        }
 5479|  5.80M|    }
 5480|  16.6k|    else
 5481|  16.6k|    { /* wd = multiple of 4 case */
 5482|       |
 5483|  70.7k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5483:22): [True: 54.0k, False: 16.6k]
  ------------------
 5484|  54.0k|        {
 5485|  54.0k|            pi2_src_copy = pi2_src;
 5486|  54.0k|            pi2_dst_copy = pi2_dst;
 5487|   157k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (5487:26): [True: 103k, False: 54.0k]
  ------------------
 5488|   103k|            {
 5489|       |
 5490|       |                /*load 4 pixel values */
 5491|   103k|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 5492|       |
 5493|       |                /*load 4 pixel values */
 5494|   103k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 5495|       |
 5496|   103k|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5497|       |
 5498|   103k|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5499|       |
 5500|       |                /*load 4 pixel values */
 5501|   103k|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 5502|       |
 5503|       |                /*load 4 pixel values */
 5504|   103k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 5505|       |
 5506|   103k|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5507|       |
 5508|   103k|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5509|       |
 5510|   103k|                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|   103k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   103k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   103k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5514|       |
 5515|   103k|                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|   103k|                _mm_storel_epi64((__m128i *)(pi2_dst), s9_8x16b);
 5520|       |
 5521|   103k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 5522|       |
 5523|   103k|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5524|   103k|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5525|       |
 5526|   103k|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5527|   103k|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5528|       |
 5529|   103k|                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|   103k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   103k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   103k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5533|       |
 5534|   103k|                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|   103k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s9_8x16b);
 5539|       |
 5540|   103k|                pi2_src += 4;   /* To pointer update */
 5541|   103k|                pi2_dst += 4;
 5542|   103k|            } /* inner for loop ends here(8-output values in single iteration) */
 5543|       |
 5544|  54.0k|            pi2_src = pi2_src_copy + 2 * src_strd; /* pointer update */
 5545|  54.0k|            pi2_dst = pi2_dst_copy + 2 * dst_strd; /* pointer update */
 5546|  54.0k|        }
 5547|  16.6k|    }
 5548|       |
 5549|  5.82M|}

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

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

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

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

ihevc_itrans_recon_4x4_ttype1_sse42:
  119|   146k|{
  120|   146k|    __m128i m_temp_reg_0;
  121|   146k|    __m128i m_temp_reg_1;
  122|   146k|    __m128i m_temp_reg_2;
  123|   146k|    __m128i m_temp_reg_3;
  124|   146k|    __m128i m_temp_reg_4;
  125|   146k|    __m128i m_temp_reg_10;
  126|   146k|    __m128i m_temp_reg_11;
  127|   146k|    __m128i m_temp_reg_12;
  128|   146k|    __m128i m_temp_reg_13;
  129|   146k|    __m128i m_temp_reg_14;
  130|   146k|    __m128i m_temp_reg_20;
  131|   146k|    __m128i m_temp_reg_21;
  132|   146k|    __m128i m_temp_reg_22;
  133|   146k|    __m128i m_temp_reg_23;
  134|   146k|    __m128i m_temp_reg_24;
  135|   146k|    __m128i m_temp_reg_25;
  136|   146k|    __m128i m_temp_reg_30;
  137|   146k|    __m128i m_temp_reg_31;
  138|   146k|    __m128i m_temp_reg_32;
  139|   146k|    __m128i m_temp_reg_33;
  140|   146k|    __m128i m_temp_reg_34;
  141|   146k|    __m128i m_temp_reg_35;
  142|   146k|    __m128i m_temp_reg_36;
  143|   146k|    __m128i m_coeff1, m_coeff2, m_coeff3;
  144|   146k|    __m128i m_rdng_factor;
  145|   146k|    __m128i m_count;
  146|       |
  147|   146k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   146k|#define IT_SHIFT_STAGE_1 7
  ------------------
  148|   146k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   146k|#define UNUSED(x) ((void)(x))
  ------------------
  149|   146k|    UNUSED(zero_cols);
  ------------------
  |  |   38|   146k|#define UNUSED(x) ((void)(x))
  ------------------
  150|   146k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|   146k|#define UNUSED(x) ((void)(x))
  ------------------
  151|       |
  152|   146k|    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype1[2][0]); //74
  153|       |
  154|   146k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  155|   146k|    pi2_src += src_strd;
  156|   146k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  157|   146k|    pi2_src += src_strd;
  158|   146k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  159|   146k|    pi2_src += src_strd;
  160|   146k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  161|       |
  162|   146k|    m_temp_reg_0 = _mm_cvtepi16_epi32(m_temp_reg_0);
  163|   146k|    m_temp_reg_2 = _mm_cvtepi16_epi32(m_temp_reg_2);
  164|       |
  165|   146k|    m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_1);
  166|   146k|    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|   146k|    {
  171|   146k|        m_temp_reg_14 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_2);
  172|   146k|    }
  173|       |
  174|       |    /* c[3] in m_temp_reg_13 */
  175|   146k|    {
  176|   146k|        m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_1, m_coeff3);
  177|   146k|    }
  178|       |
  179|       |    /* c[0] in m_temp_reg_10 */
  180|   146k|    {
  181|   146k|        m_temp_reg_10 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_2);
  182|   146k|    }
  183|       |
  184|       |    /* c[1] in m_temp_reg_11 */
  185|   146k|    {
  186|   146k|        m_temp_reg_11 = _mm_add_epi32(m_temp_reg_2, m_temp_reg_3);
  187|   146k|    }
  188|       |
  189|       |    /* c[2] in m_temp_reg_12 */
  190|   146k|    {
  191|   146k|        m_temp_reg_12 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_3);
  192|   146k|    }
  193|       |
  194|       |    /* c[4] in m_temp_reg_14 */
  195|       |    /* c[4] = src[0] - src[2] + src[3] */
  196|   146k|    {
  197|   146k|        m_temp_reg_14 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_3);
  198|   146k|    }
  199|       |
  200|   146k|    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype1[1][0]); //29
  201|   146k|    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|   146k|    {
  205|   146k|        m_temp_reg_30 = _mm_mullo_epi32(m_temp_reg_10, m_coeff1); //29*c0
  206|   146k|        m_temp_reg_31 = _mm_mullo_epi32(m_temp_reg_11, m_coeff2); //55*c1
  207|       |
  208|   146k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  209|       |
  210|   146k|        m_temp_reg_32 = _mm_mullo_epi32(m_temp_reg_11, m_coeff1); //29*c1
  211|   146k|        m_temp_reg_33 = _mm_mullo_epi32(m_temp_reg_12, m_coeff2); //55*c2
  212|       |
  213|   146k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  214|       |
  215|   146k|        m_temp_reg_34 = _mm_mullo_epi32(m_temp_reg_10, m_coeff2); //55*c0
  216|   146k|        m_temp_reg_35 = _mm_mullo_epi32(m_temp_reg_12, m_coeff1); //29*c2
  217|   146k|        m_temp_reg_36 = _mm_mullo_epi32(m_temp_reg_14, m_coeff3); //74*c4
  218|       |
  219|   146k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  220|   146k|        m_count = _mm_cvtsi32_si128(i4_shift);
  221|       |
  222|   146k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  223|   146k|        m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_13);
  224|   146k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  225|       |
  226|   146k|        m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  227|   146k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  228|       |
  229|   146k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  230|   146k|        m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_13);
  231|   146k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  232|       |
  233|   146k|        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  234|       |
  235|   146k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  236|   146k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  237|   146k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  238|   146k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  239|       |
  240|   146k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  241|   146k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  242|   146k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  243|   146k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  244|       |
  245|   146k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  246|   146k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  247|       |
  248|   146k|        m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  249|   146k|        m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  250|       |
  251|   146k|    }
  252|       |
  253|       |    /* Stage 2 */
  254|   146k|    {
  255|   146k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   146k|#define IT_SHIFT_STAGE_2 12
  ------------------
  256|       |
  257|   146k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  258|   146k|        m_temp_reg_20 = _mm_cvtepi16_epi32(m_temp_reg_20);
  259|   146k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  260|   146k|        m_temp_reg_21 = _mm_cvtepi16_epi32(m_temp_reg_21);
  261|   146k|        m_temp_reg_22 = _mm_cvtepi16_epi32(m_temp_reg_22);
  262|   146k|        m_temp_reg_23 = _mm_cvtepi16_epi32(m_temp_reg_23);
  263|       |
  264|       |        /* c[4] stored in m_temp_reg_4 */
  265|   146k|        {
  266|   146k|            m_temp_reg_4 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
  267|   146k|        }
  268|       |
  269|       |        /* c[3] stored in m_temp_reg_3 */
  270|   146k|        {
  271|   146k|            m_temp_reg_3 = _mm_mullo_epi32(m_temp_reg_22, m_coeff3);
  272|   146k|        }
  273|       |
  274|       |        /* c[0] stored in m_temp_reg_0 */
  275|   146k|        {
  276|   146k|            m_temp_reg_0 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  277|   146k|        }
  278|       |
  279|       |        /* c[1] stored in m_temp_reg_1 */
  280|   146k|        {
  281|   146k|            m_temp_reg_1 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_21);
  282|   146k|        }
  283|       |
  284|       |        /* c[2] stored in m_temp_reg_2 */
  285|   146k|        {
  286|   146k|            m_temp_reg_2 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_23);
  287|   146k|        }
  288|       |
  289|       |        /* c[4] stored in m_temp_reg_4 */
  290|   146k|        {
  291|   146k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_4, m_temp_reg_23);
  292|   146k|        }
  293|       |
  294|       |        /* Stage 2 output generation */
  295|   146k|        {
  296|   146k|            m_temp_reg_30 = _mm_mullo_epi32(m_temp_reg_0, m_coeff1); //29*c0
  297|   146k|            m_temp_reg_31 = _mm_mullo_epi32(m_temp_reg_1, m_coeff2); //55*c1
  298|       |
  299|   146k|            m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  300|       |
  301|   146k|            m_temp_reg_32 = _mm_mullo_epi32(m_temp_reg_1, m_coeff1); //29*c1
  302|   146k|            m_temp_reg_33 = _mm_mullo_epi32(m_temp_reg_2, m_coeff2); //55*c2
  303|       |
  304|   146k|            m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  305|       |
  306|   146k|            m_temp_reg_34 = _mm_mullo_epi32(m_temp_reg_0, m_coeff2); //55*c0
  307|   146k|            m_temp_reg_35 = _mm_mullo_epi32(m_temp_reg_2, m_coeff1); //29*c2
  308|   146k|            m_temp_reg_36 = _mm_mullo_epi32(m_temp_reg_4, m_coeff3); //74*c4
  309|       |
  310|   146k|            m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  311|   146k|            m_count = _mm_cvtsi32_si128(i4_shift);
  312|       |
  313|   146k|            m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_3);
  314|   146k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  315|   146k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  316|       |
  317|   146k|            m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  318|   146k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  319|       |
  320|   146k|            m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_3);
  321|   146k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  322|   146k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  323|       |
  324|   146k|            m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  325|       |
  326|   146k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  327|   146k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  328|   146k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  329|   146k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  330|       |
  331|   146k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  332|   146k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  333|   146k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  334|   146k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  335|       |
  336|   146k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  337|   146k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  338|       |
  339|   146k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  340|   146k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  341|   146k|        }
  342|       |
  343|       |        /* Recon and store */
  344|   146k|        {
  345|   146k|            WORD32 *pi4_dst = (WORD32 *)pu1_dst;
  346|       |
  347|   146k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  348|   146k|            pu1_pred += pred_strd;
  349|   146k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  350|   146k|            pu1_pred += pred_strd;
  351|   146k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  352|   146k|            pu1_pred += pred_strd;
  353|   146k|            m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
  354|       |
  355|   146k|            m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
  356|   146k|            m_temp_reg_1 = _mm_cvtepu8_epi16(m_temp_reg_1);
  357|   146k|            m_temp_reg_2 = _mm_cvtepu8_epi16(m_temp_reg_2);
  358|   146k|            m_temp_reg_3 = _mm_cvtepu8_epi16(m_temp_reg_3);
  359|   146k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  360|   146k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  361|       |
  362|   146k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  363|   146k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  364|       |
  365|   146k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  366|       |
  367|   146k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  368|   146k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  369|   146k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  370|   146k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  371|   146k|            pu1_dst += dst_strd;
  372|   146k|            pi4_dst = (WORD32 *)(pu1_dst);
  373|       |
  374|   146k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  375|   146k|            pu1_dst += dst_strd;
  376|   146k|            pi4_dst = (WORD32 *)(pu1_dst);
  377|       |
  378|   146k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  379|   146k|            pu1_dst += dst_strd;
  380|   146k|            pi4_dst = (WORD32 *)(pu1_dst);
  381|       |
  382|   146k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  383|   146k|        }
  384|   146k|    }
  385|   146k|}
ihevc_itrans_recon_4x4_sse42:
  449|  35.7k|{
  450|       |
  451|       |
  452|  35.7k|    __m128i m_temp_reg_0;
  453|  35.7k|    __m128i m_temp_reg_1;
  454|  35.7k|    __m128i m_temp_reg_2;
  455|  35.7k|    __m128i m_temp_reg_3;
  456|  35.7k|    __m128i m_temp_reg_10;
  457|  35.7k|    __m128i m_temp_reg_11;
  458|  35.7k|    __m128i m_temp_reg_12;
  459|  35.7k|    __m128i m_temp_reg_13;
  460|  35.7k|    __m128i m_temp_reg_14;
  461|  35.7k|    __m128i m_temp_reg_15;
  462|  35.7k|    __m128i m_temp_reg_20;
  463|  35.7k|    __m128i m_temp_reg_21;
  464|  35.7k|    __m128i m_temp_reg_22;
  465|  35.7k|    __m128i m_temp_reg_23;
  466|  35.7k|    __m128i m_temp_reg_24;
  467|  35.7k|    __m128i m_temp_reg_25;
  468|  35.7k|    __m128i m_temp_reg_30;
  469|  35.7k|    __m128i m_temp_reg_31;
  470|  35.7k|    __m128i m_temp_reg_33;
  471|  35.7k|    __m128i m_temp_reg_34;
  472|  35.7k|    __m128i m_coeff1, m_coeff3;
  473|  35.7k|    __m128i m_rdng_factor;
  474|  35.7k|    __m128i m_count;
  475|       |
  476|       |
  477|  35.7k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  35.7k|#define IT_SHIFT_STAGE_1 7
  ------------------
  478|  35.7k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  35.7k|#define UNUSED(x) ((void)(x))
  ------------------
  479|  35.7k|    UNUSED(zero_cols);
  ------------------
  |  |   38|  35.7k|#define UNUSED(x) ((void)(x))
  ------------------
  480|  35.7k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|  35.7k|#define UNUSED(x) ((void)(x))
  ------------------
  481|       |
  482|       |
  483|  35.7k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  484|  35.7k|    pi2_src += src_strd;
  485|  35.7k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  486|  35.7k|    pi2_src += src_strd;
  487|  35.7k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  488|  35.7k|    pi2_src += src_strd;
  489|  35.7k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  490|       |
  491|  35.7k|    m_temp_reg_0 = _mm_cvtepi16_epi32(m_temp_reg_0);
  492|  35.7k|    m_temp_reg_2 = _mm_cvtepi16_epi32(m_temp_reg_2);
  493|       |
  494|  35.7k|    m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_1);
  495|  35.7k|    m_temp_reg_3 = _mm_cvtepi16_epi32(m_temp_reg_3);
  496|       |
  497|       |
  498|  35.7k|    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype0[0][0]); //36
  499|  35.7k|    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype0[2][0]); //83
  500|       |
  501|       |    /* e */
  502|  35.7k|    {
  503|  35.7k|        m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 6);
  504|  35.7k|        m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 6);
  505|  35.7k|    }
  506|       |
  507|       |    /* o */
  508|  35.7k|    {
  509|  35.7k|        m_temp_reg_12 = _mm_mullo_epi32(m_temp_reg_1, m_coeff1); //src[1]*36
  510|  35.7k|        m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_3, m_coeff3); //src[3]*83
  511|  35.7k|        m_temp_reg_14 = _mm_mullo_epi32(m_temp_reg_1, m_coeff3); //src[1]*83
  512|  35.7k|        m_temp_reg_15 = _mm_mullo_epi32(m_temp_reg_3, m_coeff1); //src[3]*36
  513|  35.7k|    }
  514|       |
  515|  35.7k|    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  516|       |
  517|       |    /* e1 stored in m_temp_reg_31 */
  518|  35.7k|    {
  519|  35.7k|        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  520|  35.7k|    }
  521|       |
  522|  35.7k|    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  523|       |
  524|       |    /* e0 stored in m_temp_reg_30 */
  525|  35.7k|    {
  526|  35.7k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  527|  35.7k|    }
  528|       |
  529|  35.7k|    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  530|  35.7k|    m_count = _mm_cvtsi32_si128(i4_shift);
  531|       |
  532|       |    /* o1 stored in m_temp_reg_33 */
  533|  35.7k|    {
  534|  35.7k|        m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  535|  35.7k|    }
  536|       |
  537|       |    /* e1 + add */
  538|  35.7k|    {
  539|  35.7k|        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  540|  35.7k|    }
  541|       |
  542|       |    /* e0 + add */
  543|  35.7k|    {
  544|  35.7k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  545|  35.7k|    }
  546|       |
  547|       |    /* o0 stored in m_temp_reg_34 */
  548|  35.7k|    {
  549|  35.7k|        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  550|  35.7k|    }
  551|       |
  552|       |    /* Stage 1 outputs */
  553|  35.7k|    {
  554|  35.7k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  555|  35.7k|        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  556|       |
  557|  35.7k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  558|  35.7k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  559|       |
  560|       |
  561|  35.7k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  562|  35.7k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  563|  35.7k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  564|  35.7k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  565|       |
  566|  35.7k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  567|  35.7k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  568|  35.7k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  569|  35.7k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  570|       |
  571|  35.7k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  572|  35.7k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  573|       |
  574|  35.7k|        m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  575|  35.7k|        m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  576|  35.7k|    }
  577|       |
  578|       |    /* Stage 2 */
  579|  35.7k|    {
  580|  35.7k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  35.7k|#define IT_SHIFT_STAGE_2 12
  ------------------
  581|       |
  582|  35.7k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  583|  35.7k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  584|       |
  585|  35.7k|        m_temp_reg_20 = _mm_cvtepi16_epi32(m_temp_reg_20);
  586|  35.7k|        m_temp_reg_21 = _mm_cvtepi16_epi32(m_temp_reg_21);
  587|       |
  588|  35.7k|        m_temp_reg_22 = _mm_cvtepi16_epi32(m_temp_reg_22);
  589|  35.7k|        m_temp_reg_23 = _mm_cvtepi16_epi32(m_temp_reg_23);
  590|       |
  591|       |        /* e */
  592|  35.7k|        {
  593|  35.7k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_20, 6);
  594|  35.7k|        }
  595|       |
  596|       |        /* o */
  597|  35.7k|        {
  598|  35.7k|            m_temp_reg_12 = _mm_mullo_epi32(m_temp_reg_22, m_coeff1); //src[1]*36
  599|  35.7k|            m_temp_reg_14 = _mm_mullo_epi32(m_temp_reg_22, m_coeff3); //src[1]*83
  600|  35.7k|            m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_23, m_coeff3); //src[3]*83
  601|  35.7k|            m_temp_reg_15 = _mm_mullo_epi32(m_temp_reg_23, m_coeff1); //src[3]*36
  602|  35.7k|        }
  603|       |
  604|       |        /* e */
  605|  35.7k|        {
  606|  35.7k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_21, 6);
  607|  35.7k|        }
  608|       |
  609|  35.7k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  610|       |
  611|       |        /* e1 stored in m_temp_reg_31 */
  612|  35.7k|        {
  613|  35.7k|            m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  614|  35.7k|        }
  615|       |
  616|  35.7k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  617|       |
  618|       |        /* e0 stored in m_temp_reg_30 */
  619|  35.7k|        {
  620|  35.7k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  621|  35.7k|        }
  622|       |
  623|  35.7k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  624|  35.7k|        m_count = _mm_cvtsi32_si128(i4_shift);
  625|       |
  626|       |        /* o1 stored in m_temp_reg_33 */
  627|  35.7k|        {
  628|  35.7k|            m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  629|  35.7k|        }
  630|       |
  631|       |        /* e1 + add */
  632|  35.7k|        {
  633|  35.7k|            m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  634|  35.7k|        }
  635|       |
  636|       |        /* e0 + add */
  637|  35.7k|        {
  638|  35.7k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  639|  35.7k|        }
  640|       |
  641|       |        /* o0 stored in m_temp_reg_34 */
  642|  35.7k|        {
  643|  35.7k|            m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  644|  35.7k|        }
  645|       |
  646|       |        /* Stage 2 outputs */
  647|  35.7k|        {
  648|  35.7k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  649|  35.7k|            m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  650|  35.7k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  651|  35.7k|            m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  652|       |
  653|  35.7k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  654|  35.7k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  655|  35.7k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  656|  35.7k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  657|       |
  658|  35.7k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  659|  35.7k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  660|  35.7k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  661|  35.7k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  662|       |
  663|  35.7k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  664|  35.7k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  665|       |
  666|  35.7k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  667|  35.7k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  668|  35.7k|        }
  669|       |
  670|       |        /* Recon and store */
  671|  35.7k|        {
  672|  35.7k|            UWORD32 *pu4_dst = (UWORD32 *)pu1_dst;
  673|       |
  674|  35.7k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  675|  35.7k|            pu1_pred += pred_strd;
  676|  35.7k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  677|  35.7k|            pu1_pred += pred_strd;
  678|  35.7k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  679|  35.7k|            pu1_pred += pred_strd;
  680|  35.7k|            m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
  681|       |
  682|  35.7k|            m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
  683|  35.7k|            m_temp_reg_1 = _mm_cvtepu8_epi16(m_temp_reg_1);
  684|  35.7k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  685|  35.7k|            m_temp_reg_2 = _mm_cvtepu8_epi16(m_temp_reg_2);
  686|  35.7k|            m_temp_reg_3 = _mm_cvtepu8_epi16(m_temp_reg_3);
  687|  35.7k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  688|       |
  689|  35.7k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  690|  35.7k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  691|       |
  692|  35.7k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  693|       |
  694|  35.7k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  695|  35.7k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  696|  35.7k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  697|  35.7k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  698|  35.7k|            pu1_dst += dst_strd;
  699|  35.7k|            pu4_dst = (UWORD32 *)(pu1_dst);
  700|       |
  701|  35.7k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  702|  35.7k|            pu1_dst += dst_strd;
  703|  35.7k|            pu4_dst = (UWORD32 *)(pu1_dst);
  704|       |
  705|  35.7k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  706|  35.7k|            pu1_dst += dst_strd;
  707|  35.7k|            pu4_dst = (UWORD32 *)(pu1_dst);
  708|       |
  709|  35.7k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  710|  35.7k|        }
  711|  35.7k|    }
  712|  35.7k|}
ihevc_itrans_recon_8x8_sse42:
  779|  66.1k|{
  780|  66.1k|    __m128i m_temp_reg_0;
  781|  66.1k|    __m128i m_temp_reg_1;
  782|  66.1k|    __m128i m_temp_reg_2;
  783|  66.1k|    __m128i m_temp_reg_3;
  784|  66.1k|    __m128i m_temp_reg_5;
  785|  66.1k|    __m128i m_temp_reg_6;
  786|  66.1k|    __m128i m_temp_reg_7;
  787|  66.1k|    __m128i m_temp_reg_4;
  788|  66.1k|    __m128i m_temp_reg_10;
  789|  66.1k|    __m128i m_temp_reg_11;
  790|  66.1k|    __m128i m_temp_reg_12;
  791|  66.1k|    __m128i m_temp_reg_13;
  792|  66.1k|    __m128i m_temp_reg_14;
  793|  66.1k|    __m128i m_temp_reg_15;
  794|  66.1k|    __m128i m_temp_reg_16;
  795|  66.1k|    __m128i m_temp_reg_17;
  796|  66.1k|    __m128i m_temp_reg_20;
  797|  66.1k|    __m128i m_temp_reg_21;
  798|  66.1k|    __m128i m_temp_reg_22;
  799|  66.1k|    __m128i m_temp_reg_23;
  800|  66.1k|    __m128i m_temp_reg_24;
  801|  66.1k|    __m128i m_temp_reg_25;
  802|  66.1k|    __m128i m_temp_reg_26;
  803|  66.1k|    __m128i m_temp_reg_27;
  804|  66.1k|    __m128i m_temp_reg_30;
  805|  66.1k|    __m128i m_temp_reg_31;
  806|  66.1k|    __m128i m_temp_reg_32;
  807|  66.1k|    __m128i m_temp_reg_33;
  808|  66.1k|    __m128i m_temp_reg_34;
  809|  66.1k|    __m128i m_temp_reg_35;
  810|  66.1k|    __m128i m_temp_reg_36;
  811|  66.1k|    __m128i m_temp_reg_37;
  812|  66.1k|    __m128i m_temp_reg_40;
  813|  66.1k|    __m128i m_temp_reg_41;
  814|  66.1k|    __m128i m_temp_reg_42;
  815|  66.1k|    __m128i m_temp_reg_43;
  816|  66.1k|    __m128i m_temp_reg_44;
  817|  66.1k|    __m128i m_temp_reg_45;
  818|  66.1k|    __m128i m_temp_reg_46;
  819|  66.1k|    __m128i m_temp_reg_47;
  820|  66.1k|    __m128i m_temp_reg_50;
  821|  66.1k|    __m128i m_temp_reg_51;
  822|  66.1k|    __m128i m_temp_reg_52;
  823|  66.1k|    __m128i m_temp_reg_53;
  824|  66.1k|    __m128i m_temp_reg_54;
  825|  66.1k|    __m128i m_temp_reg_55;
  826|  66.1k|    __m128i m_temp_reg_56;
  827|  66.1k|    __m128i m_temp_reg_57;
  828|  66.1k|    __m128i m_temp_reg_60;
  829|  66.1k|    __m128i m_temp_reg_61;
  830|  66.1k|    __m128i m_temp_reg_62;
  831|  66.1k|    __m128i m_temp_reg_63;
  832|  66.1k|    __m128i m_temp_reg_64;
  833|  66.1k|    __m128i m_temp_reg_65;
  834|  66.1k|    __m128i m_temp_reg_66;
  835|  66.1k|    __m128i m_temp_reg_67;
  836|  66.1k|    __m128i m_temp_reg_70;
  837|  66.1k|    __m128i m_temp_reg_71;
  838|  66.1k|    __m128i m_temp_reg_72;
  839|  66.1k|    __m128i m_temp_reg_73;
  840|  66.1k|    __m128i m_temp_reg_74;
  841|  66.1k|    __m128i m_temp_reg_75;
  842|  66.1k|    __m128i m_temp_reg_76;
  843|  66.1k|    __m128i m_temp_reg_77;
  844|  66.1k|    __m128i m_coeff1, m_coeff2, m_coeff3, m_coeff4;
  845|       |
  846|  66.1k|    WORD32 check_row_stage_1;   /* Lokesh */
  847|  66.1k|    WORD32 check_row_stage_2;   /* Lokesh */
  848|       |
  849|  66.1k|    __m128i m_rdng_factor;
  850|  66.1k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  66.1k|#define IT_SHIFT_STAGE_1 7
  ------------------
  851|  66.1k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|  66.1k|#define UNUSED(x) ((void)(x))
  ------------------
  852|  66.1k|    check_row_stage_1   = ((zero_rows & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (852:27): [True: 22.3k, False: 43.8k]
  ------------------
  853|  66.1k|    check_row_stage_2   = ((zero_cols & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (853:27): [True: 25.0k, False: 41.1k]
  ------------------
  854|       |
  855|  66.1k|    m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src);
  856|  66.1k|    pi2_src += src_strd;
  857|  66.1k|    m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src);
  858|  66.1k|    pi2_src += src_strd;
  859|  66.1k|    m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_src);
  860|  66.1k|    pi2_src += src_strd;
  861|  66.1k|    m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_src);
  862|  66.1k|    pi2_src += src_strd;
  863|       |
  864|  66.1k|    m_temp_reg_74 = _mm_loadu_si128((__m128i *)pi2_src);
  865|  66.1k|    pi2_src += src_strd;
  866|  66.1k|    m_temp_reg_75 = _mm_loadu_si128((__m128i *)pi2_src);
  867|  66.1k|    pi2_src += src_strd;
  868|  66.1k|    m_temp_reg_76 = _mm_loadu_si128((__m128i *)pi2_src);
  869|  66.1k|    pi2_src += src_strd;
  870|  66.1k|    m_temp_reg_77 = _mm_loadu_si128((__m128i *)pi2_src);
  871|       |
  872|  66.1k|    if(!check_row_stage_2)
  ------------------
  |  Branch (872:8): [True: 41.1k, False: 25.0k]
  ------------------
  873|  41.1k|    {
  874|  41.1k|        if(!check_row_stage_1)
  ------------------
  |  Branch (874:12): [True: 34.1k, False: 7.05k]
  ------------------
  875|  34.1k|        {
  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|  34.1k|            {
  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|  34.1k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
  882|  34.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
  883|       |
  884|  34.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
  885|       |
  886|  34.1k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
  887|  34.1k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
  888|       |
  889|  34.1k|            }
  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|  34.1k|            {
  896|       |
  897|  34.1k|                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|  34.1k|                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|  34.1k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
  903|       |
  904|  34.1k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
  905|  34.1k|                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|  34.1k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
  911|  34.1k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
  912|       |
  913|  34.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
  914|  34.1k|                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|  34.1k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
  925|  34.1k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
  926|       |
  927|  34.1k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
  928|  34.1k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
  929|       |
  930|  34.1k|            }
  931|       |
  932|       |            /* o */
  933|  34.1k|            {
  934|       |
  935|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
  936|  34.1k|                {
  937|       |
  938|  34.1k|                    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|  34.1k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
  941|       |
  942|  34.1k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  943|  34.1k|                    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|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  956|  34.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  957|       |
  958|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
  959|  34.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
  960|       |
  961|  34.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
  962|  34.1k|                    m_temp_reg_63 = _mm_setzero_si128();
  963|  34.1k|                    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|  34.1k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
  967|       |
  968|  34.1k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
  969|  34.1k|                    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|  34.1k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
  974|  34.1k|                    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|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
  986|  34.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
  987|       |
  988|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
  989|  34.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
  990|       |
  991|  34.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
  992|  34.1k|                    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|  34.1k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
  996|       |
  997|  34.1k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
  998|  34.1k|                    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|  34.1k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1006|  34.1k|                    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|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1016|  34.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1017|       |
 1018|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1019|  34.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1020|       |
 1021|  34.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1022|  34.1k|                    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|  34.1k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1026|       |
 1027|  34.1k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1028|  34.1k|                    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|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1042|  34.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1043|       |
 1044|  34.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1045|  34.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1046|       |
 1047|  34.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1048|  34.1k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1049|       |
 1050|       |
 1051|  34.1k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1052|  34.1k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1053|  34.1k|                }
 1054|  34.1k|            }
 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|  34.1k|            {
 1060|  34.1k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1061|  34.1k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1062|  34.1k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1063|  34.1k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1064|       |
 1065|  34.1k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1066|  34.1k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1067|       |
 1068|  34.1k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1069|  34.1k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1070|       |
 1071|  34.1k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1072|  34.1k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1073|  34.1k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1074|  34.1k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1075|       |
 1076|  34.1k|                m_temp_reg_54 = _mm_setzero_si128();
 1077|  34.1k|                m_temp_reg_55 = _mm_setzero_si128();
 1078|  34.1k|                m_temp_reg_56 = _mm_setzero_si128();
 1079|  34.1k|                m_temp_reg_57 = _mm_setzero_si128();
 1080|  34.1k|            }
 1081|  34.1k|        }
 1082|  7.05k|        else
 1083|  7.05k|        {
 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|  7.05k|            {
 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|  7.05k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1090|  7.05k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1091|       |
 1092|  7.05k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1093|       |
 1094|  7.05k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1095|  7.05k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1096|       |
 1097|  7.05k|            }
 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|  7.05k|            {
 1104|       |
 1105|  7.05k|                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|  7.05k|                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|  7.05k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1111|       |
 1112|  7.05k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1113|  7.05k|                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|  7.05k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1119|  7.05k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1120|       |
 1121|  7.05k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1122|  7.05k|                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|  7.05k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1133|  7.05k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1134|       |
 1135|  7.05k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1136|  7.05k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1137|       |
 1138|  7.05k|            }
 1139|       |
 1140|       |            /* o */
 1141|  7.05k|            {
 1142|       |
 1143|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1144|  7.05k|                {
 1145|       |
 1146|  7.05k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1147|  7.05k|                    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|  7.05k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1150|  7.05k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1151|       |
 1152|  7.05k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1153|  7.05k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1154|       |
 1155|  7.05k|                    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|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1168|  7.05k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1169|       |
 1170|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1171|  7.05k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1172|       |
 1173|  7.05k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1174|  7.05k|                    m_temp_reg_63 = _mm_setzero_si128();
 1175|  7.05k|                    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|  7.05k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1179|  7.05k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1180|       |
 1181|  7.05k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1182|  7.05k|                    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|  7.05k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1187|  7.05k|                    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|  7.05k|                    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|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1200|  7.05k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1201|       |
 1202|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1203|  7.05k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1204|       |
 1205|  7.05k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1206|  7.05k|                    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|  7.05k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1210|  7.05k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1211|       |
 1212|  7.05k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1213|  7.05k|                    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|  7.05k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1221|  7.05k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 1222|       |
 1223|  7.05k|                    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|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1232|  7.05k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1233|       |
 1234|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1235|  7.05k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1236|       |
 1237|  7.05k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1238|  7.05k|                    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|  7.05k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1242|  7.05k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1243|       |
 1244|  7.05k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1245|  7.05k|                    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|  7.05k|                    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|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1260|  7.05k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1261|       |
 1262|  7.05k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1263|  7.05k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1264|       |
 1265|  7.05k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1266|  7.05k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1267|       |
 1268|       |
 1269|  7.05k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1270|  7.05k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1271|  7.05k|                }
 1272|  7.05k|            }
 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|  7.05k|            {
 1278|  7.05k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1279|  7.05k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1280|  7.05k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1281|  7.05k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1282|       |
 1283|  7.05k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1284|  7.05k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1285|  7.05k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1286|  7.05k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1287|       |
 1288|  7.05k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1289|  7.05k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1290|  7.05k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1291|  7.05k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1292|       |
 1293|  7.05k|                m_temp_reg_54 = _mm_setzero_si128();
 1294|  7.05k|                m_temp_reg_55 = _mm_setzero_si128();
 1295|  7.05k|                m_temp_reg_56 = _mm_setzero_si128();
 1296|  7.05k|                m_temp_reg_57 = _mm_setzero_si128();
 1297|  7.05k|            }
 1298|  7.05k|        }
 1299|       |
 1300|       |        /* Stage 2 */
 1301|  41.1k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  41.1k|#define IT_SHIFT_STAGE_2 12
  ------------------
 1302|  41.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|  41.1k|            {
 1306|  41.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 1307|  41.1k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 1308|       |
 1309|  41.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 1310|  41.1k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 1311|       |
 1312|  41.1k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1313|  41.1k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1314|  41.1k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1315|  41.1k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1316|       |
 1317|       |
 1318|  41.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 1319|  41.1k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 1320|  41.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|  41.1k|            {
 1326|       |
 1327|  41.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 1328|  41.1k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 1329|       |
 1330|       |
 1331|  41.1k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1332|  41.1k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1333|  41.1k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1334|  41.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|  41.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1338|       |
 1339|       |
 1340|  41.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 1341|  41.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|  41.1k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1352|  41.1k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1353|       |
 1354|  41.1k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1355|  41.1k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1356|       |
 1357|  41.1k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1358|  41.1k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1359|       |
 1360|  41.1k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1361|  41.1k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1362|       |
 1363|  41.1k|            }
 1364|       |
 1365|       |            /* o */
 1366|  41.1k|            {
 1367|       |
 1368|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1369|  41.1k|                {
 1370|       |                    //o0:1B*89+3B*75,1T*89+3T*75
 1371|  41.1k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1372|  41.1k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1373|       |
 1374|  41.1k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1375|  41.1k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1376|       |                    /* Loading coeff for computing o1 in the next block */
 1377|  41.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|  41.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1387|  41.1k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1388|       |
 1389|  41.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1390|  41.1k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1391|       |
 1392|  41.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1393|  41.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1394|  41.1k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1395|  41.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|  41.1k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1399|  41.1k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1400|       |
 1401|  41.1k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1402|  41.1k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1403|  41.1k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1404|  41.1k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1405|       |
 1406|  41.1k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1407|  41.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|  41.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|  41.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1424|  41.1k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1425|       |
 1426|  41.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1427|  41.1k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1428|       |
 1429|  41.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1430|  41.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1431|  41.1k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1432|  41.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|  41.1k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1436|  41.1k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1437|       |
 1438|  41.1k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1439|  41.1k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1440|  41.1k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1441|  41.1k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1442|       |
 1443|  41.1k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1444|  41.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|  41.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|  41.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1460|  41.1k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1461|       |
 1462|  41.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 1463|  41.1k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 1464|       |
 1465|  41.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1466|  41.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1467|  41.1k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1468|  41.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|  41.1k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1472|  41.1k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1473|       |
 1474|  41.1k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1475|  41.1k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1476|  41.1k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1477|  41.1k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1478|       |
 1479|       |
 1480|  41.1k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1481|  41.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|  41.1k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1494|  41.1k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1495|       |
 1496|  41.1k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 1497|  41.1k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 1498|       |
 1499|  41.1k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 1500|  41.1k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 1501|  41.1k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 1502|  41.1k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 1503|       |
 1504|  41.1k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 1505|  41.1k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 1506|  41.1k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 1507|  41.1k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 1508|       |
 1509|  41.1k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 1510|  41.1k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 1511|  41.1k|                }
 1512|  41.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|  41.1k|            {
 1518|  41.1k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1519|  41.1k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1520|  41.1k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1521|  41.1k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1522|  41.1k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1523|  41.1k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1524|  41.1k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1525|  41.1k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1526|       |
 1527|  41.1k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1528|  41.1k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1529|  41.1k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1530|  41.1k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1531|  41.1k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1532|  41.1k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1533|  41.1k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1534|  41.1k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1535|  41.1k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1536|  41.1k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1537|  41.1k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1538|  41.1k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1539|       |
 1540|  41.1k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1541|  41.1k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1542|  41.1k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1543|  41.1k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1544|  41.1k|            }
 1545|       |
 1546|       |            /* Recon and store */
 1547|  41.1k|            {
 1548|  41.1k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1549|  41.1k|                pu1_pred += pred_strd;
 1550|  41.1k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1551|  41.1k|                pu1_pred += pred_strd;
 1552|  41.1k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1553|  41.1k|                pu1_pred += pred_strd;
 1554|  41.1k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1555|  41.1k|                pu1_pred += pred_strd;
 1556|  41.1k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1557|  41.1k|                pu1_pred += pred_strd;
 1558|  41.1k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1559|  41.1k|                pu1_pred += pred_strd;
 1560|  41.1k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1561|  41.1k|                pu1_pred += pred_strd;
 1562|  41.1k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1563|       |
 1564|  41.1k|                m_temp_reg_50 = _mm_setzero_si128();
 1565|  41.1k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 1566|  41.1k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 1567|  41.1k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 1568|  41.1k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 1569|  41.1k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 1570|  41.1k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 1571|  41.1k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 1572|  41.1k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 1573|       |
 1574|  41.1k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 1575|  41.1k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 1576|  41.1k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 1577|  41.1k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 1578|  41.1k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 1579|  41.1k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 1580|  41.1k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 1581|  41.1k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 1582|       |
 1583|  41.1k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 1584|  41.1k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 1585|  41.1k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 1586|  41.1k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 1587|  41.1k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 1588|  41.1k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 1589|  41.1k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 1590|  41.1k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 1591|       |
 1592|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 1593|  41.1k|                pu1_dst += dst_strd;
 1594|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 1595|  41.1k|                pu1_dst += dst_strd;
 1596|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 1597|  41.1k|                pu1_dst += dst_strd;
 1598|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 1599|  41.1k|                pu1_dst += dst_strd;
 1600|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 1601|  41.1k|                pu1_dst += dst_strd;
 1602|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 1603|  41.1k|                pu1_dst += dst_strd;
 1604|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 1605|  41.1k|                pu1_dst += dst_strd;
 1606|  41.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 1607|  41.1k|                pu1_dst += dst_strd;
 1608|  41.1k|            }
 1609|  41.1k|        }
 1610|  41.1k|    }
 1611|  25.0k|    else
 1612|       |
 1613|  25.0k|    {
 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|  25.0k|        if(!check_row_stage_1)
  ------------------
  |  Branch (1617:12): [True: 9.69k, False: 15.3k]
  ------------------
 1618|  9.69k|        {
 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|  9.69k|            {
 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|  9.69k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1625|  9.69k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1626|       |
 1627|  9.69k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1628|  9.69k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 1629|       |
 1630|  9.69k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1631|  9.69k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1632|       |
 1633|       |
 1634|  9.69k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1635|  9.69k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1636|  9.69k|            }
 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|  9.69k|            {
 1642|       |
 1643|  9.69k|                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|  9.69k|                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|  9.69k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1649|  9.69k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 1650|       |
 1651|  9.69k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1652|  9.69k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1653|       |
 1654|  9.69k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 1655|  9.69k|                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|  9.69k|                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|  9.69k|                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|  9.69k|            }
 1668|       |
 1669|       |            /* e */
 1670|  9.69k|            {
 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|  9.69k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1676|  9.69k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1677|       |
 1678|  9.69k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1679|  9.69k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1680|       |
 1681|  9.69k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1682|  9.69k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1683|       |
 1684|  9.69k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1685|  9.69k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1686|       |
 1687|  9.69k|            }
 1688|       |
 1689|       |            /* o */
 1690|  9.69k|            {
 1691|       |
 1692|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1693|  9.69k|                {
 1694|       |
 1695|  9.69k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1696|  9.69k|                    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|  9.69k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1699|  9.69k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1700|       |
 1701|  9.69k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1702|  9.69k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1703|       |
 1704|  9.69k|                }
 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|  9.69k|                {
 1711|       |
 1712|       |
 1713|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1714|  9.69k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1715|       |
 1716|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1717|  9.69k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1718|       |
 1719|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1720|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1721|  9.69k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1722|  9.69k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1723|       |
 1724|  9.69k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1725|  9.69k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1726|  9.69k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1727|  9.69k|                    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|  9.69k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1731|  9.69k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 1732|       |
 1733|  9.69k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1734|  9.69k|                    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|  9.69k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1739|       |
 1740|  9.69k|                }
 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|  9.69k|                {
 1747|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1748|  9.69k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1749|       |
 1750|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1751|  9.69k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1752|       |
 1753|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1754|  9.69k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1755|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1756|  9.69k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1757|       |
 1758|  9.69k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1759|  9.69k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1760|  9.69k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1761|  9.69k|                    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|  9.69k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1765|  9.69k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1766|       |
 1767|  9.69k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1768|  9.69k|                    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|  9.69k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1777|       |
 1778|  9.69k|                }
 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|  9.69k|                {
 1785|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1786|  9.69k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1787|       |
 1788|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 1789|  9.69k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 1790|       |
 1791|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1792|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1793|  9.69k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1794|  9.69k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1795|       |
 1796|  9.69k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1797|  9.69k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1798|  9.69k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1799|  9.69k|                    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|  9.69k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1803|  9.69k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 1804|       |
 1805|  9.69k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1806|  9.69k|                    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|  9.69k|                }
 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|  9.69k|                {
 1820|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1821|  9.69k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1822|       |
 1823|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 1824|  9.69k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 1825|       |
 1826|  9.69k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1827|  9.69k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1828|  9.69k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1829|  9.69k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1830|       |
 1831|  9.69k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1832|  9.69k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1833|  9.69k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1834|  9.69k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1835|       |
 1836|  9.69k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1837|  9.69k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 1838|  9.69k|                }
 1839|  9.69k|            }
 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|  9.69k|            {
 1845|       |
 1846|       |
 1847|  9.69k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1848|  9.69k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1849|  9.69k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1850|  9.69k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1851|  9.69k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1852|  9.69k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1853|  9.69k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1854|  9.69k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1855|       |
 1856|  9.69k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1857|  9.69k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1858|  9.69k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1859|  9.69k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1860|  9.69k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1861|  9.69k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1862|  9.69k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1863|  9.69k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1864|       |
 1865|  9.69k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1866|  9.69k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1867|  9.69k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1868|  9.69k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1869|       |
 1870|  9.69k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1871|  9.69k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1872|  9.69k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1873|  9.69k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1874|  9.69k|            }
 1875|  9.69k|        }
 1876|  15.3k|        else
 1877|  15.3k|        {
 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|  15.3k|            {
 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|  15.3k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1885|  15.3k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1886|       |
 1887|  15.3k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1888|  15.3k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 1889|       |
 1890|  15.3k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1891|  15.3k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1892|       |
 1893|       |
 1894|  15.3k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1895|  15.3k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1896|  15.3k|            }
 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|  15.3k|            {
 1902|       |
 1903|  15.3k|                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|  15.3k|                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|  15.3k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1909|  15.3k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 1910|       |
 1911|  15.3k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1912|  15.3k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1913|       |
 1914|  15.3k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 1915|  15.3k|                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|  15.3k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1922|  15.3k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1923|       |
 1924|  15.3k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1925|  15.3k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 1926|       |
 1927|  15.3k|            }
 1928|       |
 1929|       |            /* e */
 1930|  15.3k|            {
 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|  15.3k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1936|  15.3k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1937|       |
 1938|  15.3k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1939|  15.3k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1940|       |
 1941|  15.3k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1942|  15.3k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1943|       |
 1944|  15.3k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1945|  15.3k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1946|       |
 1947|  15.3k|            }
 1948|       |
 1949|       |            /* o */
 1950|  15.3k|            {
 1951|       |
 1952|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1953|  15.3k|                {
 1954|       |
 1955|  15.3k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1956|  15.3k|                    m_temp_reg_61 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 1957|  15.3k|                    m_temp_reg_64 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1958|  15.3k|                    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|  15.3k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1961|  15.3k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1962|  15.3k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1963|  15.3k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 1964|       |
 1965|       |
 1966|  15.3k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1967|  15.3k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1968|       |
 1969|  15.3k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1970|  15.3k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 1971|  15.3k|                }
 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|  15.3k|                {
 1978|       |
 1979|       |
 1980|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1981|  15.3k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1982|       |
 1983|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1984|  15.3k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1985|       |
 1986|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1987|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1988|  15.3k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1989|  15.3k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1990|       |
 1991|  15.3k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1992|  15.3k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1993|  15.3k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1994|  15.3k|                    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|  15.3k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1998|  15.3k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1999|  15.3k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2000|  15.3k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2001|       |
 2002|  15.3k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2003|  15.3k|                    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|  15.3k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2008|  15.3k|                    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|  15.3k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2012|  15.3k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2013|  15.3k|                }
 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|  15.3k|                {
 2020|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2021|  15.3k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2022|       |
 2023|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2024|  15.3k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2025|       |
 2026|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2027|  15.3k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2028|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2029|  15.3k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2030|       |
 2031|  15.3k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2032|  15.3k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2033|  15.3k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2034|  15.3k|                    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|  15.3k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 2038|  15.3k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 2039|  15.3k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 2040|  15.3k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 2041|       |
 2042|  15.3k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2043|  15.3k|                    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|  15.3k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2052|  15.3k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2053|       |
 2054|  15.3k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2055|  15.3k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2056|  15.3k|                }
 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|  15.3k|                {
 2063|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2064|  15.3k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2065|       |
 2066|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2067|  15.3k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2068|       |
 2069|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2070|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2071|  15.3k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2072|  15.3k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2073|       |
 2074|  15.3k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2075|  15.3k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2076|  15.3k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2077|  15.3k|                    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|  15.3k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2081|  15.3k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 2082|  15.3k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2083|  15.3k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2084|       |
 2085|  15.3k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2086|  15.3k|                    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|  15.3k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2094|  15.3k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2095|  15.3k|                }
 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|  15.3k|                {
 2102|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2103|  15.3k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2104|       |
 2105|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2106|  15.3k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2107|       |
 2108|  15.3k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2109|  15.3k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2110|  15.3k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2111|  15.3k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2112|       |
 2113|  15.3k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2114|  15.3k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2115|  15.3k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2116|  15.3k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2117|       |
 2118|  15.3k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2119|  15.3k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2120|  15.3k|                }
 2121|  15.3k|            }
 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|  15.3k|            {
 2127|       |
 2128|       |
 2129|  15.3k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2130|  15.3k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2131|  15.3k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2132|  15.3k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2133|  15.3k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2134|  15.3k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2135|  15.3k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2136|  15.3k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2137|       |
 2138|  15.3k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2139|  15.3k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2140|  15.3k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2141|  15.3k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2142|  15.3k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2143|  15.3k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2144|  15.3k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2145|  15.3k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2146|       |
 2147|  15.3k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2148|  15.3k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2149|  15.3k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2150|  15.3k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2151|       |
 2152|  15.3k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2153|  15.3k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2154|  15.3k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2155|  15.3k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2156|  15.3k|            }
 2157|  15.3k|        }
 2158|       |        /* Stage 2 */
 2159|       |
 2160|  25.0k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  25.0k|#define IT_SHIFT_STAGE_2 12
  ------------------
 2161|       |
 2162|  25.0k|        {
 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|  25.0k|            {
 2167|  25.0k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 2168|  25.0k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 2169|       |
 2170|  25.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 2171|  25.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 2172|       |
 2173|  25.0k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2174|  25.0k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2175|  25.0k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2176|  25.0k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2177|       |
 2178|       |
 2179|  25.0k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 2180|  25.0k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 2181|  25.0k|            }
 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|  25.0k|            {
 2187|  25.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 2188|  25.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 2189|       |
 2190|       |
 2191|  25.0k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2192|  25.0k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2193|  25.0k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2194|  25.0k|                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|  25.0k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 2198|  25.0k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 2199|       |
 2200|       |
 2201|  25.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 2202|  25.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_51, m_temp_reg_53);
 2203|  25.0k|            }
 2204|       |
 2205|       |            /* e */
 2206|  25.0k|            {
 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|  25.0k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 2212|  25.0k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 2213|       |
 2214|  25.0k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 2215|  25.0k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 2216|       |
 2217|  25.0k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 2218|  25.0k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 2219|       |
 2220|  25.0k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 2221|  25.0k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 2222|       |
 2223|  25.0k|            }
 2224|       |
 2225|       |            /* o */
 2226|  25.0k|            {
 2227|  25.0k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_55, m_temp_reg_57);
 2228|  25.0k|                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|  25.0k|                {
 2232|       |                    //o0:1B*89+3B*75,1T*89+3T*75,5B*50+7B*18,5T*50+7T*18
 2233|  25.0k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2234|  25.0k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2235|  25.0k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2236|  25.0k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2237|       |
 2238|  25.0k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2239|  25.0k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 2240|       |                    /* Loading coeff for computing o1 in the next block */
 2241|  25.0k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 2242|  25.0k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 2243|       |
 2244|  25.0k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2245|  25.0k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2246|  25.0k|                }
 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|  25.0k|                {
 2253|  25.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 2254|  25.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 2255|       |
 2256|  25.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2257|  25.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2258|       |
 2259|  25.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2260|  25.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2261|  25.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2262|  25.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2263|       |
 2264|  25.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2265|  25.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2266|  25.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2267|  25.0k|                    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|  25.0k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2271|  25.0k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2272|  25.0k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2273|  25.0k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2274|       |
 2275|  25.0k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2276|  25.0k|                    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|  25.0k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2284|  25.0k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 2285|       |
 2286|  25.0k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2287|  25.0k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2288|  25.0k|                }
 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|  25.0k|                {
 2295|  25.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2296|  25.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2297|       |
 2298|  25.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2299|  25.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2300|       |
 2301|  25.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2302|  25.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2303|  25.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2304|  25.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2305|       |
 2306|  25.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2307|  25.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2308|  25.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2309|  25.0k|                    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|  25.0k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2313|  25.0k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2314|  25.0k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2315|  25.0k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2316|       |
 2317|  25.0k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2318|  25.0k|                    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|  25.0k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2326|  25.0k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2327|       |
 2328|  25.0k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2329|  25.0k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2330|  25.0k|                }
 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|  25.0k|                {
 2337|  25.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2338|  25.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2339|       |
 2340|  25.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2341|  25.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2342|       |
 2343|  25.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2344|  25.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2345|  25.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2346|  25.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2347|       |
 2348|  25.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2349|  25.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2350|  25.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2351|  25.0k|                    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|  25.0k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2355|  25.0k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2356|  25.0k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2357|  25.0k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2358|       |
 2359|  25.0k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2360|  25.0k|                    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|  25.0k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2368|  25.0k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2369|  25.0k|                }
 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|  25.0k|                {
 2376|  25.0k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2377|  25.0k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2378|       |
 2379|  25.0k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2380|  25.0k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2381|       |
 2382|  25.0k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 2383|  25.0k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 2384|  25.0k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 2385|  25.0k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 2386|       |
 2387|  25.0k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 2388|  25.0k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 2389|  25.0k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 2390|  25.0k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 2391|       |
 2392|  25.0k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 2393|  25.0k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 2394|  25.0k|                }
 2395|  25.0k|            }
 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|  25.0k|            {
 2401|  25.0k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2402|  25.0k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2403|  25.0k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2404|  25.0k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2405|  25.0k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2406|  25.0k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2407|  25.0k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2408|  25.0k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2409|       |
 2410|  25.0k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2411|  25.0k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2412|  25.0k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2413|  25.0k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2414|  25.0k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2415|  25.0k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2416|  25.0k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2417|  25.0k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2418|  25.0k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2419|  25.0k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2420|  25.0k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2421|  25.0k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2422|       |
 2423|  25.0k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2424|  25.0k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2425|  25.0k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2426|  25.0k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2427|  25.0k|            }
 2428|       |
 2429|       |            /* Recon and store */
 2430|  25.0k|            {
 2431|  25.0k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2432|  25.0k|                pu1_pred += pred_strd;
 2433|  25.0k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2434|  25.0k|                pu1_pred += pred_strd;
 2435|  25.0k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2436|  25.0k|                pu1_pred += pred_strd;
 2437|  25.0k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2438|  25.0k|                pu1_pred += pred_strd;
 2439|  25.0k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2440|  25.0k|                pu1_pred += pred_strd;
 2441|  25.0k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2442|  25.0k|                pu1_pred += pred_strd;
 2443|  25.0k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2444|  25.0k|                pu1_pred += pred_strd;
 2445|  25.0k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2446|       |
 2447|       |
 2448|  25.0k|                m_temp_reg_50 = _mm_setzero_si128();
 2449|  25.0k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 2450|  25.0k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 2451|  25.0k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 2452|  25.0k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 2453|  25.0k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 2454|  25.0k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 2455|  25.0k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 2456|  25.0k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 2457|       |
 2458|  25.0k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 2459|  25.0k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 2460|  25.0k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 2461|  25.0k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 2462|  25.0k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 2463|  25.0k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 2464|  25.0k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 2465|  25.0k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 2466|       |
 2467|  25.0k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 2468|  25.0k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 2469|  25.0k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 2470|  25.0k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 2471|  25.0k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 2472|  25.0k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 2473|  25.0k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 2474|  25.0k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 2475|       |
 2476|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 2477|  25.0k|                pu1_dst += dst_strd;
 2478|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 2479|  25.0k|                pu1_dst += dst_strd;
 2480|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 2481|  25.0k|                pu1_dst += dst_strd;
 2482|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 2483|  25.0k|                pu1_dst += dst_strd;
 2484|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 2485|  25.0k|                pu1_dst += dst_strd;
 2486|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 2487|  25.0k|                pu1_dst += dst_strd;
 2488|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 2489|  25.0k|                pu1_dst += dst_strd;
 2490|  25.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 2491|  25.0k|                pu1_dst += dst_strd;
 2492|       |
 2493|  25.0k|            }
 2494|       |
 2495|       |
 2496|  25.0k|        }
 2497|       |
 2498|       |
 2499|  25.0k|    }
 2500|  66.1k|}

ihevc_itrans_recon_4x4_ttype1_ssse3:
  120|   457k|{
  121|   457k|    __m128i m_temp_reg_0;
  122|   457k|    __m128i m_temp_reg_1;
  123|   457k|    __m128i m_temp_reg_2;
  124|   457k|    __m128i m_temp_reg_3;
  125|   457k|    __m128i m_temp_reg_4;
  126|   457k|    __m128i m_temp_reg_10;
  127|   457k|    __m128i m_temp_reg_11;
  128|   457k|    __m128i m_temp_reg_12;
  129|   457k|    __m128i m_temp_reg_13;
  130|   457k|    __m128i m_temp_reg_14;
  131|   457k|    __m128i m_temp_reg_20;
  132|   457k|    __m128i m_temp_reg_21;
  133|   457k|    __m128i m_temp_reg_22;
  134|   457k|    __m128i m_temp_reg_23;
  135|   457k|    __m128i m_temp_reg_24;
  136|   457k|    __m128i m_temp_reg_25;
  137|   457k|    __m128i m_temp_reg_30;
  138|   457k|    __m128i m_temp_reg_31;
  139|   457k|    __m128i m_temp_reg_32;
  140|   457k|    __m128i m_temp_reg_33;
  141|   457k|    __m128i m_temp_reg_34;
  142|   457k|    __m128i m_temp_reg_35;
  143|   457k|    __m128i m_temp_reg_36;
  144|   457k|    __m128i m_rdng_factor;
  145|   457k|    __m128i m_count;
  146|       |
  147|   457k|    __m128i m_ge_zero16b_flag_row0;
  148|   457k|    __m128i m_ge_zero16b_flag_row1;
  149|   457k|    __m128i m_ge_zero16b_flag_row2;
  150|   457k|    __m128i m_ge_zero16b_flag_row3;
  151|       |
  152|   457k|    __m128i m_zero = _mm_setzero_si128();
  153|       |
  154|   457k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   457k|#define IT_SHIFT_STAGE_1 7
  ------------------
  155|   457k|    UNUSED(zero_cols);
  ------------------
  |  |   38|   457k|#define UNUSED(x) ((void)(x))
  ------------------
  156|   457k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   457k|#define UNUSED(x) ((void)(x))
  ------------------
  157|   457k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|   457k|#define UNUSED(x) ((void)(x))
  ------------------
  158|   457k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  159|   457k|    pi2_src += src_strd;
  160|   457k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  161|   457k|    pi2_src += src_strd;
  162|   457k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  163|   457k|    pi2_src += src_strd;
  164|   457k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  165|       |
  166|   457k|    m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_0);
  167|   457k|    m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_1);
  168|   457k|    m_ge_zero16b_flag_row2 = _mm_cmpgt_epi16(m_zero, m_temp_reg_2);
  169|   457k|    m_ge_zero16b_flag_row3 = _mm_cmpgt_epi16(m_zero, m_temp_reg_3);
  170|       |
  171|   457k|    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_0, m_ge_zero16b_flag_row0);
  172|   457k|    m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_1, m_ge_zero16b_flag_row1);
  173|   457k|    m_temp_reg_2 = _mm_unpacklo_epi16(m_temp_reg_2, m_ge_zero16b_flag_row2);
  174|   457k|    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|   457k|    {
  185|   457k|        m_temp_reg_14 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_2);
  186|   457k|    }
  187|       |
  188|       |    /* c[3] in m_temp_reg_13 */
  189|   457k|    {
  190|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_1, 6);
  191|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_1, 3);
  192|   457k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_1, 1);
  193|   457k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  194|   457k|        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|   457k|    }
  197|       |
  198|       |    /* c[0] in m_temp_reg_10 */
  199|   457k|    {
  200|   457k|        m_temp_reg_10 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_2);
  201|   457k|    }
  202|       |
  203|       |    /* c[1] in m_temp_reg_11 */
  204|   457k|    {
  205|   457k|        m_temp_reg_11 = _mm_add_epi32(m_temp_reg_2, m_temp_reg_3);
  206|   457k|    }
  207|       |
  208|       |    /* c[2] in m_temp_reg_12 */
  209|   457k|    {
  210|   457k|        m_temp_reg_12 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_3);
  211|   457k|    }
  212|       |
  213|       |    /* c[4] in m_temp_reg_14 */
  214|       |    /* c[4] = src[0] - src[2] + src[3] */
  215|   457k|    {
  216|   457k|        m_temp_reg_14 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_3);
  217|   457k|    }
  218|       |
  219|       |    /* Stage 1 outputs stored in m_temp_reg_20-23 */
  220|   457k|    {
  221|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_10, 5);
  222|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_10, 1);
  223|   457k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_10);
  224|   457k|        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|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_11, 6);
  228|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_11, 3);
  229|   457k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_11);
  230|   457k|        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|   457k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  234|       |
  235|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_11, 5);
  236|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_11, 1);
  237|   457k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_11);
  238|   457k|        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|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_12, 6);
  242|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_12, 3);
  243|   457k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_12);
  244|   457k|        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|   457k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  248|       |
  249|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_10, 6);
  250|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_10, 3);
  251|   457k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_10);
  252|   457k|        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|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_12, 5);
  256|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_12, 1);
  257|   457k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_12);
  258|   457k|        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|   457k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_14, 6);
  262|   457k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_14, 3);
  263|   457k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_14, 1);
  264|   457k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  265|   457k|        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|   457k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  269|   457k|        m_count = _mm_cvtsi32_si128(i4_shift);
  270|       |
  271|   457k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  272|   457k|        m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_13);
  273|   457k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  274|       |
  275|   457k|        m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  276|   457k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  277|       |
  278|   457k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  279|   457k|        m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_13);
  280|   457k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  281|       |
  282|   457k|        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  283|       |
  284|   457k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  285|   457k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  286|   457k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  287|   457k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  288|       |
  289|   457k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  290|   457k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  291|   457k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  292|   457k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  293|       |
  294|   457k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  295|   457k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  296|       |
  297|   457k|        m_temp_reg_30 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  298|   457k|        m_temp_reg_31 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  299|       |
  300|   457k|    }
  301|       |
  302|       |    /* Stage 2 */
  303|   457k|    {
  304|   457k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   457k|#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|   457k|        m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_30);
  314|   457k|        m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_31);
  315|       |
  316|   457k|        m_temp_reg_20 = _mm_unpacklo_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  317|   457k|        m_temp_reg_21 = _mm_unpacklo_epi16(m_temp_reg_31, m_ge_zero16b_flag_row1);
  318|   457k|        m_temp_reg_22 = _mm_unpackhi_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  319|   457k|        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|   457k|        {
  324|   457k|            m_temp_reg_4 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
  325|   457k|        }
  326|       |
  327|       |        /* c[3] stored in m_temp_reg_3 */
  328|   457k|        {
  329|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_22, 6);
  330|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_22, 3);
  331|   457k|            m_temp_reg_12 = _mm_slli_epi32(m_temp_reg_22, 1);
  332|   457k|            m_temp_reg_13 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  333|   457k|            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|   457k|        }
  336|       |
  337|       |        /* c[0] stored in m_temp_reg_0 */
  338|   457k|        {
  339|   457k|            m_temp_reg_0 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  340|   457k|        }
  341|       |
  342|       |        /* c[1] stored in m_temp_reg_1 */
  343|   457k|        {
  344|   457k|            m_temp_reg_1 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_21);
  345|   457k|        }
  346|       |
  347|       |        /* c[2] stored in m_temp_reg_2 */
  348|   457k|        {
  349|   457k|            m_temp_reg_2 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_23);
  350|   457k|        }
  351|       |
  352|       |        /* c[4] stored in m_temp_reg_4 */
  353|   457k|        {
  354|   457k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_4, m_temp_reg_23);
  355|   457k|        }
  356|       |
  357|       |        /* Stage 2 output generation */
  358|   457k|        {
  359|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 5);
  360|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_0, 1);
  361|   457k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_0);
  362|   457k|            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|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_1, 6);
  366|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_1, 3);
  367|   457k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_1);
  368|   457k|            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|   457k|            m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  372|       |
  373|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_1, 5);
  374|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_1, 1);
  375|   457k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_1);
  376|   457k|            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|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_2, 6);
  380|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 3);
  381|   457k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_2);
  382|   457k|            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|   457k|            m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  386|       |
  387|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 6);
  388|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_0, 3);
  389|   457k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_0);
  390|   457k|            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|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_2, 5);
  394|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 1);
  395|   457k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_2);
  396|   457k|            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|   457k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_4, 6);
  400|   457k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_4, 3);
  401|   457k|            m_temp_reg_12 = _mm_slli_epi32(m_temp_reg_4, 1);
  402|   457k|            m_temp_reg_13 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  403|   457k|            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|   457k|            m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  407|   457k|            m_count = _mm_cvtsi32_si128(i4_shift);
  408|       |
  409|   457k|            m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_3);
  410|   457k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  411|   457k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  412|       |
  413|   457k|            m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  414|   457k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  415|       |
  416|   457k|            m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_3);
  417|   457k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  418|   457k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  419|       |
  420|   457k|            m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  421|       |
  422|   457k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  423|   457k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  424|   457k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  425|   457k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  426|       |
  427|   457k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  428|   457k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  429|   457k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  430|   457k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  431|       |
  432|   457k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  433|   457k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  434|       |
  435|   457k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  436|   457k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  437|   457k|        }
  438|       |
  439|       |        /* Recon and store */
  440|   457k|        {
  441|   457k|            WORD32 *pi4_dst = (WORD32 *)pu1_dst;
  442|       |
  443|   457k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  444|   457k|            pu1_pred += pred_strd;
  445|   457k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  446|   457k|            pu1_pred += pred_strd;
  447|   457k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  448|   457k|            pu1_pred += pred_strd;
  449|   457k|            m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
  450|       |
  451|   457k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_zero);
  452|   457k|            m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_zero);
  453|   457k|            m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_zero);
  454|   457k|            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|   457k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  462|   457k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  463|       |
  464|   457k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  465|   457k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  466|       |
  467|   457k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  468|       |
  469|   457k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  470|   457k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  471|   457k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  472|   457k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  473|   457k|            pu1_dst += dst_strd;
  474|   457k|            pi4_dst = (WORD32 *)(pu1_dst);
  475|       |
  476|   457k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  477|   457k|            pu1_dst += dst_strd;
  478|   457k|            pi4_dst = (WORD32 *)(pu1_dst);
  479|       |
  480|   457k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  481|   457k|            pu1_dst += dst_strd;
  482|   457k|            pi4_dst = (WORD32 *)(pu1_dst);
  483|       |
  484|   457k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  485|   457k|        }
  486|   457k|    }
  487|   457k|}
ihevc_itrans_recon_4x4_ssse3:
  552|  28.6k|{
  553|  28.6k|    __m128i m_temp_reg_0;
  554|  28.6k|    __m128i m_temp_reg_1;
  555|  28.6k|    __m128i m_temp_reg_2;
  556|  28.6k|    __m128i m_temp_reg_3;
  557|  28.6k|    __m128i m_temp_reg_4;
  558|  28.6k|    __m128i m_temp_reg_10;
  559|  28.6k|    __m128i m_temp_reg_11;
  560|  28.6k|    __m128i m_temp_reg_12;
  561|  28.6k|    __m128i m_temp_reg_13;
  562|  28.6k|    __m128i m_temp_reg_14;
  563|  28.6k|    __m128i m_temp_reg_15;
  564|  28.6k|    __m128i m_temp_reg_20;
  565|  28.6k|    __m128i m_temp_reg_21;
  566|  28.6k|    __m128i m_temp_reg_22;
  567|  28.6k|    __m128i m_temp_reg_23;
  568|  28.6k|    __m128i m_temp_reg_24;
  569|  28.6k|    __m128i m_temp_reg_25;
  570|  28.6k|    __m128i m_temp_reg_30;
  571|  28.6k|    __m128i m_temp_reg_31;
  572|  28.6k|    __m128i m_temp_reg_33;
  573|  28.6k|    __m128i m_temp_reg_34;
  574|  28.6k|    __m128i m_rdng_factor;
  575|  28.6k|    __m128i m_count;
  576|       |
  577|  28.6k|    __m128i m_ge_zero16b_flag_row0;
  578|  28.6k|    __m128i m_ge_zero16b_flag_row1;
  579|  28.6k|    __m128i m_ge_zero16b_flag_row2;
  580|  28.6k|    __m128i m_ge_zero16b_flag_row3;
  581|       |
  582|  28.6k|    __m128i m_zero = _mm_setzero_si128();
  583|       |
  584|  28.6k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  28.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  585|  28.6k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  28.6k|#define UNUSED(x) ((void)(x))
  ------------------
  586|  28.6k|    UNUSED(zero_cols);
  ------------------
  |  |   38|  28.6k|#define UNUSED(x) ((void)(x))
  ------------------
  587|  28.6k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|  28.6k|#define UNUSED(x) ((void)(x))
  ------------------
  588|       |
  589|  28.6k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  590|  28.6k|    pi2_src += src_strd;
  591|  28.6k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  592|  28.6k|    pi2_src += src_strd;
  593|  28.6k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  594|  28.6k|    pi2_src += src_strd;
  595|  28.6k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  596|       |
  597|  28.6k|    m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_0);
  598|  28.6k|    m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_1);
  599|  28.6k|    m_ge_zero16b_flag_row2 = _mm_cmpgt_epi16(m_zero, m_temp_reg_2);
  600|  28.6k|    m_ge_zero16b_flag_row3 = _mm_cmpgt_epi16(m_zero, m_temp_reg_3);
  601|       |
  602|  28.6k|    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_0, m_ge_zero16b_flag_row0);
  603|  28.6k|    m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_1, m_ge_zero16b_flag_row1);
  604|  28.6k|    m_temp_reg_2 = _mm_unpacklo_epi16(m_temp_reg_2, m_ge_zero16b_flag_row2);
  605|  28.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|  28.6k|    {
  615|  28.6k|        m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 6);
  616|  28.6k|        m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 6);
  617|  28.6k|    }
  618|       |
  619|       |    /* o */
  620|  28.6k|    {
  621|  28.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_1, 5);
  622|  28.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_1, 2);
  623|  28.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|  28.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_3, 6);
  627|  28.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_3, 4);
  628|  28.6k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_3, 1);
  629|  28.6k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_3);
  630|  28.6k|        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_22);
  631|  28.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|  28.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_1, 6);
  635|  28.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_1, 4);
  636|  28.6k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_1, 1);
  637|  28.6k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_1);
  638|  28.6k|        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_22);
  639|  28.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|  28.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_3, 5);
  643|  28.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_3, 2);
  644|  28.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|  28.6k|    }
  647|       |
  648|  28.6k|    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  649|       |
  650|       |    /* e1 stored in m_temp_reg_31 */
  651|  28.6k|    {
  652|  28.6k|        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  653|  28.6k|    }
  654|       |
  655|  28.6k|    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  656|       |
  657|       |    /* e0 stored in m_temp_reg_30 */
  658|  28.6k|    {
  659|  28.6k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  660|  28.6k|    }
  661|       |
  662|  28.6k|    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  663|  28.6k|    m_count = _mm_cvtsi32_si128(i4_shift);
  664|       |
  665|       |    /* o1 stored in m_temp_reg_33 */
  666|  28.6k|    {
  667|  28.6k|        m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  668|  28.6k|    }
  669|       |
  670|       |    /* e1 + add */
  671|  28.6k|    {
  672|  28.6k|        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  673|  28.6k|    }
  674|       |
  675|       |    /* e0 + add */
  676|  28.6k|    {
  677|  28.6k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  678|  28.6k|    }
  679|       |
  680|       |    /* o0 stored in m_temp_reg_34 */
  681|  28.6k|    {
  682|  28.6k|        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  683|  28.6k|    }
  684|       |
  685|       |    /* Stage 1 outputs */
  686|  28.6k|    {
  687|  28.6k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  688|  28.6k|        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  689|       |
  690|  28.6k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  691|  28.6k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  692|       |
  693|       |
  694|  28.6k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  695|  28.6k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  696|  28.6k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  697|  28.6k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  698|       |
  699|  28.6k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  700|  28.6k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  701|  28.6k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  702|  28.6k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  703|       |
  704|  28.6k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  705|  28.6k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  706|       |
  707|  28.6k|        m_temp_reg_30 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  708|  28.6k|        m_temp_reg_31 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  709|  28.6k|    }
  710|       |
  711|       |    /* Stage 2 */
  712|  28.6k|    {
  713|  28.6k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  28.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|  28.6k|        m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_30);
  719|  28.6k|        m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_31);
  720|       |
  721|  28.6k|        m_temp_reg_20 = _mm_unpacklo_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  722|  28.6k|        m_temp_reg_21 = _mm_unpacklo_epi16(m_temp_reg_31, m_ge_zero16b_flag_row1);
  723|  28.6k|        m_temp_reg_22 = _mm_unpackhi_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  724|  28.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|  28.6k|        {
  734|  28.6k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_20, 6);
  735|  28.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|  28.6k|        {
  745|  28.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_22, 5);
  746|  28.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_22, 2);
  747|  28.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|  28.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_23, 6);
  751|  28.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_23, 4);
  752|  28.6k|            m_temp_reg_2 = _mm_slli_epi32(m_temp_reg_23, 1);
  753|  28.6k|            m_temp_reg_3 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_23);
  754|  28.6k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_1, m_temp_reg_2);
  755|  28.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|  28.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_22, 6);
  759|  28.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_22, 4);
  760|  28.6k|            m_temp_reg_2 = _mm_slli_epi32(m_temp_reg_22, 1);
  761|  28.6k|            m_temp_reg_3 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_22);
  762|  28.6k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_1, m_temp_reg_2);
  763|  28.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|  28.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_23, 5);
  767|  28.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_23, 2);
  768|  28.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|  28.6k|        }
  771|       |
  772|       |        /* e */
  773|  28.6k|        {
  774|  28.6k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_21, 6);
  775|  28.6k|        }
  776|       |
  777|  28.6k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  778|       |
  779|       |        /* e1 stored in m_temp_reg_31 */
  780|  28.6k|        {
  781|  28.6k|            m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  782|  28.6k|        }
  783|       |
  784|  28.6k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  785|       |
  786|       |        /* e0 stored in m_temp_reg_30 */
  787|  28.6k|        {
  788|  28.6k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  789|  28.6k|        }
  790|       |
  791|  28.6k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  792|  28.6k|        m_count = _mm_cvtsi32_si128(i4_shift);
  793|       |
  794|       |        /* o1 stored in m_temp_reg_33 */
  795|  28.6k|        {
  796|  28.6k|            m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  797|  28.6k|        }
  798|       |
  799|       |        /* e1 + add */
  800|  28.6k|        {
  801|  28.6k|            m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  802|  28.6k|        }
  803|       |
  804|       |        /* e0 + add */
  805|  28.6k|        {
  806|  28.6k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  807|  28.6k|        }
  808|       |
  809|       |        /* o0 stored in m_temp_reg_34 */
  810|  28.6k|        {
  811|  28.6k|            m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  812|  28.6k|        }
  813|       |
  814|       |        /* Stage 2 outputs */
  815|  28.6k|        {
  816|  28.6k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  817|  28.6k|            m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  818|  28.6k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  819|  28.6k|            m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  820|       |
  821|  28.6k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  822|  28.6k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  823|  28.6k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  824|  28.6k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  825|       |
  826|  28.6k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  827|  28.6k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  828|  28.6k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  829|  28.6k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  830|       |
  831|  28.6k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  832|  28.6k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  833|       |
  834|  28.6k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  835|  28.6k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  836|  28.6k|        }
  837|       |
  838|       |        /* Recon and store */
  839|  28.6k|        {
  840|  28.6k|            UWORD32 *pu4_dst = (UWORD32 *)pu1_dst;
  841|       |
  842|  28.6k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  843|  28.6k|            pu1_pred += pred_strd;
  844|  28.6k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  845|  28.6k|            pu1_pred += pred_strd;
  846|  28.6k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  847|  28.6k|            pu1_pred += pred_strd;
  848|  28.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|  28.6k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_zero);
  857|  28.6k|            m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_zero);
  858|  28.6k|            m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_zero);
  859|  28.6k|            m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_zero);
  860|       |
  861|  28.6k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  862|  28.6k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  863|       |
  864|  28.6k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  865|  28.6k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  866|       |
  867|  28.6k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  868|       |
  869|  28.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  870|  28.6k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  871|  28.6k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  872|  28.6k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  873|  28.6k|            pu1_dst += dst_strd;
  874|  28.6k|            pu4_dst = (UWORD32 *)(pu1_dst);
  875|       |
  876|  28.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  877|  28.6k|            pu1_dst += dst_strd;
  878|  28.6k|            pu4_dst = (UWORD32 *)(pu1_dst);
  879|       |
  880|  28.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  881|  28.6k|            pu1_dst += dst_strd;
  882|  28.6k|            pu4_dst = (UWORD32 *)(pu1_dst);
  883|       |
  884|  28.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  885|  28.6k|        }
  886|  28.6k|    }
  887|  28.6k|}
ihevc_itrans_recon_8x8_ssse3:
  954|   118k|{
  955|   118k|    __m128i m_temp_reg_0;
  956|   118k|    __m128i m_temp_reg_1;
  957|   118k|    __m128i m_temp_reg_2;
  958|   118k|    __m128i m_temp_reg_3;
  959|   118k|    __m128i m_temp_reg_5;
  960|   118k|    __m128i m_temp_reg_6;
  961|   118k|    __m128i m_temp_reg_7;
  962|   118k|    __m128i m_temp_reg_4;
  963|   118k|    __m128i m_temp_reg_10;
  964|   118k|    __m128i m_temp_reg_11;
  965|   118k|    __m128i m_temp_reg_12;
  966|   118k|    __m128i m_temp_reg_13;
  967|   118k|    __m128i m_temp_reg_14;
  968|   118k|    __m128i m_temp_reg_15;
  969|   118k|    __m128i m_temp_reg_16;
  970|   118k|    __m128i m_temp_reg_17;
  971|   118k|    __m128i m_temp_reg_20;
  972|   118k|    __m128i m_temp_reg_21;
  973|   118k|    __m128i m_temp_reg_22;
  974|   118k|    __m128i m_temp_reg_23;
  975|   118k|    __m128i m_temp_reg_24;
  976|   118k|    __m128i m_temp_reg_25;
  977|   118k|    __m128i m_temp_reg_26;
  978|   118k|    __m128i m_temp_reg_27;
  979|   118k|    __m128i m_temp_reg_30;
  980|   118k|    __m128i m_temp_reg_31;
  981|   118k|    __m128i m_temp_reg_32;
  982|   118k|    __m128i m_temp_reg_33;
  983|   118k|    __m128i m_temp_reg_34;
  984|   118k|    __m128i m_temp_reg_35;
  985|   118k|    __m128i m_temp_reg_36;
  986|   118k|    __m128i m_temp_reg_37;
  987|   118k|    __m128i m_temp_reg_40;
  988|   118k|    __m128i m_temp_reg_41;
  989|   118k|    __m128i m_temp_reg_42;
  990|   118k|    __m128i m_temp_reg_43;
  991|   118k|    __m128i m_temp_reg_44;
  992|   118k|    __m128i m_temp_reg_45;
  993|   118k|    __m128i m_temp_reg_46;
  994|   118k|    __m128i m_temp_reg_47;
  995|   118k|    __m128i m_temp_reg_50;
  996|   118k|    __m128i m_temp_reg_51;
  997|   118k|    __m128i m_temp_reg_52;
  998|   118k|    __m128i m_temp_reg_53;
  999|   118k|    __m128i m_temp_reg_54;
 1000|   118k|    __m128i m_temp_reg_55;
 1001|   118k|    __m128i m_temp_reg_56;
 1002|   118k|    __m128i m_temp_reg_57;
 1003|   118k|    __m128i m_temp_reg_60;
 1004|   118k|    __m128i m_temp_reg_61;
 1005|   118k|    __m128i m_temp_reg_62;
 1006|   118k|    __m128i m_temp_reg_63;
 1007|   118k|    __m128i m_temp_reg_64;
 1008|   118k|    __m128i m_temp_reg_65;
 1009|   118k|    __m128i m_temp_reg_66;
 1010|   118k|    __m128i m_temp_reg_67;
 1011|   118k|    __m128i m_temp_reg_70;
 1012|   118k|    __m128i m_temp_reg_71;
 1013|   118k|    __m128i m_temp_reg_72;
 1014|   118k|    __m128i m_temp_reg_73;
 1015|   118k|    __m128i m_temp_reg_74;
 1016|   118k|    __m128i m_temp_reg_75;
 1017|   118k|    __m128i m_temp_reg_76;
 1018|   118k|    __m128i m_temp_reg_77;
 1019|   118k|    __m128i m_coeff1, m_coeff2, m_coeff3, m_coeff4;
 1020|       |
 1021|   118k|    WORD32 check_row_stage_1;   /* Lokesh */
 1022|   118k|    WORD32 check_row_stage_2;   /* Lokesh */
 1023|       |
 1024|   118k|    __m128i m_rdng_factor;
 1025|       |    //__m128i m_count;
 1026|   118k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   118k|#define IT_SHIFT_STAGE_1 7
  ------------------
 1027|   118k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   118k|#define UNUSED(x) ((void)(x))
  ------------------
 1028|   118k|    UNUSED(zero_cols);
  ------------------
  |  |   38|   118k|#define UNUSED(x) ((void)(x))
  ------------------
 1029|   118k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|   118k|#define UNUSED(x) ((void)(x))
  ------------------
 1030|       |
 1031|   118k|    check_row_stage_1   = ((zero_rows & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (1031:27): [True: 40.9k, False: 77.5k]
  ------------------
 1032|   118k|    check_row_stage_2   = ((zero_cols & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (1032:27): [True: 37.0k, False: 81.4k]
  ------------------
 1033|       |
 1034|   118k|    m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_src);
 1035|   118k|    pi2_src += src_strd;
 1036|   118k|    m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_src);
 1037|   118k|    pi2_src += src_strd;
 1038|   118k|    m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_src);
 1039|   118k|    pi2_src += src_strd;
 1040|   118k|    m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_src);
 1041|   118k|    pi2_src += src_strd;
 1042|       |
 1043|   118k|    m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_src);
 1044|   118k|    pi2_src += src_strd;
 1045|   118k|    m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_src);
 1046|   118k|    pi2_src += src_strd;
 1047|   118k|    m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_src);
 1048|   118k|    pi2_src += src_strd;
 1049|   118k|    m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_src);
 1050|       |
 1051|   118k|    if(!check_row_stage_2)
  ------------------
  |  Branch (1051:8): [True: 81.4k, False: 37.0k]
  ------------------
 1052|  81.4k|    {
 1053|  81.4k|        if(!check_row_stage_1)
  ------------------
  |  Branch (1053:12): [True: 68.6k, False: 12.7k]
  ------------------
 1054|  68.6k|        {
 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|  68.6k|            {
 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|  68.6k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1061|  68.6k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1062|       |
 1063|  68.6k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1064|       |
 1065|  68.6k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1066|  68.6k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1067|       |
 1068|  68.6k|            }
 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|  68.6k|            {
 1075|       |
 1076|  68.6k|                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|  68.6k|                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|  68.6k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1082|       |
 1083|  68.6k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1084|  68.6k|                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|  68.6k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1090|  68.6k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1091|       |
 1092|  68.6k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1093|  68.6k|                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|  68.6k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1104|  68.6k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1105|       |
 1106|  68.6k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1107|  68.6k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1108|       |
 1109|  68.6k|            }
 1110|       |
 1111|       |            /* o */
 1112|  68.6k|            {
 1113|       |
 1114|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1115|  68.6k|                {
 1116|       |
 1117|  68.6k|                    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|  68.6k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1120|       |
 1121|  68.6k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1122|  68.6k|                    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|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1135|  68.6k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1136|       |
 1137|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1138|  68.6k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1139|       |
 1140|  68.6k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1141|  68.6k|                    m_temp_reg_63 = _mm_setzero_si128();
 1142|  68.6k|                    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|  68.6k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1146|       |
 1147|  68.6k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1148|  68.6k|                    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|  68.6k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1153|  68.6k|                    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|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1165|  68.6k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1166|       |
 1167|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1168|  68.6k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1169|       |
 1170|  68.6k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1171|  68.6k|                    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|  68.6k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1175|       |
 1176|  68.6k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1177|  68.6k|                    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|  68.6k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1185|  68.6k|                    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|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1195|  68.6k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1196|       |
 1197|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1198|  68.6k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1199|       |
 1200|  68.6k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1201|  68.6k|                    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|  68.6k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1205|       |
 1206|  68.6k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1207|  68.6k|                    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|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1221|  68.6k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1222|       |
 1223|  68.6k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1224|  68.6k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1225|       |
 1226|  68.6k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1227|  68.6k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1228|       |
 1229|       |
 1230|  68.6k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1231|  68.6k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1232|  68.6k|                }
 1233|  68.6k|            }
 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|  68.6k|            {
 1239|  68.6k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1240|  68.6k|                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|  68.6k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1244|  68.6k|                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|  68.6k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1249|  68.6k|                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|  68.6k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1253|  68.6k|                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|  68.6k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1258|  68.6k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1259|  68.6k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1260|  68.6k|                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|  68.6k|                m_temp_reg_54 = _mm_setzero_si128();
 1268|  68.6k|                m_temp_reg_55 = _mm_setzero_si128();
 1269|  68.6k|                m_temp_reg_56 = _mm_setzero_si128();
 1270|  68.6k|                m_temp_reg_57 = _mm_setzero_si128();
 1271|  68.6k|            }
 1272|  68.6k|        }
 1273|  12.7k|        else
 1274|  12.7k|        {
 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|  12.7k|            {
 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|  12.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1281|  12.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1282|       |
 1283|  12.7k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1284|       |
 1285|  12.7k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1286|  12.7k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1287|       |
 1288|  12.7k|            }
 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|  12.7k|            {
 1295|       |
 1296|  12.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
 1297|  12.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
 1298|       |
 1299|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 1300|       |                //Interleaving 2,6 row in 4, 5 Rishab
 1301|  12.7k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1302|       |
 1303|  12.7k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1304|  12.7k|                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|  12.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1310|  12.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1311|       |
 1312|  12.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1313|  12.7k|                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|  12.7k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1324|  12.7k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1325|       |
 1326|  12.7k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1327|  12.7k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1328|       |
 1329|  12.7k|            }
 1330|       |
 1331|       |            /* o */
 1332|  12.7k|            {
 1333|       |
 1334|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1335|  12.7k|                {
 1336|       |
 1337|  12.7k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1338|  12.7k|                    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|  12.7k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1341|  12.7k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1342|       |
 1343|  12.7k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1344|  12.7k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1345|       |
 1346|  12.7k|                    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|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1359|  12.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1360|       |
 1361|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1362|  12.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1363|       |
 1364|  12.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1365|  12.7k|                    m_temp_reg_63 = _mm_setzero_si128();
 1366|  12.7k|                    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|  12.7k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1370|  12.7k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1371|       |
 1372|  12.7k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1373|  12.7k|                    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|  12.7k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1378|  12.7k|                    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|  12.7k|                    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|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1391|  12.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1392|       |
 1393|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1394|  12.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1395|       |
 1396|  12.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1397|  12.7k|                    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|  12.7k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1401|  12.7k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1402|       |
 1403|  12.7k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1404|  12.7k|                    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|  12.7k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1412|  12.7k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 1413|       |
 1414|  12.7k|                    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|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1423|  12.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1424|       |
 1425|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1426|  12.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1427|       |
 1428|  12.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1429|  12.7k|                    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|  12.7k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1433|  12.7k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1434|       |
 1435|  12.7k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1436|  12.7k|                    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|  12.7k|                    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|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1451|  12.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1452|       |
 1453|  12.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1454|  12.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1455|       |
 1456|  12.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1457|  12.7k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1458|       |
 1459|       |
 1460|  12.7k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1461|  12.7k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1462|  12.7k|                }
 1463|  12.7k|            }
 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|  12.7k|            {
 1469|  12.7k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1470|  12.7k|                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|  12.7k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1474|  12.7k|                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|  12.7k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1479|  12.7k|                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|  12.7k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1483|  12.7k|                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|  12.7k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1488|  12.7k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1489|  12.7k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1490|  12.7k|                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|  12.7k|                m_temp_reg_54 = _mm_setzero_si128();
 1498|  12.7k|                m_temp_reg_55 = _mm_setzero_si128();
 1499|  12.7k|                m_temp_reg_56 = _mm_setzero_si128();
 1500|  12.7k|                m_temp_reg_57 = _mm_setzero_si128();
 1501|  12.7k|            }
 1502|  12.7k|        }
 1503|       |
 1504|       |        /* Stage 2 */
 1505|  81.4k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  81.4k|#define IT_SHIFT_STAGE_2 12
  ------------------
 1506|  81.4k|        {
 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|  81.4k|            {
 1510|  81.4k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 1511|  81.4k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 1512|       |
 1513|  81.4k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 1514|  81.4k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 1515|       |
 1516|  81.4k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1517|  81.4k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1518|  81.4k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1519|  81.4k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1520|       |
 1521|       |
 1522|  81.4k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 1523|  81.4k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 1524|  81.4k|            }
 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|  81.4k|            {
 1530|       |
 1531|  81.4k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 1532|  81.4k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 1533|       |
 1534|       |
 1535|  81.4k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1536|  81.4k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1537|  81.4k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1538|  81.4k|                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|  81.4k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1542|       |
 1543|       |
 1544|  81.4k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 1545|  81.4k|                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|  81.4k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1556|  81.4k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1557|       |
 1558|  81.4k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1559|  81.4k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1560|       |
 1561|  81.4k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1562|  81.4k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1563|       |
 1564|  81.4k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1565|  81.4k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1566|       |
 1567|  81.4k|            }
 1568|       |
 1569|       |            /* o */
 1570|  81.4k|            {
 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|  81.4k|                {
 1577|       |                    //o0:1B*89+3B*75,1T*89+3T*75
 1578|  81.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1579|  81.4k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1580|       |
 1581|  81.4k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1582|  81.4k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1583|       |                    /* Loading coeff for computing o1 in the next block */
 1584|  81.4k|                    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|  81.4k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1594|  81.4k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1595|       |
 1596|  81.4k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1597|  81.4k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1598|       |
 1599|  81.4k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1600|  81.4k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1601|  81.4k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1602|  81.4k|                    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|  81.4k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1606|  81.4k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1607|       |
 1608|  81.4k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1609|  81.4k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1610|  81.4k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1611|  81.4k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1612|       |
 1613|  81.4k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1614|  81.4k|                    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|  81.4k|                    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|  81.4k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1631|  81.4k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1632|       |
 1633|  81.4k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1634|  81.4k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1635|       |
 1636|  81.4k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1637|  81.4k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1638|  81.4k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1639|  81.4k|                    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|  81.4k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1643|  81.4k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1644|       |
 1645|  81.4k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1646|  81.4k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1647|  81.4k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1648|  81.4k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1649|       |
 1650|  81.4k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1651|  81.4k|                    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|  81.4k|                    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|  81.4k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1667|  81.4k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1668|       |
 1669|  81.4k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 1670|  81.4k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 1671|       |
 1672|  81.4k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1673|  81.4k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1674|  81.4k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1675|  81.4k|                    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|  81.4k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1679|  81.4k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1680|       |
 1681|  81.4k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1682|  81.4k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1683|  81.4k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1684|  81.4k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1685|       |
 1686|       |
 1687|  81.4k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1688|  81.4k|                    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|  81.4k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1701|  81.4k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1702|       |
 1703|  81.4k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 1704|  81.4k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 1705|       |
 1706|  81.4k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 1707|  81.4k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 1708|  81.4k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 1709|  81.4k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 1710|       |
 1711|  81.4k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 1712|  81.4k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 1713|  81.4k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 1714|  81.4k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 1715|       |
 1716|  81.4k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 1717|  81.4k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 1718|  81.4k|                }
 1719|  81.4k|            }
 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|  81.4k|            {
 1725|  81.4k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1726|  81.4k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1727|  81.4k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1728|  81.4k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1729|  81.4k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1730|  81.4k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1731|  81.4k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1732|  81.4k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1733|       |
 1734|  81.4k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1735|  81.4k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1736|  81.4k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1737|  81.4k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1738|  81.4k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1739|  81.4k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1740|  81.4k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1741|  81.4k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1742|  81.4k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1743|  81.4k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1744|  81.4k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1745|  81.4k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1746|       |
 1747|  81.4k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1748|  81.4k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1749|  81.4k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1750|  81.4k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1751|  81.4k|            }
 1752|       |
 1753|       |            /* Recon and store */
 1754|  81.4k|            {
 1755|  81.4k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1756|  81.4k|                pu1_pred += pred_strd;
 1757|  81.4k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1758|  81.4k|                pu1_pred += pred_strd;
 1759|  81.4k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1760|  81.4k|                pu1_pred += pred_strd;
 1761|  81.4k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1762|  81.4k|                pu1_pred += pred_strd;
 1763|  81.4k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1764|  81.4k|                pu1_pred += pred_strd;
 1765|  81.4k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1766|  81.4k|                pu1_pred += pred_strd;
 1767|  81.4k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1768|  81.4k|                pu1_pred += pred_strd;
 1769|  81.4k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1770|       |
 1771|  81.4k|                m_temp_reg_50 = _mm_setzero_si128();
 1772|  81.4k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 1773|  81.4k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 1774|  81.4k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 1775|  81.4k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 1776|  81.4k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 1777|  81.4k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 1778|  81.4k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 1779|  81.4k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 1780|       |
 1781|  81.4k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 1782|  81.4k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 1783|  81.4k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 1784|  81.4k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 1785|  81.4k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 1786|  81.4k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 1787|  81.4k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 1788|  81.4k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 1789|       |
 1790|  81.4k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 1791|  81.4k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 1792|  81.4k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 1793|  81.4k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 1794|  81.4k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 1795|  81.4k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 1796|  81.4k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 1797|  81.4k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 1798|       |
 1799|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 1800|  81.4k|                pu1_dst += dst_strd;
 1801|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 1802|  81.4k|                pu1_dst += dst_strd;
 1803|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 1804|  81.4k|                pu1_dst += dst_strd;
 1805|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 1806|  81.4k|                pu1_dst += dst_strd;
 1807|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 1808|  81.4k|                pu1_dst += dst_strd;
 1809|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 1810|  81.4k|                pu1_dst += dst_strd;
 1811|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 1812|  81.4k|                pu1_dst += dst_strd;
 1813|  81.4k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 1814|  81.4k|                pu1_dst += dst_strd;
 1815|  81.4k|            }
 1816|  81.4k|        }
 1817|  81.4k|    }
 1818|  37.0k|    else
 1819|       |
 1820|  37.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|  37.0k|        if(!check_row_stage_1)
  ------------------
  |  Branch (1824:12): [True: 8.93k, False: 28.1k]
  ------------------
 1825|  8.93k|        {
 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|  8.93k|            {
 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|  8.93k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1832|  8.93k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1833|       |
 1834|  8.93k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1835|  8.93k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 1836|       |
 1837|  8.93k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1838|  8.93k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1839|       |
 1840|       |
 1841|  8.93k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1842|  8.93k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1843|  8.93k|            }
 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|  8.93k|            {
 1849|       |
 1850|  8.93k|                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|  8.93k|                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|  8.93k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1856|  8.93k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 1857|       |
 1858|  8.93k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1859|  8.93k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1860|       |
 1861|  8.93k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 1862|  8.93k|                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|  8.93k|                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|  8.93k|                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|  8.93k|            }
 1875|       |
 1876|       |            /* e */
 1877|  8.93k|            {
 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|  8.93k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1883|  8.93k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1884|       |
 1885|  8.93k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1886|  8.93k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1887|       |
 1888|  8.93k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1889|  8.93k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1890|       |
 1891|  8.93k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1892|  8.93k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1893|       |
 1894|  8.93k|            }
 1895|       |
 1896|       |            /* o */
 1897|  8.93k|            {
 1898|       |
 1899|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1900|  8.93k|                {
 1901|       |
 1902|  8.93k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1903|  8.93k|                    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|  8.93k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1908|  8.93k|                    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|  8.93k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1914|  8.93k|                    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|  8.93k|                }
 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|  8.93k|                {
 1925|       |
 1926|       |
 1927|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1928|  8.93k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1929|       |
 1930|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1931|  8.93k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1932|       |
 1933|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1934|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1935|  8.93k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1936|  8.93k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1937|       |
 1938|  8.93k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1939|  8.93k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1940|  8.93k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1941|  8.93k|                    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|  8.93k|                    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|  8.93k|                    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|  8.93k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1950|  8.93k|                    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|  8.93k|                    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|  8.93k|                }
 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|  8.93k|                {
 1966|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1967|  8.93k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1968|       |
 1969|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1970|  8.93k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1971|       |
 1972|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1973|  8.93k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1974|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1975|  8.93k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1976|       |
 1977|  8.93k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1978|  8.93k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1979|  8.93k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1980|  8.93k|                    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|  8.93k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1984|  8.93k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1985|       |
 1986|  8.93k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1987|  8.93k|                    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|  8.93k|                    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|  8.93k|                }
 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|  8.93k|                {
 2006|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2007|  8.93k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2008|       |
 2009|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2010|  8.93k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2011|       |
 2012|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2013|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2014|  8.93k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2015|  8.93k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2016|       |
 2017|  8.93k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2018|  8.93k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2019|  8.93k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2020|  8.93k|                    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|  8.93k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2024|  8.93k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2025|       |
 2026|  8.93k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2027|  8.93k|                    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|  8.93k|                }
 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|  8.93k|                {
 2041|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2042|  8.93k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2043|       |
 2044|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2045|  8.93k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2046|       |
 2047|  8.93k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2048|  8.93k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2049|  8.93k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2050|  8.93k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2051|       |
 2052|  8.93k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2053|  8.93k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2054|  8.93k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2055|  8.93k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2056|       |
 2057|  8.93k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2058|  8.93k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2059|  8.93k|                }
 2060|  8.93k|            }
 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|  8.93k|            {
 2066|       |
 2067|       |
 2068|  8.93k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2069|  8.93k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2070|  8.93k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2071|  8.93k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2072|  8.93k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2073|  8.93k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2074|  8.93k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2075|  8.93k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2076|       |
 2077|  8.93k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2078|  8.93k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2079|  8.93k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2080|  8.93k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2081|  8.93k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2082|  8.93k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2083|  8.93k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2084|  8.93k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2085|       |
 2086|  8.93k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2087|  8.93k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2088|  8.93k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2089|  8.93k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2090|       |
 2091|  8.93k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2092|  8.93k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2093|  8.93k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2094|  8.93k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2095|  8.93k|            }
 2096|  8.93k|        }
 2097|  28.1k|        else
 2098|  28.1k|        {
 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|  28.1k|            {
 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|  28.1k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 2106|  28.1k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 2107|       |
 2108|  28.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 2109|  28.1k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 2110|       |
 2111|  28.1k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2112|  28.1k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2113|       |
 2114|       |
 2115|  28.1k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2116|  28.1k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2117|  28.1k|            }
 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|  28.1k|            {
 2123|       |
 2124|  28.1k|                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|  28.1k|                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|  28.1k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 2130|  28.1k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 2131|       |
 2132|  28.1k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 2133|  28.1k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2134|       |
 2135|  28.1k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 2136|  28.1k|                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|  28.1k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 2143|  28.1k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 2144|       |
 2145|  28.1k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 2146|  28.1k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 2147|       |
 2148|  28.1k|            }
 2149|       |
 2150|       |            /* e */
 2151|  28.1k|            {
 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|  28.1k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 2157|  28.1k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 2158|       |
 2159|  28.1k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 2160|  28.1k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 2161|       |
 2162|  28.1k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 2163|  28.1k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 2164|       |
 2165|  28.1k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 2166|  28.1k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 2167|       |
 2168|  28.1k|            }
 2169|       |
 2170|       |            /* o */
 2171|  28.1k|            {
 2172|       |
 2173|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 2174|  28.1k|                {
 2175|       |
 2176|  28.1k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 2177|  28.1k|                    m_temp_reg_61 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 2178|  28.1k|                    m_temp_reg_64 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 2179|  28.1k|                    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|  28.1k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 2182|  28.1k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 2183|  28.1k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 2184|  28.1k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 2185|       |
 2186|       |
 2187|  28.1k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2188|  28.1k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 2189|       |
 2190|  28.1k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2191|  28.1k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2192|  28.1k|                }
 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|  28.1k|                {
 2199|       |
 2200|       |
 2201|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 2202|  28.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 2203|       |
 2204|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2205|  28.1k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2206|       |
 2207|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2208|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2209|  28.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2210|  28.1k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2211|       |
 2212|  28.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2213|  28.1k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2214|  28.1k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2215|  28.1k|                    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|  28.1k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2219|  28.1k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 2220|  28.1k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2221|  28.1k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2222|       |
 2223|  28.1k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2224|  28.1k|                    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|  28.1k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2229|  28.1k|                    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|  28.1k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2233|  28.1k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2234|  28.1k|                }
 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|  28.1k|                {
 2241|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2242|  28.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2243|       |
 2244|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2245|  28.1k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2246|       |
 2247|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2248|  28.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2249|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2250|  28.1k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2251|       |
 2252|  28.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2253|  28.1k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2254|  28.1k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2255|  28.1k|                    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|  28.1k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 2259|  28.1k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 2260|  28.1k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 2261|  28.1k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 2262|       |
 2263|  28.1k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2264|  28.1k|                    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|  28.1k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2273|  28.1k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2274|       |
 2275|  28.1k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2276|  28.1k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2277|  28.1k|                }
 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|  28.1k|                {
 2284|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2285|  28.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2286|       |
 2287|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2288|  28.1k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2289|       |
 2290|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2291|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2292|  28.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2293|  28.1k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2294|       |
 2295|  28.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2296|  28.1k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2297|  28.1k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2298|  28.1k|                    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|  28.1k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2302|  28.1k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 2303|  28.1k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2304|  28.1k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2305|       |
 2306|  28.1k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2307|  28.1k|                    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|  28.1k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2315|  28.1k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2316|  28.1k|                }
 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|  28.1k|                {
 2323|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2324|  28.1k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2325|       |
 2326|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2327|  28.1k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2328|       |
 2329|  28.1k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2330|  28.1k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2331|  28.1k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2332|  28.1k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2333|       |
 2334|  28.1k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2335|  28.1k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2336|  28.1k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2337|  28.1k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2338|       |
 2339|  28.1k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2340|  28.1k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2341|  28.1k|                }
 2342|  28.1k|            }
 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|  28.1k|            {
 2348|       |
 2349|       |
 2350|  28.1k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2351|  28.1k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2352|  28.1k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2353|  28.1k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2354|  28.1k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2355|  28.1k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2356|  28.1k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2357|  28.1k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2358|       |
 2359|  28.1k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2360|  28.1k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2361|  28.1k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2362|  28.1k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2363|  28.1k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2364|  28.1k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2365|  28.1k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2366|  28.1k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2367|       |
 2368|  28.1k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2369|  28.1k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2370|  28.1k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2371|  28.1k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2372|       |
 2373|  28.1k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2374|  28.1k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2375|  28.1k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2376|  28.1k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2377|  28.1k|            }
 2378|  28.1k|        }
 2379|       |        /* Stage 2 */
 2380|       |
 2381|  37.0k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  37.0k|#define IT_SHIFT_STAGE_2 12
  ------------------
 2382|       |
 2383|  37.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|  37.0k|            {
 2388|  37.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 2389|  37.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 2390|       |
 2391|  37.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 2392|  37.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 2393|       |
 2394|  37.0k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2395|  37.0k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2396|  37.0k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2397|  37.0k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2398|       |
 2399|       |
 2400|  37.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 2401|  37.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 2402|  37.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|  37.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|  37.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 2413|  37.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 2414|       |
 2415|       |
 2416|  37.0k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2417|  37.0k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2418|  37.0k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2419|  37.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|  37.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 2426|  37.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 2427|       |
 2428|       |
 2429|  37.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 2430|  37.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|  37.0k|            }
 2437|       |
 2438|       |            /* e */
 2439|  37.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|  37.0k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 2445|  37.0k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 2446|       |
 2447|  37.0k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 2448|  37.0k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 2449|       |
 2450|  37.0k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 2451|  37.0k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 2452|       |
 2453|  37.0k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 2454|  37.0k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 2455|       |
 2456|  37.0k|            }
 2457|       |
 2458|       |            /* o */
 2459|  37.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|  37.0k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_55, m_temp_reg_57);
 2468|  37.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|  37.0k|                {
 2472|       |                    //o0:1B*89+3B*75,1T*89+3T*75,5B*50+7B*18,5T*50+7T*18
 2473|  37.0k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2474|  37.0k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2475|  37.0k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2476|  37.0k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2477|       |
 2478|  37.0k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2479|  37.0k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 2480|       |                    /* Loading coeff for computing o1 in the next block */
 2481|  37.0k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 2482|  37.0k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 2483|       |
 2484|  37.0k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2485|  37.0k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2486|  37.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|  37.0k|                {
 2493|  37.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 2494|  37.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 2495|       |
 2496|  37.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2497|  37.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2498|       |
 2499|  37.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2500|  37.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2501|  37.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2502|  37.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2503|       |
 2504|  37.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2505|  37.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2506|  37.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2507|  37.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|  37.0k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2511|  37.0k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2512|  37.0k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2513|  37.0k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2514|       |
 2515|  37.0k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2516|  37.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|  37.0k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2524|  37.0k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 2525|       |
 2526|  37.0k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2527|  37.0k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2528|  37.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|  37.0k|                {
 2535|  37.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2536|  37.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2537|       |
 2538|  37.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2539|  37.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2540|       |
 2541|  37.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2542|  37.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2543|  37.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2544|  37.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2545|       |
 2546|  37.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2547|  37.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2548|  37.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2549|  37.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|  37.0k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2553|  37.0k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2554|  37.0k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2555|  37.0k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2556|       |
 2557|  37.0k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2558|  37.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|  37.0k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2566|  37.0k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2567|       |
 2568|  37.0k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2569|  37.0k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2570|  37.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|  37.0k|                {
 2577|  37.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2578|  37.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2579|       |
 2580|  37.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2581|  37.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2582|       |
 2583|  37.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2584|  37.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2585|  37.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2586|  37.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2587|       |
 2588|  37.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2589|  37.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2590|  37.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2591|  37.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|  37.0k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2595|  37.0k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2596|  37.0k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2597|  37.0k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2598|       |
 2599|  37.0k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2600|  37.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|  37.0k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2608|  37.0k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2609|  37.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|  37.0k|                {
 2616|  37.0k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2617|  37.0k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2618|       |
 2619|  37.0k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2620|  37.0k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2621|       |
 2622|  37.0k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 2623|  37.0k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 2624|  37.0k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 2625|  37.0k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 2626|       |
 2627|  37.0k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 2628|  37.0k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 2629|  37.0k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 2630|  37.0k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 2631|       |
 2632|  37.0k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 2633|  37.0k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 2634|  37.0k|                }
 2635|  37.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|  37.0k|            {
 2641|  37.0k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2642|  37.0k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2643|  37.0k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2644|  37.0k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2645|  37.0k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2646|  37.0k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2647|  37.0k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2648|  37.0k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2649|       |
 2650|  37.0k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2651|  37.0k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2652|  37.0k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2653|  37.0k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2654|  37.0k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2655|  37.0k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2656|  37.0k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2657|  37.0k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2658|  37.0k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2659|  37.0k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2660|  37.0k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2661|  37.0k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2662|       |
 2663|  37.0k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2664|  37.0k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2665|  37.0k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2666|  37.0k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2667|  37.0k|            }
 2668|       |
 2669|       |            /* Recon and store */
 2670|  37.0k|            {
 2671|  37.0k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2672|  37.0k|                pu1_pred += pred_strd;
 2673|  37.0k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2674|  37.0k|                pu1_pred += pred_strd;
 2675|  37.0k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2676|  37.0k|                pu1_pred += pred_strd;
 2677|  37.0k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2678|  37.0k|                pu1_pred += pred_strd;
 2679|  37.0k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2680|  37.0k|                pu1_pred += pred_strd;
 2681|  37.0k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2682|  37.0k|                pu1_pred += pred_strd;
 2683|  37.0k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2684|  37.0k|                pu1_pred += pred_strd;
 2685|  37.0k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2686|       |
 2687|       |
 2688|  37.0k|                m_temp_reg_50 = _mm_setzero_si128();
 2689|  37.0k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 2690|  37.0k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 2691|  37.0k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 2692|  37.0k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 2693|  37.0k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 2694|  37.0k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 2695|  37.0k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 2696|  37.0k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 2697|       |
 2698|  37.0k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 2699|  37.0k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 2700|  37.0k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 2701|  37.0k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 2702|  37.0k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 2703|  37.0k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 2704|  37.0k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 2705|  37.0k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 2706|       |
 2707|  37.0k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 2708|  37.0k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 2709|  37.0k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 2710|  37.0k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 2711|  37.0k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 2712|  37.0k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 2713|  37.0k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 2714|  37.0k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 2715|       |
 2716|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 2717|  37.0k|                pu1_dst += dst_strd;
 2718|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 2719|  37.0k|                pu1_dst += dst_strd;
 2720|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 2721|  37.0k|                pu1_dst += dst_strd;
 2722|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 2723|  37.0k|                pu1_dst += dst_strd;
 2724|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 2725|  37.0k|                pu1_dst += dst_strd;
 2726|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 2727|  37.0k|                pu1_dst += dst_strd;
 2728|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 2729|  37.0k|                pu1_dst += dst_strd;
 2730|  37.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 2731|  37.0k|                pu1_dst += dst_strd;
 2732|       |
 2733|  37.0k|            }
 2734|       |
 2735|       |
 2736|  37.0k|        }
 2737|       |
 2738|       |
 2739|  37.0k|    }
 2740|   118k|}

ihevcd_bitstream.c:CLZ:
   76|  4.27M|{
   77|  4.27M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 4.19M, False: 76.5k]
  ------------------
   78|  4.19M|        return (__builtin_clz(u4_word));
   79|  76.5k|    else
   80|  76.5k|        return 31;
   81|  4.27M|}
ihevcd_parse_slice_header.c:CLZ:
   76|  59.4k|{
   77|  59.4k|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 58.2k, False: 1.19k]
  ------------------
   78|  58.2k|        return (__builtin_clz(u4_word));
   79|  1.19k|    else
   80|  1.19k|        return 31;
   81|  59.4k|}
ihevcd_parse_residual.c:CLZ:
   76|   340M|{
   77|   340M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 313M, False: 27.2M]
  ------------------
   78|   313M|        return (__builtin_clz(u4_word));
   79|  27.2M|    else
   80|  27.2M|        return 31;
   81|   340M|}
ihevcd_parse_residual.c:CTZ:
   89|  14.7M|{
   90|  14.7M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 14.7M]
  ------------------
   91|      0|        return 31;
   92|  14.7M|    else
   93|  14.7M|    {
   94|  14.7M|        unsigned int index;
   95|  14.7M|        index = __builtin_ctz(u4_word);
   96|  14.7M|        return (UWORD32)index;
   97|  14.7M|    }
   98|  14.7M|}
ihevcd_cabac.c:CLZ:
   76|   108M|{
   77|   108M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 108M, False: 0]
  ------------------
   78|   108M|        return (__builtin_clz(u4_word));
   79|      0|    else
   80|      0|        return 31;
   81|   108M|}
ihevcd_iquant_itrans_recon_ctb.c:CLZ:
   76|  58.3M|{
   77|  58.3M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 58.3M, False: 18.4E]
  ------------------
   78|  58.3M|        return (__builtin_clz(u4_word));
   79|  18.4E|    else
   80|  18.4E|        return 31;
   81|  58.3M|}
ihevcd_iquant_itrans_recon_ctb.c:CTZ:
   89|  8.41k|{
   90|  8.41k|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 8.41k]
  ------------------
   91|      0|        return 31;
   92|  8.41k|    else
   93|  8.41k|    {
   94|  8.41k|        unsigned int index;
   95|  8.41k|        index = __builtin_ctz(u4_word);
   96|  8.41k|        return (UWORD32)index;
   97|  8.41k|    }
   98|  8.41k|}
ihevcd_deblk.c:CTZ:
   89|   578M|{
   90|   578M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 271M, False: 307M]
  ------------------
   91|   271M|        return 31;
   92|   307M|    else
   93|   307M|    {
   94|   307M|        unsigned int index;
   95|   307M|        index = __builtin_ctz(u4_word);
   96|   307M|        return (UWORD32)index;
   97|   307M|    }
   98|   578M|}
ihevcd_sao.c:CTZ:
   89|  1.46G|{
   90|  1.46G|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 4.94M, False: 1.45G]
  ------------------
   91|  4.94M|        return 31;
   92|  1.45G|    else
   93|  1.45G|    {
   94|  1.45G|        unsigned int index;
   95|  1.45G|        index = __builtin_ctz(u4_word);
   96|  1.45G|        return (UWORD32)index;
   97|  1.45G|    }
   98|  1.46G|}
ihevc_intra_pred_filters.c:CTZ:
   89|  4.03M|{
   90|  4.03M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 4.03M]
  ------------------
   91|      0|        return 31;
   92|  4.03M|    else
   93|  4.03M|    {
   94|  4.03M|        unsigned int index;
   95|  4.03M|        index = __builtin_ctz(u4_word);
   96|  4.03M|        return (UWORD32)index;
   97|  4.03M|    }
   98|  4.03M|}
ihevc_chroma_intra_pred_filters.c:CTZ:
   89|  2.19M|{
   90|  2.19M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 2.19M]
  ------------------
   91|      0|        return 31;
   92|  2.19M|    else
   93|  2.19M|    {
   94|  2.19M|        unsigned int index;
   95|  2.19M|        index = __builtin_ctz(u4_word);
   96|  2.19M|        return (UWORD32)index;
   97|  2.19M|    }
   98|  2.19M|}
ihevc_intra_pred_filters_ssse3_intr.c:CTZ:
   89|  2.44M|{
   90|  2.44M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 2.44M]
  ------------------
   91|      0|        return 31;
   92|  2.44M|    else
   93|  2.44M|    {
   94|  2.44M|        unsigned int index;
   95|  2.44M|        index = __builtin_ctz(u4_word);
   96|  2.44M|        return (UWORD32)index;
   97|  2.44M|    }
   98|  2.44M|}
ihevc_intra_pred_filters_sse42_intr.c:CTZ:
   89|   661k|{
   90|   661k|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 661k]
  ------------------
   91|      0|        return 31;
   92|   661k|    else
   93|   661k|    {
   94|   661k|        unsigned int index;
   95|   661k|        index = __builtin_ctz(u4_word);
   96|   661k|        return (UWORD32)index;
   97|   661k|    }
   98|   661k|}
ihevc_hbd_chroma_intra_pred_filters.c:CTZ:
   89|  1.77M|{
   90|  1.77M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 1.77M]
  ------------------
   91|      0|        return 31;
   92|  1.77M|    else
   93|  1.77M|    {
   94|  1.77M|        unsigned int index;
   95|  1.77M|        index = __builtin_ctz(u4_word);
   96|  1.77M|        return (UWORD32)index;
   97|  1.77M|    }
   98|  1.77M|}
ihevc_hbd_intra_pred_filters.c:CTZ:
   89|  4.18M|{
   90|  4.18M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 4.18M]
  ------------------
   91|      0|        return 31;
   92|  4.18M|    else
   93|  4.18M|    {
   94|  4.18M|        unsigned int index;
   95|  4.18M|        index = __builtin_ctz(u4_word);
   96|  4.18M|        return (UWORD32)index;
   97|  4.18M|    }
   98|  4.18M|}

ihevc_sao_band_offset_luma_ssse3:
  129|   157k|{
  130|   157k|    WORD32 row, col;
  131|   157k|    UWORD8 *pu1_src_cpy;
  132|   157k|    WORD32 wd_rem;
  133|   157k|    WORD8 offset = 0;
  134|       |
  135|   157k|    __m128i src_temp0_8x16b, src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b;
  136|   157k|    __m128i band_table0_8x16b, band_table1_8x16b, band_table2_8x16b, band_table3_8x16b;
  137|   157k|    __m128i tmp_set_128i_1, tmp_set_128i_2, tmp_set_128i_3, tmp_set_128i_4;
  138|   157k|    __m128i band_pos_16x8b;
  139|   157k|    __m128i sao_offset;
  140|   157k|    __m128i cmp_mask, cmp_store;
  141|       |
  142|       |    /* Updating left and top-left and top */
  143|  4.06M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (143:18): [True: 3.91M, False: 157k]
  ------------------
  144|  3.91M|    {
  145|  3.91M|        pu1_src_left[row] = pu1_src[row * src_strd + (wd - 1)];
  146|  3.91M|    }
  147|   157k|    pu1_src_top_left[0] = pu1_src_top[wd - 1];
  148|   652k|    for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (148:18): [True: 494k, False: 157k]
  ------------------
  149|   494k|    {
  150|   494k|        tmp_set_128i_1 = _mm_loadl_epi64((__m128i *)(pu1_src + (ht - 1) * src_strd + offset));
  151|   494k|        _mm_storel_epi64((__m128i *)(pu1_src_top + offset), tmp_set_128i_1);
  152|   494k|        offset += 8;
  153|   494k|    }
  154|       |
  155|       |    //replicating sao_band_pos as 8 bit value 16 times
  156|       |
  157|       |
  158|   157k|    band_pos_16x8b = _mm_set1_epi16((WORD16)(sao_band_pos << 3));
  159|       |    //value set for sao_offset extraction
  160|   157k|    tmp_set_128i_1  = _mm_set_epi8(-128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1);
  161|   157k|    tmp_set_128i_2  = _mm_set_epi8(-128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2);
  162|   157k|    tmp_set_128i_3  = _mm_set_epi8(-128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3);
  163|   157k|    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|   157k|    sao_offset      = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
  167|       |
  168|       |    //loading 16bit 32values of gu2_table_band_idx consecutively in 4 registers
  169|   157k|    band_table0_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx));
  170|   157k|    band_table1_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 8));
  171|   157k|    band_table2_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 16));
  172|   157k|    band_table3_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 24));
  173|       |
  174|       |    //band_position addition
  175|   157k|    band_table0_8x16b = _mm_add_epi16(band_table0_8x16b, band_pos_16x8b);
  176|   157k|    band_table1_8x16b = _mm_add_epi16(band_table1_8x16b, band_pos_16x8b);
  177|   157k|    band_table2_8x16b = _mm_add_epi16(band_table2_8x16b, band_pos_16x8b);
  178|   157k|    band_table3_8x16b = _mm_add_epi16(band_table3_8x16b, band_pos_16x8b);
  179|       |    //sao_offset duplication
  180|   157k|    tmp_set_128i_1  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_1);
  181|   157k|    tmp_set_128i_2  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_2);
  182|   157k|    tmp_set_128i_3  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_3);
  183|   157k|    tmp_set_128i_4  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_4);
  184|       |    //settng for comparision
  185|   157k|    cmp_mask = _mm_set1_epi16(16);
  186|   157k|    cmp_store = _mm_set1_epi16(0x00ff);
  187|       |
  188|       |    //sao_offset addition
  189|   157k|    band_table0_8x16b = _mm_add_epi16(band_table0_8x16b, tmp_set_128i_1);
  190|   157k|    band_table1_8x16b = _mm_add_epi16(band_table1_8x16b, tmp_set_128i_2);
  191|   157k|    band_table2_8x16b = _mm_add_epi16(band_table2_8x16b, tmp_set_128i_3);
  192|   157k|    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|   157k|    band_table0_8x16b = _mm_and_si128(band_table0_8x16b, cmp_store);
  195|   157k|    band_table1_8x16b = _mm_and_si128(band_table1_8x16b, cmp_store);
  196|   157k|    band_table2_8x16b = _mm_and_si128(band_table2_8x16b, cmp_store);
  197|   157k|    band_table3_8x16b = _mm_and_si128(band_table3_8x16b, cmp_store);
  198|       |
  199|   157k|    switch(sao_band_pos)
  200|   157k|    {
  201|  17.0k|        case 0:
  ------------------
  |  Branch (201:9): [True: 17.0k, False: 140k]
  ------------------
  202|  17.0k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table0_8x16b);
  203|  17.0k|            band_table0_8x16b = _mm_and_si128(band_table0_8x16b, tmp_set_128i_2);
  204|  17.0k|            break;
  205|  3.66k|        case 28:
  ------------------
  |  Branch (205:9): [True: 3.66k, False: 154k]
  ------------------
  206|  3.66k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table3_8x16b);
  207|  3.66k|            band_table3_8x16b = _mm_or_si128(band_table3_8x16b, tmp_set_128i_2);
  208|  3.66k|            break;
  209|  8.88k|        case 29:
  ------------------
  |  Branch (209:9): [True: 8.88k, False: 148k]
  ------------------
  210|  8.88k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table2_8x16b);
  211|  8.88k|            band_table2_8x16b = _mm_or_si128(band_table2_8x16b, tmp_set_128i_2);
  212|  8.88k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table3_8x16b);
  213|  8.88k|            band_table3_8x16b = _mm_and_si128(band_table3_8x16b, tmp_set_128i_2);
  214|  8.88k|            break;
  215|  8.54k|        case 30:
  ------------------
  |  Branch (215:9): [True: 8.54k, False: 149k]
  ------------------
  216|  8.54k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table1_8x16b);
  217|  8.54k|            band_table1_8x16b = _mm_or_si128(band_table1_8x16b, tmp_set_128i_2);
  218|  8.54k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table2_8x16b);
  219|  8.54k|            band_table2_8x16b = _mm_and_si128(band_table2_8x16b, tmp_set_128i_2);
  220|  8.54k|            break;
  221|  3.15k|        case 31:
  ------------------
  |  Branch (221:9): [True: 3.15k, False: 154k]
  ------------------
  222|  3.15k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table0_8x16b);
  223|  3.15k|            band_table0_8x16b = _mm_or_si128(band_table0_8x16b, tmp_set_128i_2);
  224|  3.15k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table1_8x16b);
  225|  3.15k|            band_table1_8x16b = _mm_and_si128(band_table1_8x16b, tmp_set_128i_2);
  226|  3.15k|            break;
  227|   116k|        default:
  ------------------
  |  Branch (227:9): [True: 116k, False: 41.2k]
  ------------------
  228|   116k|            break;
  229|   157k|    }
  230|       |    //sao_offset is reused for zero cmp mask.
  231|   157k|    sao_offset = _mm_setzero_si128();
  232|   157k|    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|   157k|    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|   157k|    band_table0_8x16b = _mm_and_si128(band_table0_8x16b, cmp_store);
  238|   157k|    band_table1_8x16b = _mm_and_si128(band_table1_8x16b, cmp_store);
  239|   157k|    band_table2_8x16b = _mm_and_si128(band_table2_8x16b, cmp_store);
  240|   157k|    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|   157k|    band_table0_8x16b = _mm_packus_epi16(band_table0_8x16b, band_table1_8x16b);
  244|   157k|    band_table2_8x16b = _mm_packus_epi16(band_table2_8x16b, band_table3_8x16b);
  245|       |
  246|   157k|    band_table3_8x16b = _mm_slli_epi16(cmp_mask, 1); // to compare if value is greater than 31
  247|   157k|    band_pos_16x8b = _mm_packus_epi16(band_pos_16x8b, band_pos_16x8b); //band_pos is now 8 bit aligned
  248|   157k|    band_table3_8x16b = _mm_sub_epi8(band_table3_8x16b, tmp_set_128i_1); // to compare if value is greater than 31
  249|       |
  250|   157k|    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|   328k|    for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (253:19): [True: 171k, False: 157k]
  ------------------
  254|   171k|    {
  255|   171k|        pu1_src_cpy = pu1_src;
  256|  2.73M|        for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (256:23): [True: 2.55M, False: 171k]
  ------------------
  257|  2.55M|        {
  258|       |
  259|       |
  260|       |            //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  261|  2.55M|            src_temp0_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
  262|       |            // row = 1
  263|  2.55M|            src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
  264|       |
  265|       |
  266|       |
  267|       |            //saturated substract 8 bit
  268|  2.55M|            tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_16x8b);
  269|  2.55M|            tmp_set_128i_3 = _mm_sub_epi8(src_temp2_8x16b, band_pos_16x8b);
  270|       |            //if the values less than 0 put ff
  271|  2.55M|            tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  272|  2.55M|            tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  273|  2.55M|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  274|  2.55M|            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.55M|            tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, band_table3_8x16b);
  277|  2.55M|            tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, band_table3_8x16b);
  278|  2.55M|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  279|  2.55M|            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.55M|            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.55M|            tmp_set_128i_2 = _mm_and_si128(tmp_set_128i_1, cmp_store);
  287|       |            // values 0 to 15 for row 0 & 1
  288|  2.55M|            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.55M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_2, sao_offset);
  291|  2.55M|            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.55M|            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.55M|            tmp_set_128i_4 = _mm_and_si128(tmp_set_128i_3, cmp_store);
  297|       |            // values 0 to 15 for row 2 & 3
  298|  2.55M|            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.55M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  301|  2.55M|            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.55M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_1, tmp_set_128i_2);
  306|  2.55M|            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.55M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_3, tmp_set_128i_4);
  311|  2.55M|            src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, cmp_store);
  312|       |
  313|       |            //indexing 0 - 15 bandtable indexes
  314|  2.55M|            tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_1);
  315|  2.55M|            tmp_set_128i_3 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_3);
  316|  2.55M|            tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_2);
  317|  2.55M|            tmp_set_128i_4 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_4);
  318|       |            // combining all offsets results
  319|  2.55M|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  320|  2.55M|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  321|       |            // combing results woth the pixel values
  322|  2.55M|            src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  323|  2.55M|            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.55M|            _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_8x16b);
  328|       |            // row = 1
  329|  2.55M|            _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp2_8x16b);
  330|       |
  331|  2.55M|            pu1_src_cpy += (src_strd << 1);
  332|  2.55M|        }
  333|   171k|        pu1_src += 16;
  334|   171k|    }
  335|   157k|    wd_rem = wd & 0xF;
  336|   157k|    if(wd_rem)
  ------------------
  |  Branch (336:8): [True: 152k, False: 5.39k]
  ------------------
  337|   152k|    {pu1_src_cpy = pu1_src;
  338|  1.09M|        for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (338:23): [True: 946k, False: 152k]
  ------------------
  339|   946k|        {
  340|       |
  341|       |
  342|       |            //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  343|   946k|            src_temp0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
  344|       |            // row = 1
  345|   946k|            src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
  346|       |            // row = 2
  347|   946k|            src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
  348|       |            // row = 3
  349|   946k|            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|   946k|            src_temp0_8x16b = _mm_unpacklo_epi64(src_temp0_8x16b, src_temp1_8x16b);
  353|   946k|            src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp3_8x16b);
  354|       |
  355|       |            //saturated substract 8 bit
  356|   946k|            tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_16x8b);
  357|   946k|            tmp_set_128i_3 = _mm_sub_epi8(src_temp2_8x16b, band_pos_16x8b);
  358|       |            //if the values less than 0 put ff
  359|   946k|            tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  360|   946k|            tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  361|   946k|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  362|   946k|            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|   946k|            tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, band_table3_8x16b);
  365|   946k|            tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, band_table3_8x16b);
  366|   946k|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  367|   946k|            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|   946k|            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|   946k|            tmp_set_128i_2 = _mm_and_si128(tmp_set_128i_1, cmp_store);
  376|       |            // values 0 to 15 for row 0 & 1
  377|   946k|            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|   946k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_2, sao_offset);
  380|   946k|            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|   946k|            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|   946k|            tmp_set_128i_4 = _mm_and_si128(tmp_set_128i_3, cmp_store);
  386|       |            // values 0 to 15 for row 2 & 3
  387|   946k|            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|   946k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  390|   946k|            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|   946k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_1, tmp_set_128i_2);
  395|   946k|            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|   946k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_3, tmp_set_128i_4);
  400|   946k|            src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, cmp_store);
  401|       |
  402|       |            //indexing 0 - 15 bandtable indexes
  403|   946k|            tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_1);
  404|   946k|            tmp_set_128i_3 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_3);
  405|   946k|            tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_2);
  406|   946k|            tmp_set_128i_4 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_4);
  407|       |            // combining all offsets results
  408|   946k|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  409|   946k|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  410|       |            // combing results woth the pixel values
  411|   946k|            src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  412|   946k|            src_temp2_8x16b = _mm_or_si128(src_temp2_8x16b, tmp_set_128i_3);
  413|       |
  414|       |            //Getting row1 separately
  415|   946k|            src_temp1_8x16b = _mm_srli_si128(src_temp0_8x16b, 8);
  416|       |            //Getting row3 separately
  417|   946k|            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|   946k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_8x16b);
  421|       |            // row = 1
  422|   946k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), src_temp1_8x16b);
  423|       |            // row = 2
  424|   946k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp2_8x16b);
  425|       |            // row = 3
  426|   946k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), src_temp3_8x16b);
  427|       |
  428|   946k|            pu1_src_cpy += (src_strd << 2);
  429|       |
  430|   946k|        }
  431|   152k|        pu1_src += 8;
  432|   152k|    }
  433|       |
  434|       |
  435|   157k|}
ihevc_sao_band_offset_chroma_ssse3:
  448|  95.5k|{
  449|  95.5k|    WORD32 row, col;
  450|  95.5k|    WORD8 offset = 0;
  451|       |
  452|       |
  453|  95.5k|    __m128i src_temp0_8x16b, src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b;
  454|  95.5k|    __m128i cmp_msk2;
  455|  95.5k|    __m128i band_table0_16x8b, band_table1_16x8b, band_table2_16x8b, band_table3_16x8b;
  456|  95.5k|    __m128i tmp_set_128i_1, tmp_set_128i_2, tmp_set_128i_3, tmp_set_128i_4;
  457|  95.5k|    __m128i band_pos_u_16x8b, band_pos_v_16x8b;
  458|  95.5k|    __m128i sao_offset;
  459|  95.5k|    __m128i cmp_mask;
  460|       |
  461|       |
  462|       |    /* Updating left and top and top-left */
  463|  1.42M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (463:18): [True: 1.32M, False: 95.5k]
  ------------------
  464|  1.32M|    {
  465|  1.32M|        pu1_src_left[2 * row] = pu1_src[row * src_strd + (wd - 2)];
  466|  1.32M|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + (wd - 1)];
  467|  1.32M|    }
  468|  95.5k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  469|  95.5k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  470|   411k|    for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (470:18): [True: 316k, False: 95.5k]
  ------------------
  471|   316k|    {
  472|   316k|        tmp_set_128i_1 = _mm_loadl_epi64((__m128i *)(pu1_src + (ht - 1) * src_strd + offset));
  473|   316k|        _mm_storel_epi64((__m128i *)(pu1_src_top + offset), tmp_set_128i_1);
  474|   316k|        offset += 8;
  475|   316k|    }
  476|       |
  477|  95.5k|    { // band _table creation
  478|  95.5k|        __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|  95.5k|        band_pos_u_16x8b = _mm_set1_epi16((WORD16)(sao_band_pos_u << 3));
  482|       |        //value set for sao_offset extraction
  483|  95.5k|        tmp_set_128i_1  = _mm_set_epi8(-128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1);
  484|  95.5k|        tmp_set_128i_2  = _mm_set_epi8(-128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2);
  485|  95.5k|        tmp_set_128i_3  = _mm_set_epi8(-128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3);
  486|  95.5k|        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|  95.5k|        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|  95.5k|        band_table0_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx));
  493|  95.5k|        band_table1_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 8));
  494|  95.5k|        band_table2_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 16));
  495|  95.5k|        band_table3_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 24));
  496|       |
  497|       |        //band_position addition
  498|  95.5k|        band_table0_16x8b = _mm_add_epi16(band_table0_16x8b, band_pos_u_16x8b);
  499|  95.5k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, band_pos_u_16x8b);
  500|  95.5k|        band_table2_16x8b = _mm_add_epi16(band_table2_16x8b, band_pos_u_16x8b);
  501|  95.5k|        band_table3_16x8b = _mm_add_epi16(band_table3_16x8b, band_pos_u_16x8b);
  502|       |        //sao_offset duplication
  503|  95.5k|        temp0_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_1);
  504|  95.5k|        temp1_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_2);
  505|  95.5k|        temp2_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_3);
  506|  95.5k|        temp3_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_4);
  507|       |
  508|       |        //sao_offset addition
  509|  95.5k|        band_table0_16x8b = _mm_add_epi16(band_table0_16x8b, temp0_8x16b);
  510|  95.5k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, temp1_8x16b);
  511|  95.5k|        band_table2_16x8b = _mm_add_epi16(band_table2_16x8b, temp2_8x16b);
  512|  95.5k|        band_table3_16x8b = _mm_add_epi16(band_table3_16x8b, temp3_8x16b);
  513|       |        //reuse for clipping
  514|  95.5k|        temp1_8x16b = _mm_set1_epi16(0x00ff);
  515|       |        //settng for comparision
  516|  95.5k|        cmp_mask = _mm_set1_epi16(16);
  517|       |
  518|       |        //masking upper 8bit values of each  16 bit band table value
  519|  95.5k|        band_table0_16x8b = _mm_and_si128(band_table0_16x8b, temp1_8x16b);
  520|  95.5k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  521|  95.5k|        band_table2_16x8b = _mm_and_si128(band_table2_16x8b, temp1_8x16b);
  522|  95.5k|        band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp1_8x16b);
  523|       |
  524|       |        //temp1_8x16b reuse for compare storage
  525|  95.5k|        switch(sao_band_pos_u)
  526|  95.5k|        {
  527|  16.0k|            case 0:
  ------------------
  |  Branch (527:13): [True: 16.0k, False: 79.4k]
  ------------------
  528|  16.0k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table0_16x8b);
  529|  16.0k|                band_table0_16x8b = _mm_and_si128(band_table0_16x8b, temp3_8x16b);
  530|  16.0k|                break;
  531|  3.78k|            case 28:
  ------------------
  |  Branch (531:13): [True: 3.78k, False: 91.7k]
  ------------------
  532|  3.78k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  533|  3.78k|                band_table3_16x8b = _mm_or_si128(band_table3_16x8b, temp3_8x16b);
  534|  3.78k|                break;
  535|  3.78k|            case 29:
  ------------------
  |  Branch (535:13): [True: 3.78k, False: 91.7k]
  ------------------
  536|  3.78k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table2_16x8b);
  537|  3.78k|                band_table2_16x8b = _mm_or_si128(band_table2_16x8b, temp3_8x16b);
  538|  3.78k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  539|  3.78k|                band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp3_8x16b);
  540|  3.78k|                break;
  541|  2.41k|            case 30:
  ------------------
  |  Branch (541:13): [True: 2.41k, False: 93.1k]
  ------------------
  542|  2.41k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  543|  2.41k|                band_table1_16x8b = _mm_or_si128(band_table1_16x8b, temp3_8x16b);
  544|  2.41k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table2_16x8b);
  545|  2.41k|                band_table2_16x8b = _mm_and_si128(band_table2_16x8b, temp3_8x16b);
  546|  2.41k|                break;
  547|  1.72k|            case 31:
  ------------------
  |  Branch (547:13): [True: 1.72k, False: 93.8k]
  ------------------
  548|  1.72k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table0_16x8b);
  549|  1.72k|                band_table0_16x8b = _mm_or_si128(band_table0_16x8b, temp3_8x16b);
  550|  1.72k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  551|  1.72k|                band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp3_8x16b);
  552|  1.72k|                break;
  553|  67.7k|            default:
  ------------------
  |  Branch (553:13): [True: 67.7k, False: 27.7k]
  ------------------
  554|  67.7k|                break;
  555|  95.5k|        }
  556|       |        //masking upper 8bit values of each  16 bit band table value
  557|  95.4k|        band_table0_16x8b = _mm_and_si128(band_table0_16x8b, temp1_8x16b);
  558|  95.4k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  559|  95.4k|        band_table2_16x8b = _mm_and_si128(band_table2_16x8b, temp1_8x16b);
  560|  95.4k|        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|  95.4k|        band_table0_16x8b = _mm_packus_epi16(band_table0_16x8b, band_table1_16x8b);
  563|  95.4k|        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|  95.4k|        band_pos_v_16x8b = _mm_set1_epi16((WORD16)(sao_band_pos_v << 3));
  569|       |
  570|       |        //loaded sao offset values
  571|  95.4k|        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|  95.4k|        temp0_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx));
  575|  95.4k|        band_table1_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 8));
  576|  95.4k|        temp2_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 16));
  577|  95.4k|        band_table3_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 24));
  578|       |
  579|       |        //band_position addition
  580|  95.4k|        temp0_8x16b = _mm_add_epi16(temp0_8x16b, band_pos_v_16x8b);
  581|  95.4k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, band_pos_v_16x8b);
  582|  95.4k|        temp2_8x16b = _mm_add_epi16(temp2_8x16b, band_pos_v_16x8b);
  583|  95.4k|        band_table3_16x8b = _mm_add_epi16(band_table3_16x8b, band_pos_v_16x8b);
  584|       |        //sao_offset duplication
  585|  95.4k|        tmp_set_128i_1  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_1);
  586|  95.4k|        tmp_set_128i_2  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_2);
  587|  95.4k|        tmp_set_128i_3  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_3);
  588|  95.4k|        tmp_set_128i_4  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_4);
  589|       |
  590|       |        //sao_offset addition
  591|  95.4k|        temp0_8x16b = _mm_add_epi16(temp0_8x16b, tmp_set_128i_1);
  592|  95.4k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, tmp_set_128i_2);
  593|  95.4k|        temp2_8x16b = _mm_add_epi16(temp2_8x16b, tmp_set_128i_3);
  594|  95.4k|        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|  95.4k|        temp0_8x16b = _mm_and_si128(temp0_8x16b, temp1_8x16b);
  598|  95.4k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  599|  95.4k|        temp2_8x16b = _mm_and_si128(temp2_8x16b, temp1_8x16b);
  600|  95.4k|        band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp1_8x16b);
  601|       |        //temp1_8x16b reuse for compare storage
  602|       |
  603|  95.4k|        switch(sao_band_pos_v)
  604|  95.4k|        {
  605|  17.4k|            case 0:
  ------------------
  |  Branch (605:13): [True: 17.4k, False: 78.0k]
  ------------------
  606|  17.4k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp0_8x16b);
  607|  17.4k|                temp0_8x16b = _mm_and_si128(temp0_8x16b, temp3_8x16b);
  608|  17.4k|                break;
  609|  3.52k|            case 28:
  ------------------
  |  Branch (609:13): [True: 3.52k, False: 91.9k]
  ------------------
  610|  3.52k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  611|  3.52k|                band_table3_16x8b = _mm_or_si128(band_table3_16x8b, temp3_8x16b);
  612|  3.52k|                break;
  613|  3.14k|            case 29:
  ------------------
  |  Branch (613:13): [True: 3.14k, False: 92.2k]
  ------------------
  614|  3.14k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp2_8x16b);
  615|  3.14k|                temp2_8x16b = _mm_or_si128(temp2_8x16b, temp3_8x16b);
  616|  3.14k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  617|  3.14k|                band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp3_8x16b);
  618|  3.14k|                break;
  619|  2.88k|            case 30:
  ------------------
  |  Branch (619:13): [True: 2.88k, False: 92.5k]
  ------------------
  620|  2.88k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  621|  2.88k|                band_table1_16x8b = _mm_or_si128(band_table1_16x8b, temp3_8x16b);
  622|  2.88k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp2_8x16b);
  623|  2.88k|                temp2_8x16b = _mm_and_si128(temp2_8x16b, temp3_8x16b);
  624|  2.88k|                break;
  625|  3.18k|            case 31:
  ------------------
  |  Branch (625:13): [True: 3.18k, False: 92.2k]
  ------------------
  626|  3.18k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp0_8x16b);
  627|  3.18k|                temp0_8x16b = _mm_or_si128(temp0_8x16b, temp3_8x16b);
  628|  3.18k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  629|  3.18k|                band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp3_8x16b);
  630|  3.18k|                break;
  631|  65.3k|            default:
  ------------------
  |  Branch (631:13): [True: 65.3k, False: 30.0k]
  ------------------
  632|  65.3k|                break;
  633|  95.4k|        }
  634|       |        //masking upper 8bit values of each  16 bit band table value
  635|  95.4k|        temp0_8x16b = _mm_and_si128(temp0_8x16b, temp1_8x16b);
  636|  95.4k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  637|  95.4k|        temp2_8x16b = _mm_and_si128(temp2_8x16b, temp1_8x16b);
  638|  95.4k|        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|  95.4k|        band_table1_16x8b = _mm_packus_epi16(temp0_8x16b, band_table1_16x8b);
  641|  95.4k|        band_table3_16x8b = _mm_packus_epi16(temp2_8x16b, band_table3_16x8b);
  642|       |        //band table for u and v created
  643|  95.4k|    }
  644|      0|    {
  645|  95.4k|        UWORD8 *pu1_src_cpy;
  646|  95.4k|        WORD32 wd_rem;
  647|       |
  648|       |
  649|       |        //sao_offset is reused for zero cmp mask.
  650|  95.4k|        sao_offset = _mm_setzero_si128();
  651|  95.4k|        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|  95.4k|        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|  95.4k|        cmp_msk2 = _mm_slli_epi16(cmp_mask, 1); // to compare if value is greater than 31
  657|  95.4k|        band_pos_u_16x8b = _mm_packus_epi16(band_pos_u_16x8b, band_pos_u_16x8b); //band_pos_u is now 8 bit aligned
  658|  95.4k|        band_pos_v_16x8b = _mm_packus_epi16(band_pos_v_16x8b, band_pos_v_16x8b); //band_pos_v is now 8 bit aligned
  659|  95.4k|        cmp_msk2 = _mm_sub_epi8(cmp_msk2, tmp_set_128i_1); // to compare if value is greater than 31
  660|       |
  661|  95.4k|        cmp_mask = _mm_sub_epi8(cmp_mask, tmp_set_128i_1);
  662|       |
  663|   251k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (663:23): [True: 155k, False: 95.4k]
  ------------------
  664|   155k|        {
  665|   155k|            pu1_src_cpy = pu1_src;
  666|  1.36M|            for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (666:27): [True: 1.21M, False: 155k]
  ------------------
  667|  1.21M|            {
  668|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  669|  1.21M|                src_temp0_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
  670|       |                // row = 1
  671|  1.21M|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
  672|       |
  673|       |
  674|       |                //odd values
  675|  1.21M|                src_temp1_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  676|  1.21M|                src_temp2_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  677|       |                //even values
  678|  1.21M|                src_temp0_8x16b = _mm_slli_epi16(src_temp0_8x16b, 8);
  679|  1.21M|                src_temp3_8x16b = _mm_slli_epi16(src_temp3_8x16b, 8);
  680|  1.21M|                src_temp0_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  681|  1.21M|                src_temp3_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  682|       |                //combining odd values
  683|  1.21M|                src_temp2_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp2_8x16b);
  684|       |                //combining even values
  685|  1.21M|                src_temp0_8x16b = _mm_packus_epi16(src_temp0_8x16b, src_temp3_8x16b);
  686|       |
  687|       |                //saturated substract 8 bit
  688|  1.21M|                tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_u_16x8b);
  689|  1.21M|                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.21M|                tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  692|  1.21M|                tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  693|  1.21M|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  694|  1.21M|                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.21M|                tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_msk2);
  697|  1.21M|                tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_msk2);
  698|  1.21M|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  699|  1.21M|                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.21M|                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.21M|                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.21M|                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.21M|                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.21M|                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.21M|                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.21M|                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.21M|                src_temp3_8x16b = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  719|  1.21M|                tmp_set_128i_2 = _mm_or_si128(tmp_set_128i_2, src_temp1_8x16b);
  720|  1.21M|                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.21M|                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.21M|                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.21M|                src_temp0_8x16b = _mm_and_si128(src_temp0_8x16b, src_temp1_8x16b);
  729|  1.21M|                src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, src_temp3_8x16b);
  730|       |
  731|       |                //indexing 0 - 15 bandtable indexes
  732|  1.21M|                tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_16x8b, tmp_set_128i_1); //U low
  733|  1.21M|                tmp_set_128i_3 = _mm_shuffle_epi8(band_table1_16x8b, tmp_set_128i_3); //V low
  734|       |                //indexing 16 -31 bandtable indexes
  735|  1.21M|                tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_16x8b, tmp_set_128i_2); //U high
  736|  1.21M|                tmp_set_128i_4 = _mm_shuffle_epi8(band_table3_16x8b, tmp_set_128i_4); //V high
  737|       |                // combining all offsets results
  738|  1.21M|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2); //U
  739|  1.21M|                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.21M|                src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  742|  1.21M|                src_temp2_8x16b = _mm_or_si128(src_temp2_8x16b, tmp_set_128i_3);
  743|       |                //reorganising even and odd values
  744|  1.21M|                src_temp1_8x16b = _mm_unpacklo_epi8(src_temp0_8x16b, src_temp2_8x16b);
  745|  1.21M|                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.21M|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp1_8x16b);
  750|       |                // row = 1
  751|  1.21M|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp3_8x16b);
  752|       |
  753|       |
  754|  1.21M|                pu1_src_cpy += (src_strd << 1);
  755|       |
  756|  1.21M|            }
  757|   155k|            pu1_src += 16;
  758|   155k|        }
  759|       |
  760|  95.4k|        wd_rem = wd & 0xF;
  761|  95.4k|        if(wd_rem)
  ------------------
  |  Branch (761:12): [True: 5.01k, False: 90.4k]
  ------------------
  762|  5.01k|        {
  763|  5.01k|            pu1_src_cpy = pu1_src;
  764|  17.1k|            for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (764:27): [True: 12.0k, False: 5.01k]
  ------------------
  765|  12.0k|            {
  766|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  767|  12.0k|                src_temp0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
  768|       |                // row = 1
  769|  12.0k|                src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
  770|       |                // row = 2
  771|  12.0k|                src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
  772|       |                // row = 3
  773|  12.0k|                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.0k|                src_temp0_8x16b = _mm_unpacklo_epi64(src_temp0_8x16b, src_temp1_8x16b);
  777|  12.0k|                src_temp3_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp3_8x16b);
  778|       |                //odd values
  779|  12.0k|                src_temp1_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  780|  12.0k|                src_temp2_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  781|       |                //even values
  782|  12.0k|                src_temp0_8x16b = _mm_slli_epi16(src_temp0_8x16b, 8);
  783|  12.0k|                src_temp3_8x16b = _mm_slli_epi16(src_temp3_8x16b, 8);
  784|  12.0k|                src_temp0_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  785|  12.0k|                src_temp3_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  786|       |                //combining odd values
  787|  12.0k|                src_temp2_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp2_8x16b);
  788|       |                //combining even values
  789|  12.0k|                src_temp0_8x16b = _mm_packus_epi16(src_temp0_8x16b, src_temp3_8x16b);
  790|       |
  791|       |                //saturated substract 8 bit
  792|  12.0k|                tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_u_16x8b);
  793|  12.0k|                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.0k|                tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  796|  12.0k|                tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  797|  12.0k|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  798|  12.0k|                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.0k|                tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_msk2);
  801|  12.0k|                tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_msk2);
  802|  12.0k|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  803|  12.0k|                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.0k|                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.0k|                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.0k|                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.0k|                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.0k|                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.0k|                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.0k|                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.0k|                src_temp3_8x16b = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  823|  12.0k|                tmp_set_128i_2 = _mm_or_si128(tmp_set_128i_2, src_temp1_8x16b);
  824|  12.0k|                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.0k|                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.0k|                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.0k|                src_temp0_8x16b = _mm_and_si128(src_temp0_8x16b, src_temp1_8x16b);
  833|  12.0k|                src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, src_temp3_8x16b);
  834|       |
  835|       |                //indexing 0 - 15 bandtable indexes
  836|  12.0k|                tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_16x8b, tmp_set_128i_1); //U low
  837|  12.0k|                tmp_set_128i_3 = _mm_shuffle_epi8(band_table1_16x8b, tmp_set_128i_3); //V low
  838|       |                //indexing 16 -31 bandtable indexes
  839|  12.0k|                tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_16x8b, tmp_set_128i_2); //U high
  840|  12.0k|                tmp_set_128i_4 = _mm_shuffle_epi8(band_table3_16x8b, tmp_set_128i_4); //V high
  841|       |                // combining all offsets results
  842|  12.0k|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2); //U
  843|  12.0k|                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.0k|                src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  846|  12.0k|                src_temp2_8x16b = _mm_or_si128(src_temp2_8x16b, tmp_set_128i_3);
  847|       |                //reorganising even and odd values
  848|  12.0k|                src_temp1_8x16b = _mm_unpacklo_epi8(src_temp0_8x16b, src_temp2_8x16b);
  849|  12.0k|                src_temp3_8x16b = _mm_unpackhi_epi8(src_temp0_8x16b, src_temp2_8x16b);
  850|       |                //Getting row1 separately
  851|  12.0k|                src_temp0_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
  852|       |                //Getting row3 separately
  853|  12.0k|                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.0k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp1_8x16b);
  857|       |                // row = 1
  858|  12.0k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), src_temp0_8x16b);
  859|       |                // row = 2
  860|  12.0k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp3_8x16b);
  861|       |                // row = 3
  862|  12.0k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), src_temp2_8x16b);
  863|       |
  864|  12.0k|                pu1_src_cpy += (src_strd << 2);
  865|       |
  866|  12.0k|            }
  867|  5.01k|            pu1_src += 16;
  868|  5.01k|        }
  869|       |
  870|       |
  871|  95.4k|    }
  872|  95.4k|}
ihevc_sao_edge_offset_class0_ssse3:
  887|  41.0k|{
  888|  41.0k|    WORD32 row, col;
  889|  41.0k|    UWORD8 *pu1_src_cpy, *pu1_src_left_cpy, *pu1_src_left_str, *pu1_left_tmp;
  890|  41.0k|    UWORD8 au1_mask[MAX_CTB_SIZE], *au1_mask_cpy;
  891|  41.0k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE + 8];
  892|  41.0k|    UWORD8 au1_src_left_tmp1[MAX_CTB_SIZE + 8];
  893|  41.0k|    UWORD8 u1_avail0, u1_avail1;
  894|  41.0k|    WORD32 wd_rem;
  895|  41.0k|    WORD32 offset = 0;
  896|  41.0k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
  897|  41.0k|    __m128i left0_16x8b, left1_16x8b;
  898|  41.0k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b, cmp_gt1_16x8b, cmp_lt1_16x8b;
  899|  41.0k|    __m128i edge0_16x8b, edge1_16x8b;
  900|  41.0k|    __m128i au1_mask8x16b;
  901|  41.0k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
  902|  41.0k|    __m128i const2_16x8b, const0_16x8b;
  903|  41.0k|    __m128i left_store_16x8b;
  904|  41.0k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  41.0k|#define UNUSED(x) ((void)(x))
  ------------------
  905|  41.0k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  41.0k|#define UNUSED(x) ((void)(x))
  ------------------
  906|       |
  907|  41.0k|    au1_mask8x16b = _mm_set1_epi8(0xff);
  908|       |
  909|       |    /* Update  top and top-left arrays */
  910|       |
  911|  41.0k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  912|       |
  913|  88.3k|    for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (913:19): [True: 47.2k, False: 41.0k]
  ------------------
  914|  47.2k|    {
  915|  47.2k|        const0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + offset + (ht - 1) * src_strd));
  916|  47.2k|        _mm_storeu_si128((__m128i *)(pu1_src_top + offset), const0_16x8b);
  917|  47.2k|        offset += 16;
  918|  47.2k|    }
  919|       |
  920|       |    //setting availability mask to ff size MAX_CTB_SIZE
  921|   205k|    for(col = 0; col < MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   205k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (921:18): [True: 164k, False: 41.0k]
  ------------------
  922|   164k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
  923|  1.09M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (923:18): [True: 1.05M, False: 41.0k]
  ------------------
  924|  1.05M|    {
  925|  1.05M|        au1_src_left_tmp[row] = pu1_src_left[row];
  926|  1.05M|    }
  927|  41.0k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
  928|  41.0k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
  929|       |
  930|       |    //availability mask creation
  931|  41.0k|    u1_avail0 = pu1_avail[0];
  932|  41.0k|    u1_avail1 = pu1_avail[1];
  933|  41.0k|    au1_mask[0] = u1_avail0;
  934|  41.0k|    au1_mask[wd - 1] = u1_avail1;
  935|       |
  936|  41.0k|    const2_16x8b = _mm_set1_epi8(2);
  937|  41.0k|    const0_16x8b = _mm_setzero_si128();
  938|  41.0k|    pu1_src_left_cpy = au1_src_left_tmp;
  939|  41.0k|    pu1_src_left_str = au1_src_left_tmp1;
  940|  41.0k|    {
  941|  41.0k|        au1_mask_cpy = au1_mask;
  942|  88.3k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (942:23): [True: 47.2k, False: 41.0k]
  ------------------
  943|  47.2k|        {
  944|  47.2k|            pu1_src_cpy = pu1_src;
  945|  47.2k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
  946|       |            //pu1_src_left_cpy =au1_src_left_tmp;
  947|   754k|            for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (947:27): [True: 707k, False: 47.2k]
  ------------------
  948|   707k|            {
  949|       |
  950|   707k|                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|   707k|                src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
  953|       |                // row = 1
  954|   707k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
  955|       |
  956|   707k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 2);
  957|       |                //row 1 left
  958|   707k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 15);
  959|   707k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 15);
  960|       |                //row 0 left
  961|   707k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 15);
  962|   707k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
  963|       |
  964|       |
  965|       |                //separating +ve and and -ve values.
  966|   707k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
  967|   707k|                cmp_lt0_16x8b = _mm_subs_epu8(left0_16x8b, src_temp0_16x8b);
  968|   707k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
  969|   707k|                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|   707k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
  972|   707k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
  973|   707k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
  974|   707k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
  975|       |                //combining the appropriate sign change
  976|   707k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
  977|   707k|                left1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
  978|       |
  979|       |                //row = 0 right
  980|   707k|                edge0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 1));
  981|       |                // row = 1 right
  982|   707k|                edge1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 1));
  983|       |                //separating +ve and and -ve values.
  984|   707k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
  985|   707k|                cmp_lt0_16x8b = _mm_subs_epu8(edge0_16x8b, src_temp0_16x8b);
  986|   707k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
  987|   707k|                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|   707k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
  990|   707k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
  991|   707k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
  992|   707k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
  993|       |                //combining the appropriate sign change
  994|   707k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
  995|   707k|                edge1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
  996|       |
  997|       |                //combining sign-left and sign_right
  998|   707k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
  999|   707k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1000|       |                //adding constant 2
 1001|   707k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1002|   707k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1003|       |                //shuffle to get sao index
 1004|   707k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1005|   707k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1006|       |                //using availability mask
 1007|   707k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1008|   707k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1009|       |
 1010|       |                //shuffle to get sao offset
 1011|   707k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1012|   707k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1013|       |                //cnvert to 16 bit then add and then saturated pack
 1014|   707k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1015|   707k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1016|   707k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1017|   707k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1018|   707k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1019|   707k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1020|   707k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1021|   707k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1022|       |
 1023|   707k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1024|   707k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1025|   707k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1026|   707k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1027|   707k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1028|   707k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1029|   707k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1030|   707k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1031|       |
 1032|       |
 1033|   707k|                _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|   707k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1036|       |                // row = 1
 1037|   707k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 1038|       |
 1039|   707k|                pu1_src_cpy += (src_strd << 1);
 1040|   707k|                pu1_src_left_cpy += 2;
 1041|   707k|                pu1_src_left_str += 2;
 1042|   707k|            }
 1043|  47.2k|            au1_mask_cpy += 16;
 1044|  47.2k|            pu1_src += 16;
 1045|  47.2k|            pu1_src_left_cpy -= ht;
 1046|  47.2k|            pu1_src_left_str -= ht;
 1047|       |
 1048|  47.2k|            pu1_left_tmp = pu1_src_left_cpy;
 1049|  47.2k|            pu1_src_left_cpy = pu1_src_left_str;
 1050|  47.2k|            pu1_src_left_str = pu1_left_tmp;
 1051|  47.2k|        }
 1052|       |
 1053|  41.0k|        wd_rem = wd & 0xF;
 1054|  41.0k|        if(wd_rem)
  ------------------
  |  Branch (1054:12): [True: 39.2k, False: 1.81k]
  ------------------
 1055|  39.2k|        {
 1056|       |
 1057|  39.2k|            cmp_gt1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + (ht - 1) * src_strd));
 1058|  39.2k|            _mm_storel_epi64((__m128i *)(pu1_src_top + offset), cmp_gt1_16x8b);
 1059|       |
 1060|  39.2k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy);
 1061|  39.2k|            pu1_src_cpy = pu1_src;
 1062|  39.2k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 1063|       |            //pu1_src_left_cpy =au1_src_left_tmp;
 1064|   294k|            for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (1064:27): [True: 254k, False: 39.2k]
  ------------------
 1065|   254k|            {
 1066|   254k|                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|   254k|                src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 1069|       |                // row = 1
 1070|   254k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1071|       |                // row  = 2
 1072|   254k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 1073|       |                // row = 3
 1074|   254k|                cmp_gt1_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 1075|       |
 1076|       |
 1077|   254k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 4);
 1078|       |                //row 3 left
 1079|   254k|                edge0_16x8b = _mm_slli_si128(cmp_gt1_16x8b, 8);
 1080|   254k|                cmp_lt1_16x8b = _mm_alignr_epi8(cmp_gt1_16x8b, left_store_16x8b, 15);
 1081|   254k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1082|       |                //row 2 left
 1083|   254k|                edge0_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 1084|   254k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 15);
 1085|   254k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1086|       |                //row 1 left
 1087|   254k|                edge0_16x8b = _mm_slli_si128(cmp_gt0_16x8b, 8);
 1088|   254k|                cmp_lt0_16x8b = _mm_alignr_epi8(cmp_gt0_16x8b, left_store_16x8b, 15);
 1089|   254k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1090|       |                //row 0 left
 1091|   254k|                edge0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 1092|   254k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 15);
 1093|   254k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1094|       |
 1095|       |                // packing rows together for 16 SIMD operations
 1096|   254k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, cmp_gt0_16x8b);
 1097|   254k|                src_temp1_16x8b = _mm_unpacklo_epi64(src_temp1_16x8b, cmp_gt1_16x8b);
 1098|       |                // packing rows together for 16 SIMD operations
 1099|   254k|                left0_16x8b = _mm_unpacklo_epi64(left0_16x8b, cmp_lt0_16x8b);
 1100|   254k|                left1_16x8b = _mm_unpacklo_epi64(left1_16x8b, cmp_lt1_16x8b);
 1101|       |
 1102|       |                //separating +ve and and -ve values.
 1103|   254k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
 1104|   254k|                cmp_lt0_16x8b = _mm_subs_epu8(left0_16x8b, src_temp0_16x8b);
 1105|   254k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
 1106|   254k|                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|   254k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1109|   254k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1110|   254k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
 1111|   254k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
 1112|       |                //combining the appropriate sign change
 1113|   254k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1114|   254k|                left1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
 1115|       |
 1116|       |                //row = 0 right
 1117|   254k|                edge0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 1));
 1118|       |                // row = 1 right
 1119|   254k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd + 1));
 1120|       |                // row = 2 right
 1121|   254k|                edge1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd + 1));
 1122|       |                // row = 3 right
 1123|   254k|                cmp_gt1_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd + 1));
 1124|       |                // packing rows together for 16 SIMD operations
 1125|   254k|                edge0_16x8b = _mm_unpacklo_epi64(edge0_16x8b, cmp_gt0_16x8b);
 1126|   254k|                edge1_16x8b = _mm_unpacklo_epi64(edge1_16x8b, cmp_gt1_16x8b);
 1127|       |
 1128|       |                //separating +ve and and -ve values.
 1129|   254k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
 1130|   254k|                cmp_lt0_16x8b = _mm_subs_epu8(edge0_16x8b, src_temp0_16x8b);
 1131|   254k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
 1132|   254k|                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|   254k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1135|   254k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1136|   254k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
 1137|   254k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
 1138|       |                //combining the appropriate sign change
 1139|   254k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1140|   254k|                edge1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
 1141|       |
 1142|       |                //combining sign-left and sign_right
 1143|   254k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
 1144|   254k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1145|       |                //adding constant 2
 1146|   254k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1147|   254k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1148|       |                //shuffle to get sao index
 1149|   254k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1150|   254k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1151|       |                //shuffle to get sao offset
 1152|       |                //using availability mask
 1153|   254k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1154|   254k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1155|       |
 1156|   254k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1157|   254k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1158|       |                //cnvert to 16 bit then add and then saturated pack
 1159|   254k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1160|   254k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1161|   254k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1162|   254k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1163|   254k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1164|   254k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1165|   254k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1166|   254k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1167|       |
 1168|   254k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1169|   254k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1170|   254k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1171|   254k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1172|   254k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1173|   254k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1174|   254k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1175|   254k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1176|       |                //separting row 1 and row 3
 1177|   254k|                cmp_lt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 1178|   254k|                cmp_lt1_16x8b = _mm_srli_si128(src_temp1_16x8b, 8);
 1179|       |
 1180|   254k|                _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|   254k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1183|       |                // row = 1
 1184|   254k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_lt0_16x8b);
 1185|       |                // row = 2
 1186|   254k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp1_16x8b);
 1187|       |                // row = 3
 1188|   254k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt1_16x8b);
 1189|       |
 1190|   254k|                pu1_src_cpy += (src_strd << 2);
 1191|   254k|                pu1_src_left_cpy += 4;
 1192|   254k|                pu1_src_left_str += 4;
 1193|   254k|            }
 1194|  39.2k|            pu1_src += wd;
 1195|  39.2k|            pu1_src_left_cpy -= ht;
 1196|  39.2k|            pu1_src_left_str -= ht;
 1197|       |
 1198|  39.2k|            pu1_left_tmp = pu1_src_left_cpy;
 1199|  39.2k|            pu1_src_left_cpy = pu1_src_left_str;
 1200|  39.2k|            pu1_src_left_str = pu1_left_tmp;
 1201|  39.2k|        }
 1202|  1.09M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1202:22): [True: 1.05M, False: 41.0k]
  ------------------
 1203|  1.05M|        {
 1204|  1.05M|            pu1_src_left[row] = pu1_src_left_cpy[row];
 1205|  1.05M|        }
 1206|  41.0k|    }
 1207|  41.0k|}
ihevc_sao_edge_offset_class0_chroma_ssse3:
 1222|  24.8k|{
 1223|  24.8k|    WORD32 row, col;
 1224|  24.8k|    UWORD8 *pu1_src_cpy, *pu1_src_left_cpy, *pu1_src_left_str, *pu1_left_tmp;
 1225|  24.8k|    UWORD8 au1_mask[2 *MAX_CTB_SIZE], *au1_mask_cpy;
 1226|  24.8k|    UWORD8 au1_src_left_tmp[2 * (MAX_CTB_SIZE + 8)];
 1227|  24.8k|    UWORD8 au1_src_left_tmp1[2 * (MAX_CTB_SIZE + 8)];
 1228|  24.8k|    UWORD8 u1_avail0, u1_avail1;
 1229|  24.8k|    WORD32 wd_rem;
 1230|  24.8k|    WORD32 offset = 0;
 1231|       |
 1232|  24.8k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 1233|  24.8k|    __m128i left0_16x8b, left1_16x8b;
 1234|  24.8k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 1235|  24.8k|    __m128i edge0_16x8b, edge1_16x8b;
 1236|  24.8k|    __m128i au1_mask8x16b;
 1237|  24.8k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 1238|  24.8k|    __m128i const2_16x8b, const0_16x8b;
 1239|  24.8k|    __m128i left_store_16x8b;
 1240|  24.8k|    __m128i chroma_offset_8x16b;
 1241|  24.8k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  24.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1242|  24.8k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  24.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1243|       |
 1244|  24.8k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 1245|       |
 1246|       |    /* Update  top and top-left arrays */
 1247|  24.8k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 1248|  24.8k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];;
 1249|       |
 1250|  60.9k|    for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (1250:19): [True: 36.0k, False: 24.8k]
  ------------------
 1251|  36.0k|    {
 1252|  36.0k|        const0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + offset + (ht - 1) * src_strd));
 1253|  36.0k|        _mm_storeu_si128((__m128i *)(pu1_src_top + offset), const0_16x8b);
 1254|  36.0k|        offset += 16;
 1255|  36.0k|    }
 1256|   622k|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1256:18): [True: 597k, False: 24.8k]
  ------------------
 1257|   597k|    {
 1258|   597k|        au1_src_left_tmp[row] = pu1_src_left[row];
 1259|   597k|    }
 1260|       |    //setting availability mask to ff size MAX_CTB_SIZE
 1261|   223k|    for(col = 0; col < 2 * MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   223k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (1261:18): [True: 199k, False: 24.8k]
  ------------------
 1262|   199k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 1263|       |
 1264|  24.8k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 1265|  24.8k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 1266|  24.8k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 1267|  24.8k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 1268|       |    //availability mask creation
 1269|  24.8k|    u1_avail0 = pu1_avail[0];
 1270|  24.8k|    u1_avail1 = pu1_avail[1];
 1271|  24.8k|    au1_mask[0] = u1_avail0;
 1272|  24.8k|    au1_mask[1] = u1_avail0;
 1273|  24.8k|    au1_mask[wd - 1] = u1_avail1;
 1274|  24.8k|    au1_mask[wd - 2] = u1_avail1;
 1275|  24.8k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 1276|  24.8k|    const2_16x8b = _mm_set1_epi8(2);
 1277|  24.8k|    const0_16x8b = _mm_setzero_si128();
 1278|       |
 1279|  24.8k|    {
 1280|  24.8k|        pu1_src_left_cpy = au1_src_left_tmp;
 1281|  24.8k|        pu1_src_left_str = au1_src_left_tmp1;
 1282|  24.8k|        au1_mask_cpy = au1_mask;
 1283|  60.9k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (1283:23): [True: 36.0k, False: 24.8k]
  ------------------
 1284|  36.0k|        {
 1285|  36.0k|            pu1_src_cpy = pu1_src;
 1286|  36.0k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 1287|       |
 1288|   285k|            for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (1288:27): [True: 249k, False: 36.0k]
  ------------------
 1289|   249k|            {
 1290|       |
 1291|   249k|                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|   249k|                src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 1294|       |                // row = 1
 1295|   249k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 1296|       |
 1297|   249k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 4);
 1298|       |                //row 1 left
 1299|   249k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 14);
 1300|   249k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 14);
 1301|       |                //row 0 left
 1302|   249k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 14);
 1303|   249k|                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|   249k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
 1308|   249k|                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|   249k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1311|   249k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1312|       |                //combining the appropriate sign change
 1313|   249k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1314|       |
 1315|       |                //separating +ve and and -ve values.row 1 left
 1316|   249k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
 1317|   249k|                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|   249k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1320|   249k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1321|       |                //combining the appropriate sign change
 1322|   249k|                left1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1323|       |
 1324|       |
 1325|       |                //row = 0 right
 1326|   249k|                edge0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2));
 1327|       |                // row = 1 right
 1328|   249k|                edge1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 2));
 1329|       |                //separating +ve and and -ve values.row 0 right
 1330|   249k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
 1331|   249k|                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|   249k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1334|   249k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1335|       |                //combining the appropriate sign change
 1336|   249k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1337|       |
 1338|       |                //separating +ve and and -ve values.row 1 right
 1339|   249k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
 1340|   249k|                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|   249k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1343|   249k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1344|       |                //combining the appropriate sign change
 1345|   249k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1346|       |
 1347|       |                //combining sign-left and sign_right
 1348|   249k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
 1349|   249k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1350|       |                //adding constant 2
 1351|   249k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1352|   249k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1353|       |                //shuffle to get sao index
 1354|   249k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1355|   249k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1356|       |                //using availability mask
 1357|   249k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1358|   249k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1359|       |                //adding chroma offset to access U and V
 1360|   249k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 1361|   249k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 1362|       |
 1363|       |                //shuffle to get sao offset
 1364|   249k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1365|   249k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1366|       |                //cnvert to 16 bit then add and then saturated pack
 1367|   249k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1368|   249k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1369|   249k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1370|   249k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1371|   249k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1372|   249k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1373|   249k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 1374|   249k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1375|       |
 1376|   249k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1377|   249k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1378|   249k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1379|   249k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1380|   249k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1381|   249k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1382|   249k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 1383|   249k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1384|       |
 1385|   249k|                _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|   249k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1388|       |                // row = 1
 1389|   249k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 1390|       |
 1391|   249k|                pu1_src_cpy += (src_strd << 1);
 1392|   249k|                pu1_src_left_cpy += 4;
 1393|   249k|                pu1_src_left_str += 4;
 1394|   249k|            }
 1395|  36.0k|            au1_mask_cpy += 16;
 1396|  36.0k|            pu1_src += 16;
 1397|  36.0k|            pu1_src_left_cpy -= 2 * ht;
 1398|  36.0k|            pu1_src_left_str -= 2 * ht;
 1399|       |
 1400|  36.0k|            pu1_left_tmp = pu1_src_left_cpy;
 1401|  36.0k|            pu1_src_left_cpy = pu1_src_left_str;
 1402|  36.0k|            pu1_src_left_str = pu1_left_tmp;
 1403|  36.0k|        }
 1404|       |
 1405|  24.8k|        wd_rem = wd & 0xF;
 1406|  24.8k|        if(wd_rem)
  ------------------
  |  Branch (1406:12): [True: 1.90k, False: 22.9k]
  ------------------
 1407|  1.90k|        {
 1408|       |
 1409|  1.90k|            cmp_gt0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + (ht - 1) * src_strd));
 1410|  1.90k|            _mm_storel_epi64((__m128i *)(pu1_src_top + offset), cmp_gt0_16x8b);
 1411|       |
 1412|  1.90k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy);
 1413|  1.90k|            pu1_src_cpy = pu1_src;
 1414|  1.90k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 1415|       |
 1416|  5.92k|            for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (1416:27): [True: 4.02k, False: 1.90k]
  ------------------
 1417|  4.02k|            {
 1418|  4.02k|                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.02k|                src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 1421|       |                // row = 1
 1422|  4.02k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1423|       |                // row  = 2
 1424|  4.02k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 1425|       |                // row = 3
 1426|  4.02k|                cmp_lt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 1427|       |
 1428|       |
 1429|  4.02k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 8);
 1430|       |                //row 3 left
 1431|  4.02k|                edge0_16x8b = _mm_slli_si128(cmp_lt0_16x8b, 8);
 1432|  4.02k|                left0_16x8b = _mm_alignr_epi8(cmp_lt0_16x8b, left_store_16x8b, 14);
 1433|  4.02k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1434|       |                //row 2 left
 1435|  4.02k|                edge0_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 1436|  4.02k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 14);
 1437|  4.02k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1438|       |
 1439|       |
 1440|       |                // packing rows together for 16 SIMD operations
 1441|  4.02k|                src_temp1_16x8b = _mm_unpacklo_epi64(src_temp1_16x8b, cmp_lt0_16x8b);
 1442|  4.02k|                left1_16x8b = _mm_unpacklo_epi64(left1_16x8b, left0_16x8b);
 1443|       |
 1444|       |                //row 1 left
 1445|  4.02k|                edge0_16x8b = _mm_slli_si128(cmp_gt0_16x8b, 8);
 1446|  4.02k|                edge1_16x8b = _mm_alignr_epi8(cmp_gt0_16x8b, left_store_16x8b, 14);
 1447|  4.02k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1448|       |                //row 0 left
 1449|  4.02k|                edge0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 1450|  4.02k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 14);
 1451|  4.02k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1452|       |                // packing rows together for 16 SIMD operations
 1453|  4.02k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, cmp_gt0_16x8b);
 1454|  4.02k|                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.02k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
 1458|  4.02k|                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.02k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1461|  4.02k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1462|       |                //combining the appropriate sign change
 1463|  4.02k|                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.02k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
 1471|  4.02k|                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.02k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1474|  4.02k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1475|       |                //combining the appropriate sign change
 1476|  4.02k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1477|       |
 1478|       |
 1479|       |                //row = 0 right
 1480|  4.02k|                edge0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2));
 1481|       |                // row = 1 right
 1482|  4.02k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd + 2));
 1483|       |                // row = 2 right
 1484|  4.02k|                edge1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd + 2));
 1485|       |                // row = 3 right
 1486|  4.02k|                cmp_lt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd + 2));
 1487|       |                // packing rows together for 16 SIMD operations
 1488|  4.02k|                edge0_16x8b = _mm_unpacklo_epi64(edge0_16x8b, cmp_gt0_16x8b);
 1489|  4.02k|                edge1_16x8b = _mm_unpacklo_epi64(edge1_16x8b, cmp_lt0_16x8b);
 1490|       |
 1491|       |                //separating +ve and and -ve values.
 1492|  4.02k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
 1493|  4.02k|                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.02k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1496|  4.02k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1497|       |                //combining the appropriate sign change
 1498|  4.02k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1499|       |
 1500|  4.02k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
 1501|  4.02k|                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.02k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1504|  4.02k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1505|       |                //combining the appropriate sign change
 1506|  4.02k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1507|       |
 1508|       |                //combining sign-left and sign_right
 1509|  4.02k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
 1510|  4.02k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1511|       |                //adding constant 2
 1512|  4.02k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1513|  4.02k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1514|       |                //shuffle to get sao index
 1515|  4.02k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1516|  4.02k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1517|       |                //shuffle to get sao offset
 1518|       |                //using availability mask
 1519|  4.02k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1520|  4.02k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1521|       |                //adding chroma offset to access U and V
 1522|  4.02k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 1523|  4.02k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 1524|       |
 1525|  4.02k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1526|  4.02k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1527|       |                //cnvert to 16 bit then add and then saturated pack
 1528|  4.02k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1529|  4.02k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1530|  4.02k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1531|  4.02k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1532|  4.02k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1533|  4.02k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1534|  4.02k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 1535|  4.02k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1536|       |
 1537|  4.02k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1538|  4.02k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1539|  4.02k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1540|  4.02k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1541|  4.02k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1542|  4.02k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1543|  4.02k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 1544|  4.02k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1545|       |
 1546|       |                //seaprting row 1 and row 3
 1547|  4.02k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 1548|  4.02k|                cmp_lt0_16x8b = _mm_srli_si128(src_temp1_16x8b, 8);
 1549|       |
 1550|  4.02k|                _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.02k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1553|       |                // row = 1
 1554|  4.02k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 1555|       |                // row = 2
 1556|  4.02k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp1_16x8b);
 1557|       |                // row = 3
 1558|  4.02k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 1559|       |
 1560|  4.02k|                pu1_src_cpy += (src_strd << 2);
 1561|  4.02k|                pu1_src_left_cpy += 8;
 1562|  4.02k|                pu1_src_left_str += 8;
 1563|  4.02k|            }
 1564|  1.90k|            pu1_src += wd;
 1565|  1.90k|            pu1_src_left_cpy -= 2 * ht;
 1566|  1.90k|            pu1_src_left_str -= 2 * ht;
 1567|       |
 1568|  1.90k|            pu1_left_tmp = pu1_src_left_cpy;
 1569|  1.90k|            pu1_src_left_cpy = pu1_src_left_str;
 1570|  1.90k|            pu1_src_left_str = pu1_left_tmp;
 1571|  1.90k|        }
 1572|   623k|        for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1572:22): [True: 598k, False: 24.8k]
  ------------------
 1573|   598k|        {
 1574|   598k|            pu1_src_left[row] = pu1_src_left_cpy[row];
 1575|   598k|        }
 1576|  24.8k|    }
 1577|       |
 1578|  24.8k|}
ihevc_sao_edge_offset_class1_ssse3:
 1592|  37.2k|{
 1593|  37.2k|    WORD32 row, col;
 1594|  37.2k|    UWORD8 *pu1_src_top_cpy;
 1595|  37.2k|    UWORD8 *pu1_src_cpy;
 1596|  37.2k|    WORD32 wd_rem;
 1597|       |
 1598|       |
 1599|  37.2k|    __m128i src_top_16x8b, src_bottom_16x8b;
 1600|  37.2k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 1601|  37.2k|    __m128i signup0_16x8b, signdwn1_16x8b;
 1602|  37.2k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 1603|  37.2k|    __m128i edge0_16x8b, edge1_16x8b;
 1604|  37.2k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 1605|  37.2k|    __m128i const2_16x8b, const0_16x8b;
 1606|       |
 1607|  37.2k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  37.2k|#define UNUSED(x) ((void)(x))
  ------------------
 1608|  37.2k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  37.2k|#define UNUSED(x) ((void)(x))
  ------------------
 1609|       |
 1610|       |
 1611|       |    /* Updating left and top-left  */
 1612|   913k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1612:18): [True: 876k, False: 37.2k]
  ------------------
 1613|   876k|    {
 1614|   876k|        pu1_src_left[row] = pu1_src[row * src_strd + (wd - 1)];
 1615|   876k|    }
 1616|  37.2k|    *pu1_src_top_left = pu1_src_top[wd - 1];
 1617|       |
 1618|       |
 1619|       |
 1620|  37.2k|    pu1_src_top_cpy = pu1_src_top;
 1621|  37.2k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 1622|  37.2k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
 1623|       |
 1624|       |    /* Update height and source pointers based on the availability flags */
 1625|  37.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1625:8): [True: 6.24k, False: 30.9k]
  ------------------
 1626|  6.24k|    {
 1627|  6.24k|        pu1_src_top_cpy = pu1_src;
 1628|  6.24k|        pu1_src += src_strd;
 1629|  6.24k|        ht--;
 1630|  6.24k|    }
 1631|  37.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1631:8): [True: 4.53k, False: 32.7k]
  ------------------
 1632|  4.53k|    {
 1633|  4.53k|        ht--;
 1634|  4.53k|    }
 1635|       |
 1636|  37.2k|    const2_16x8b = _mm_set1_epi8(2);
 1637|  37.2k|    const0_16x8b = _mm_setzero_si128();
 1638|       |
 1639|  37.2k|    {
 1640|  37.2k|        WORD32 ht_rem;
 1641|  75.1k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (1641:23): [True: 37.9k, False: 37.2k]
  ------------------
 1642|  37.9k|        {
 1643|  37.9k|            pu1_src_cpy = pu1_src;
 1644|  37.9k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 1645|       |            //row = 0
 1646|  37.9k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 1647|       |            //separating +ve and and -ve values.
 1648|  37.9k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 1649|  37.9k|            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|  37.9k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1652|  37.9k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1653|       |            //combining the appropriate sign change
 1654|  37.9k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1655|       |
 1656|   596k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (1656:27): [True: 558k, False: 37.9k]
  ------------------
 1657|   558k|            {
 1658|       |
 1659|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1660|   558k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 1661|       |                // row = 2
 1662|   558k|                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|   558k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 1668|   558k|                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|   558k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1671|   558k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1672|       |                //combining the appropriate sign change
 1673|   558k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1674|       |                //row1-row0
 1675|   558k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1676|       |
 1677|       |                //row1 -bottom
 1678|   558k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 1679|   558k|                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|   558k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1682|   558k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1683|       |                //combining the appropriate sign change
 1684|   558k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1685|       |
 1686|       |                //combining sign-left and sign_right
 1687|   558k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 1688|   558k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 1689|       |
 1690|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 1691|   558k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1692|       |                //adding constant 2
 1693|   558k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1694|   558k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1695|       |                //shuffle to get sao index
 1696|   558k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1697|   558k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1698|       |                //shuffle to get sao offset
 1699|   558k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1700|   558k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1701|       |                //copying the next top
 1702|   558k|                src_top_16x8b = src_temp1_16x8b;
 1703|       |                //cnvert to 16 bit then add and then saturated pack
 1704|   558k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1705|   558k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1706|   558k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1707|   558k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1708|   558k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1709|   558k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1710|   558k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1711|   558k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1712|       |
 1713|   558k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1714|   558k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1715|   558k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 1716|   558k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1717|   558k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1718|   558k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 1719|   558k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1720|   558k|                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|   558k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1724|       |                // row = 1
 1725|   558k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 1726|       |
 1727|   558k|                src_temp0_16x8b = src_bottom_16x8b;
 1728|   558k|                pu1_src_cpy += (src_strd << 1);
 1729|   558k|            }
 1730|  37.9k|            ht_rem = ht & 0x1;
 1731|       |
 1732|  37.9k|            if(ht_rem)
  ------------------
  |  Branch (1732:16): [True: 9.11k, False: 28.7k]
  ------------------
 1733|  9.11k|            {
 1734|  9.11k|                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|  9.11k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 1738|  9.11k|                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|  9.11k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1741|  9.11k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1742|       |                //combining the appropriate sign change
 1743|  9.11k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1744|       |                //adding top and botton and constant 2
 1745|  9.11k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 1746|  9.11k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1747|       |
 1748|  9.11k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1749|  9.11k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1750|       |                //copying the next top
 1751|  9.11k|                src_top_16x8b = src_temp0_16x8b;
 1752|       |                //cnvert to 16 bit then add and then saturated pack
 1753|  9.11k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1754|  9.11k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1755|  9.11k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1756|  9.11k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1757|  9.11k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1758|  9.11k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1759|  9.11k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1760|  9.11k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1761|       |
 1762|  9.11k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1763|  9.11k|            }
 1764|  37.9k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (1764:16): [True: 4.30k, False: 33.6k]
  ------------------
 1765|  4.30k|            {
 1766|  4.30k|                src_top_16x8b = src_bottom_16x8b;
 1767|  4.30k|            }
 1768|       |            //updating top flag
 1769|  37.9k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 1770|  37.9k|            pu1_src += 16;
 1771|  37.9k|        }
 1772|       |
 1773|  37.2k|        wd_rem = wd & 0xF;
 1774|  37.2k|        if(wd_rem)
  ------------------
  |  Branch (1774:12): [True: 35.8k, False: 1.37k]
  ------------------
 1775|  35.8k|        {
 1776|  35.8k|            pu1_src_cpy = pu1_src;
 1777|  35.8k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 1778|       |            //row = 0
 1779|  35.8k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 1780|       |            //separating +ve and and -ve values.
 1781|  35.8k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 1782|  35.8k|            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|  35.8k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1785|  35.8k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1786|       |            //combining the appropriate sign change
 1787|  35.8k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1788|  35.8k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 1789|   237k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (1789:27): [True: 201k, False: 35.8k]
  ------------------
 1790|   201k|            {
 1791|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1792|   201k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1793|       |                // row = 2
 1794|   201k|                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|   201k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 1799|   201k|                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|   201k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1802|   201k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1803|       |                //combining the appropriate sign change
 1804|   201k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1805|       |
 1806|       |                //row1-row0
 1807|   201k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1808|   201k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 1809|   201k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 1810|       |                //row1 -row2
 1811|   201k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 1812|   201k|                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|   201k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1815|   201k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1816|       |                //combining the appropriate sign change
 1817|   201k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 1818|   201k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 1819|       |                //packing row 0 n row 1
 1820|   201k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 1821|       |                //row = 3
 1822|   201k|                src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 1823|       |                // row = 4
 1824|   201k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 4 * src_strd));
 1825|       |
 1826|   201k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 1827|   201k|                signdwn1_16x8b = _mm_slli_si128(signdwn1_16x8b, 8); //allign left (1-2)
 1828|       |                //separating +ve and and -ve values.(2,3)
 1829|   201k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_top_16x8b);
 1830|   201k|                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|   201k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1833|   201k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1834|       |                //combining the appropriate sign change
 1835|   201k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 1836|       |
 1837|   201k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signdwn1_16x8b, 8); //(2-3) ,(1-2) (substract with down)
 1838|   201k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8);
 1839|       |                //separating +ve and and -ve values.(3,4)
 1840|   201k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp1_16x8b);
 1841|   201k|                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|   201k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1844|   201k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1845|   201k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-4)
 1846|       |                //combining sign-left and sign_right
 1847|   201k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-4),(2-3)
 1848|       |
 1849|   201k|                edge1_16x8b = _mm_sub_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 1850|       |
 1851|       |                //packing row 2 n row 3
 1852|   201k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 1853|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 1854|   201k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(4-3)
 1855|       |
 1856|       |                //adding constant 2
 1857|   201k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1858|   201k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1859|       |                //shuffle to get sao index
 1860|   201k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1861|   201k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1862|       |                //shuffle to get sao offset
 1863|   201k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1864|   201k|                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|   201k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1869|   201k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1870|   201k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1871|   201k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1872|   201k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1873|   201k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1874|   201k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1875|   201k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1876|       |
 1877|   201k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1878|   201k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 1879|   201k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 1880|   201k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 1881|   201k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1882|   201k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 1883|   201k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, cmp_lt0_16x8b);
 1884|   201k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 1885|       |
 1886|   201k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 1887|   201k|                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|   201k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1890|       |                // row = 1
 1891|   201k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 1892|       |                //row = 2
 1893|   201k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 1894|       |                // row = 3
 1895|   201k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 1896|       |
 1897|   201k|                src_temp0_16x8b = src_temp1_16x8b;
 1898|   201k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 1899|   201k|                pu1_src_cpy += (src_strd << 2);
 1900|       |
 1901|   201k|            }
 1902|  35.8k|            ht_rem = ht & 0x2;
 1903|  35.8k|            if(ht_rem)
  ------------------
  |  Branch (1903:16): [True: 10.1k, False: 25.7k]
  ------------------
 1904|  10.1k|            {
 1905|       |
 1906|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1907|  10.1k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1908|       |                // row = 2
 1909|  10.1k|                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|  10.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 1914|  10.1k|                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|  10.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1917|  10.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1918|       |                //combining the appropriate sign change
 1919|  10.1k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1920|       |                //row1-row0
 1921|  10.1k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1922|  10.1k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 1923|  10.1k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 1924|       |                //row1 -row2
 1925|  10.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 1926|  10.1k|                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|  10.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1929|  10.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1930|       |                //combining the appropriate sign change
 1931|  10.1k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 1932|  10.1k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 1933|       |                //adding top and down substraction
 1934|  10.1k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 1935|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 1936|  10.1k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(2-1) for next
 1937|  10.1k|                src_top_16x8b = src_temp1_16x8b;
 1938|       |                //adding constant 2
 1939|  10.1k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1940|       |
 1941|       |                //shuffle to get sao index
 1942|  10.1k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1943|       |
 1944|       |                //shuffle to get sao offset
 1945|  10.1k|                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|  10.1k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1950|  10.1k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1951|  10.1k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1952|  10.1k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1953|  10.1k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1954|  10.1k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1955|  10.1k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1956|  10.1k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 1957|       |
 1958|  10.1k|                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|  10.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1962|       |                // row = 1
 1963|  10.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 1964|  10.1k|                src_temp0_16x8b = src_bottom_16x8b;
 1965|  10.1k|                pu1_src_cpy += (src_strd << 1);
 1966|       |
 1967|  10.1k|            }
 1968|  35.8k|            ht_rem = ht & 0x1;
 1969|  35.8k|            if(ht_rem)
  ------------------
  |  Branch (1969:16): [True: 9.67k, False: 26.1k]
  ------------------
 1970|  9.67k|            {
 1971|       |
 1972|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1973|  9.67k|                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.67k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 1978|  9.67k|                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.67k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1981|  9.67k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1982|       |                //combining the appropriate sign change
 1983|  9.67k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1984|       |                //adding top and down substraction
 1985|  9.67k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 1986|       |                //adding constant 2
 1987|  9.67k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1988|  9.67k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 1989|  9.67k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 1990|       |                //shuffle to get sao index
 1991|  9.67k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1992|       |                //shuffle to get sao offset
 1993|  9.67k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1994|  9.67k|                src_top_16x8b = src_temp0_16x8b;
 1995|       |                //cnvert to 16 bit then add and then saturated pack
 1996|  9.67k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1997|  9.67k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1998|  9.67k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1999|  9.67k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2000|  9.67k|                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.67k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2003|  9.67k|                pu1_src_cpy += (src_strd);
 2004|       |
 2005|  9.67k|            }
 2006|  35.8k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2006:16): [True: 4.48k, False: 31.3k]
  ------------------
 2007|  4.48k|            {
 2008|  4.48k|                src_top_16x8b = src_bottom_16x8b;
 2009|  4.48k|            }
 2010|  35.8k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2011|  35.8k|            pu1_src += 8;
 2012|  35.8k|        }
 2013|  37.2k|    }
 2014|  37.2k|}
ihevc_sao_edge_offset_class1_chroma_ssse3:
 2028|  44.0k|{
 2029|  44.0k|    WORD32 row, col;
 2030|  44.0k|    UWORD8 *pu1_src_top_cpy;
 2031|  44.0k|    UWORD8 *pu1_src_cpy;
 2032|  44.0k|    WORD32 wd_rem;
 2033|       |
 2034|       |
 2035|  44.0k|    __m128i src_top_16x8b, src_bottom_16x8b;
 2036|  44.0k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 2037|  44.0k|    __m128i signup0_16x8b, signdwn1_16x8b;
 2038|  44.0k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 2039|  44.0k|    __m128i edge0_16x8b, edge1_16x8b;
 2040|  44.0k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 2041|  44.0k|    __m128i const2_16x8b, const0_16x8b;
 2042|  44.0k|    __m128i chroma_offset_8x16b;
 2043|       |
 2044|  44.0k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  44.0k|#define UNUSED(x) ((void)(x))
  ------------------
 2045|  44.0k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  44.0k|#define UNUSED(x) ((void)(x))
  ------------------
 2046|       |
 2047|       |    /* Updating left and top and top-left */
 2048|   584k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (2048:18): [True: 540k, False: 44.0k]
  ------------------
 2049|   540k|    {
 2050|   540k|        pu1_src_left[2 * row] = pu1_src[row * src_strd + (wd - 2)];
 2051|   540k|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + (wd - 1)];
 2052|   540k|    }
 2053|  44.0k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 2054|  44.0k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
 2055|       |
 2056|       |
 2057|       |
 2058|  44.0k|    pu1_src_top_cpy = pu1_src_top;
 2059|  44.0k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 2060|  44.0k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 2061|  44.0k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 2062|  44.0k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 2063|       |    /* Update height and source pointers based on the availability flags */
 2064|  44.0k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (2064:8): [True: 5.96k, False: 38.1k]
  ------------------
 2065|  5.96k|    {
 2066|  5.96k|        pu1_src_top_cpy = pu1_src;
 2067|  5.96k|        pu1_src += src_strd;
 2068|  5.96k|        ht--;
 2069|  5.96k|    }
 2070|  44.0k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (2070:8): [True: 4.64k, False: 39.4k]
  ------------------
 2071|  4.64k|    {
 2072|  4.64k|        ht--;
 2073|  4.64k|    }
 2074|  44.0k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 2075|  44.0k|    const2_16x8b = _mm_set1_epi8(2);
 2076|  44.0k|    const0_16x8b = _mm_setzero_si128();
 2077|       |
 2078|       |
 2079|  44.0k|    {
 2080|  44.0k|        WORD32 ht_rem;
 2081|       |
 2082|       |
 2083|       |
 2084|   110k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (2084:23): [True: 66.7k, False: 44.0k]
  ------------------
 2085|  66.7k|        {
 2086|  66.7k|            pu1_src_cpy = pu1_src;
 2087|  66.7k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 2088|       |            //row = 0
 2089|  66.7k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 2090|       |            //separating +ve and and -ve values.
 2091|  66.7k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2092|  66.7k|            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|  66.7k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2095|  66.7k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2096|       |            //combining the appropriate sign change
 2097|  66.7k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2098|       |
 2099|   509k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (2099:27): [True: 442k, False: 66.7k]
  ------------------
 2100|   442k|            {
 2101|       |
 2102|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2103|   442k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 2104|       |                // row = 2
 2105|   442k|                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|   442k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 2111|   442k|                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|   442k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2114|   442k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2115|       |                //combining the appropriate sign change
 2116|   442k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2117|       |                //row1-row0
 2118|   442k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2119|       |
 2120|       |                //row1 -bottom
 2121|   442k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2122|   442k|                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|   442k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2125|   442k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2126|       |                //combining the appropriate sign change
 2127|   442k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2128|       |
 2129|       |                //combining sign-left and sign_right
 2130|   442k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2131|   442k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 2132|       |
 2133|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 2134|   442k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2135|       |                //adding constant 2
 2136|   442k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2137|   442k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 2138|       |                //copying the next top
 2139|   442k|                src_top_16x8b = src_temp1_16x8b;
 2140|       |
 2141|       |
 2142|       |                //shuffle to get sao index
 2143|   442k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2144|   442k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 2145|       |                //adding chroma offset to access U and V
 2146|   442k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2147|   442k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 2148|       |
 2149|       |                //shuffle to get sao offset
 2150|   442k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2151|   442k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 2152|       |                //cnvert to 16 bit then add and then saturated pack
 2153|   442k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2154|   442k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2155|   442k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2156|   442k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2157|   442k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2158|   442k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2159|   442k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 2160|   442k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2161|       |
 2162|   442k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 2163|   442k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 2164|   442k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 2165|   442k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 2166|   442k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 2167|   442k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2168|   442k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 2169|   442k|                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|   442k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2172|       |                // row = 1
 2173|   442k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 2174|       |
 2175|   442k|                src_temp0_16x8b = src_bottom_16x8b;
 2176|   442k|                pu1_src_cpy += (src_strd << 1);
 2177|   442k|            }
 2178|  66.7k|            ht_rem = ht & 0x1;
 2179|       |
 2180|  66.7k|            if(ht_rem)
  ------------------
  |  Branch (2180:16): [True: 12.4k, False: 54.2k]
  ------------------
 2181|  12.4k|            {
 2182|  12.4k|                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|  12.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 2186|  12.4k|                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|  12.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2189|  12.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2190|       |                //combining the appropriate sign change
 2191|  12.4k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2192|       |                //adding top and botton and constant 2
 2193|  12.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2194|  12.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2195|       |                //copying the next top
 2196|  12.4k|                src_top_16x8b = src_temp0_16x8b;
 2197|       |
 2198|  12.4k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2199|       |                //adding chroma offset to access U and V
 2200|  12.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2201|  12.4k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2202|       |
 2203|       |                //cnvert to 16 bit then add and then saturated pack
 2204|  12.4k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2205|  12.4k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2206|  12.4k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2207|  12.4k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2208|  12.4k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2209|  12.4k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2210|  12.4k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 2211|  12.4k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2212|       |
 2213|  12.4k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2214|  12.4k|            }
 2215|  66.7k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2215:16): [True: 6.77k, False: 59.9k]
  ------------------
 2216|  6.77k|            {
 2217|  6.77k|                src_top_16x8b = src_bottom_16x8b;
 2218|  6.77k|            }
 2219|       |            //updating top flag
 2220|  66.7k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2221|  66.7k|            pu1_src += 16;
 2222|  66.7k|        }
 2223|       |
 2224|  44.0k|        wd_rem = wd & 0xF;
 2225|  44.0k|        if(wd_rem)
  ------------------
  |  Branch (2225:12): [True: 2.48k, False: 41.5k]
  ------------------
 2226|  2.48k|        {
 2227|  2.48k|            pu1_src_cpy = pu1_src;
 2228|  2.48k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 2229|       |            //row = 0
 2230|  2.48k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 2231|       |            //separating +ve and and -ve values.
 2232|  2.48k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2233|  2.48k|            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.48k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2236|  2.48k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2237|       |            //combining the appropriate sign change
 2238|  2.48k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2239|  2.48k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 2240|  6.92k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (2240:27): [True: 4.43k, False: 2.48k]
  ------------------
 2241|  4.43k|            {
 2242|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2243|  4.43k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 2244|       |                // row = 2
 2245|  4.43k|                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|  4.43k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 2250|  4.43k|                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|  4.43k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2253|  4.43k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2254|       |                //combining the appropriate sign change
 2255|  4.43k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2256|       |
 2257|       |                //row1-row0
 2258|  4.43k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2259|  4.43k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 2260|  4.43k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 2261|       |                //row1 -row2
 2262|  4.43k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2263|  4.43k|                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|  4.43k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2266|  4.43k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2267|       |                //combining the appropriate sign change
 2268|  4.43k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 2269|  4.43k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 2270|       |                //packing row 0 n row 1
 2271|  4.43k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 2272|       |                //row = 3
 2273|  4.43k|                src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 2274|       |                // row = 4
 2275|  4.43k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 4 * src_strd));
 2276|       |
 2277|  4.43k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 2278|  4.43k|                signdwn1_16x8b = _mm_slli_si128(signdwn1_16x8b, 8); //allign left (1-2)
 2279|       |                //separating +ve and and -ve values.(2,3)
 2280|  4.43k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_top_16x8b);
 2281|  4.43k|                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|  4.43k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2284|  4.43k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2285|       |                //combining the appropriate sign change
 2286|  4.43k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 2287|       |
 2288|  4.43k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signdwn1_16x8b, 8); //(2-3) ,(1-2) (substract with down)
 2289|  4.43k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8);
 2290|       |                //separating +ve and and -ve values.(3,4)
 2291|  4.43k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp1_16x8b);
 2292|  4.43k|                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|  4.43k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2295|  4.43k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2296|  4.43k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-4)
 2297|       |                //combining sign-left and sign_right
 2298|  4.43k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-4),(2-3)
 2299|       |
 2300|  4.43k|                edge1_16x8b = _mm_sub_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 2301|       |
 2302|       |                //packing row 2 n row 3
 2303|  4.43k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 2304|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 2305|  4.43k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(4-3)
 2306|       |                //adding constant 2
 2307|  4.43k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2308|  4.43k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 2309|       |                //shuffle to get sao index
 2310|  4.43k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2311|  4.43k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 2312|       |                //adding chroma offset to access U and V
 2313|  4.43k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2314|  4.43k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 2315|       |
 2316|       |                //shuffle to get sao offset
 2317|  4.43k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2318|  4.43k|                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|  4.43k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2322|  4.43k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2323|  4.43k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2324|  4.43k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2325|  4.43k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2326|  4.43k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2327|  4.43k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 2328|  4.43k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2329|       |
 2330|  4.43k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 2331|  4.43k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 2332|  4.43k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 2333|  4.43k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 2334|  4.43k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 2335|  4.43k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2336|  4.43k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, edge1_16x8b);
 2337|  4.43k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 2338|       |
 2339|  4.43k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 2340|  4.43k|                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|  4.43k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2343|       |                // row = 1
 2344|  4.43k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 2345|       |                //row = 2
 2346|  4.43k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 2347|       |                // row = 3
 2348|  4.43k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 2349|       |
 2350|  4.43k|                src_temp0_16x8b = src_temp1_16x8b;
 2351|  4.43k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 2352|  4.43k|                pu1_src_cpy += (src_strd << 2);
 2353|       |
 2354|  4.43k|            }
 2355|  2.48k|            ht_rem = ht & 0x2;
 2356|  2.48k|            if(ht_rem)
  ------------------
  |  Branch (2356:16): [True: 878, False: 1.61k]
  ------------------
 2357|    878|            {
 2358|       |
 2359|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2360|    878|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 2361|       |                // row = 2
 2362|    878|                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|    878|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 2367|    878|                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|    878|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2370|    878|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2371|       |                //combining the appropriate sign change
 2372|    878|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2373|       |                //row1-row0
 2374|    878|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2375|    878|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 2376|    878|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 2377|       |                //row1 -row2
 2378|    878|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2379|    878|                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|    878|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2382|    878|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2383|       |                //combining the appropriate sign change
 2384|    878|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 2385|    878|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 2386|       |                //adding top and down substraction
 2387|    878|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 2388|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 2389|    878|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(2-1) for next
 2390|    878|                src_top_16x8b = src_temp1_16x8b;
 2391|       |
 2392|       |                //adding constant 2
 2393|    878|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2394|       |
 2395|       |                //shuffle to get sao index
 2396|    878|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2397|       |
 2398|       |                //adding chroma offset to access U and V
 2399|    878|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2400|       |                //shuffle to get sao offset
 2401|    878|                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|    878|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2405|    878|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2406|    878|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2407|    878|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 2408|    878|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2409|    878|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2410|    878|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge0_16x8b);
 2411|    878|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 2412|       |
 2413|    878|                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|    878|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2417|       |                // row = 1
 2418|    878|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 2419|    878|                src_temp0_16x8b = src_bottom_16x8b;
 2420|    878|                pu1_src_cpy += (src_strd << 1);
 2421|       |
 2422|    878|            }
 2423|  2.48k|            ht_rem = ht & 0x1;
 2424|  2.48k|            if(ht_rem)
  ------------------
  |  Branch (2424:16): [True: 864, False: 1.62k]
  ------------------
 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.48k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2465:16): [True: 426, False: 2.06k]
  ------------------
 2466|    426|            {
 2467|    426|                src_top_16x8b = src_bottom_16x8b;
 2468|    426|            }
 2469|  2.48k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2470|  2.48k|            pu1_src += 8;
 2471|  2.48k|        }
 2472|  44.0k|    }
 2473|  44.0k|}
ihevc_sao_edge_offset_class2_ssse3:
 2487|  68.2k|{
 2488|  68.2k|    WORD32 row, col;
 2489|  68.2k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 2490|  68.2k|    UWORD8 *pu1_left_tmp, *pu1_src_left_str, *pu1_src_left_str2;
 2491|  68.2k|    UWORD8 *pu1_firstleft;
 2492|  68.2k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 2493|  68.2k|    UWORD8 au1_mask[MAX_CTB_SIZE], *au1_mask_cpy;
 2494|  68.2k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE + 8];
 2495|  68.2k|    UWORD8 au1_src_left_tmp1[MAX_CTB_SIZE + 8];
 2496|  68.2k|    WORD32 wd_rem;
 2497|  68.2k|    UWORD8 u1_pos_0_0_tmp, u1_pos_wd_ht_tmp;
 2498|  68.2k|    WORD32 ht_tmp, ht_0;
 2499|       |
 2500|  68.2k|    WORD32 bit_depth;
 2501|  68.2k|    UWORD8 u1_avail0, u1_avail1;
 2502|       |
 2503|  68.2k|    __m128i src_top_16x8b, src_bottom_16x8b;
 2504|  68.2k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 2505|  68.2k|    __m128i signup0_16x8b, signdwn1_16x8b;
 2506|  68.2k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 2507|  68.2k|    __m128i edge0_16x8b, edge1_16x8b;
 2508|  68.2k|    __m128i au1_mask8x16b;
 2509|  68.2k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 2510|  68.2k|    __m128i const2_16x8b, const0_16x8b;
 2511|  68.2k|    __m128i left_store_16x8b;
 2512|  68.2k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  68.2k|#define UNUSED(x) ((void)(x))
  ------------------
 2513|  68.2k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  68.2k|#define UNUSED(x) ((void)(x))
  ------------------
 2514|       |
 2515|  68.2k|    ht_0 = ht; ht_tmp = ht;
 2516|  68.2k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 2517|       |
 2518|       |    //setting availability mask to ff size MAX_CTB_SIZE
 2519|   341k|    for(col = 0; col < MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   341k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (2519:18): [True: 272k, False: 68.2k]
  ------------------
 2520|   272k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 2521|  1.49M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (2521:18): [True: 1.42M, False: 68.2k]
  ------------------
 2522|  1.42M|    {
 2523|  1.42M|        au1_src_left_tmp[row] = pu1_src_left[row];
 2524|  1.42M|    }
 2525|  68.2k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  68.2k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  68.2k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2526|  68.2k|    pu1_src_org = pu1_src;
 2527|  68.2k|    pu1_src_top_cpy = pu1_src_top;
 2528|  68.2k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 2529|  68.2k|    pu1_src_left_cpy = au1_src_left_tmp;
 2530|  68.2k|    pu1_src_left_str2 = au1_src_left_tmp1;
 2531|  68.2k|    pu1_src_left_str = au1_src_left_tmp1;
 2532|  68.2k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 2533|  68.2k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
 2534|       |
 2535|       |
 2536|       |    /* If top-left is available, process separately */
 2537|  68.2k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (2537:8): [True: 52.1k, False: 16.0k]
  ------------------
 2538|  52.1k|    {
 2539|  52.1k|        WORD8 edge_idx;
 2540|       |
 2541|  52.1k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  52.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 46.7k, False: 5.41k]
  |  |  |  Branch (44:34): [True: 5.90k, False: 40.8k]
  |  |  ------------------
  ------------------
 2542|  52.1k|                        SIGN(pu1_src[0] - pu1_src[1 + src_strd]);
  ------------------
  |  |   44|  52.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 47.7k, False: 4.41k]
  |  |  |  Branch (44:34): [True: 5.90k, False: 41.8k]
  |  |  ------------------
  ------------------
 2543|       |
 2544|  52.1k|        edge_idx = gi1_table_edge_idx[edge_idx];
 2545|       |
 2546|  52.1k|        if(0 != edge_idx)
  ------------------
  |  Branch (2546:12): [True: 10.2k, False: 41.9k]
  ------------------
 2547|  10.2k|        {
 2548|  10.2k|            u1_pos_0_0_tmp = CLIP3(pu1_src[0] + 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: 264, False: 9.94k]
  |  |  |  Branch (40:53): [True: 465, False: 9.48k]
  |  |  ------------------
  ------------------
 2549|  10.2k|        }
 2550|  41.9k|        else
 2551|  41.9k|        {
 2552|  41.9k|            u1_pos_0_0_tmp = pu1_src[0];
 2553|  41.9k|        }
 2554|  52.1k|    }
 2555|  16.0k|    else
 2556|  16.0k|    {
 2557|  16.0k|        u1_pos_0_0_tmp = pu1_src[0];
 2558|  16.0k|    }
 2559|       |
 2560|       |    /* If bottom-right is available, process separately */
 2561|  68.2k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (2561:8): [True: 56.7k, False: 11.4k]
  ------------------
 2562|  56.7k|    {
 2563|  56.7k|        WORD8 edge_idx;
 2564|       |
 2565|  56.7k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 1 - src_strd]) +
  ------------------
  |  |   44|  56.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 53.1k, False: 3.53k]
  |  |  |  Branch (44:34): [True: 4.40k, False: 48.7k]
  |  |  ------------------
  ------------------
 2566|  56.7k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 1 + src_strd]);
  ------------------
  |  |   44|  56.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 50.8k, False: 5.85k]
  |  |  |  Branch (44:34): [True: 6.67k, False: 44.1k]
  |  |  ------------------
  ------------------
 2567|       |
 2568|  56.7k|        edge_idx = gi1_table_edge_idx[edge_idx];
 2569|       |
 2570|  56.7k|        if(0 != edge_idx)
  ------------------
  |  Branch (2570:12): [True: 9.36k, False: 47.3k]
  ------------------
 2571|  9.36k|        {
 2572|  9.36k|            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.36k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 472, False: 8.89k]
  |  |  |  Branch (40:53): [True: 252, False: 8.63k]
  |  |  ------------------
  ------------------
 2573|  9.36k|        }
 2574|  47.3k|        else
 2575|  47.3k|        {
 2576|  47.3k|            u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
 2577|  47.3k|        }
 2578|  56.7k|    }
 2579|  11.4k|    else
 2580|  11.4k|    {
 2581|  11.4k|        u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
 2582|  11.4k|    }
 2583|  68.2k|    pu1_firstleft = pu1_src_top_left;
 2584|       |
 2585|       |    /* Update height and source pointers based on the availability flags */
 2586|  68.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (2586:8): [True: 9.37k, False: 58.8k]
  ------------------
 2587|  9.37k|    {
 2588|  9.37k|        pu1_firstleft = pu1_src_left_cpy2;
 2589|  9.37k|        pu1_src_left_cpy2++;
 2590|  9.37k|        pu1_src_left_str2++;
 2591|  9.37k|        pu1_src_top_cpy = pu1_src;
 2592|  9.37k|        pu1_src += src_strd;
 2593|  9.37k|        ht--;
 2594|  9.37k|    }
 2595|  68.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (2595:8): [True: 6.40k, False: 61.7k]
  ------------------
 2596|  6.40k|    {
 2597|  6.40k|        ht--;
 2598|  6.40k|        ht_0--;
 2599|  6.40k|    }
 2600|       |    //storing top left in a mmx register
 2601|  68.2k|    left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_firstleft);
 2602|  68.2k|    const2_16x8b = _mm_set1_epi8(2);
 2603|  68.2k|    const0_16x8b = _mm_setzero_si128();
 2604|  68.2k|    left_store_16x8b = _mm_slli_si128(left_store_16x8b, 15);
 2605|       |    //update top -left
 2606|  68.2k|    *pu1_src_top_left = pu1_src_top[wd - 1];
 2607|       |    //availability mask creation
 2608|  68.2k|    u1_avail0 = pu1_avail[0];
 2609|  68.2k|    u1_avail1 = pu1_avail[1];
 2610|  68.2k|    au1_mask[0] = u1_avail0;
 2611|  68.2k|    au1_mask[wd - 1] = u1_avail1;
 2612|  68.2k|    {
 2613|  68.2k|        WORD32 ht_rem;
 2614|       |
 2615|       |
 2616|  68.2k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 2617|  68.2k|        pu1_src_left_str = pu1_src_left_str2;
 2618|  68.2k|        au1_mask_cpy = au1_mask;
 2619|   124k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (2619:23): [True: 56.1k, False: 68.2k]
  ------------------
 2620|  56.1k|        {
 2621|  56.1k|            pu1_src_cpy = pu1_src;
 2622|  56.1k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 2623|       |            //row = 0
 2624|  56.1k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 2625|  56.1k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 15);
 2626|       |            //loading the mask
 2627|  56.1k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 2628|       |            //separating +ve and and -ve values.
 2629|  56.1k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2630|  56.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|  56.1k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2633|  56.1k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2634|       |            //combining the appropriate sign change
 2635|  56.1k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2636|       |
 2637|       |
 2638|   795k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (2638:27): [True: 739k, False: 56.1k]
  ------------------
 2639|   739k|            {
 2640|   739k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 2641|       |                //row = 1
 2642|   739k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 2643|       |                // row = 1 right
 2644|   739k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 1));
 2645|       |                //to insert left in row 0
 2646|   739k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 15);
 2647|       |                //row 0 -row1
 2648|       |                //separating +ve and and -ve values.
 2649|   739k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 2650|   739k|                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|   739k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2654|   739k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2655|       |                //manipulation for row 1 - row 0
 2656|   739k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 15);
 2657|       |                //combining the appropriate sign change
 2658|   739k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 2659|       |                //row1-row0
 2660|       |                //separating +ve and and -ve values.
 2661|   739k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 2662|   739k|                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|   739k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2665|   739k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2666|       |                // row = 2 right
 2667|   739k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd + 1));
 2668|   739k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 2669|       |
 2670|       |
 2671|       |                //row1 -bottom
 2672|   739k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2673|   739k|                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|   739k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2676|   739k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2677|       |                //combining the appropriate sign change
 2678|   739k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2679|       |                // row = 2
 2680|   739k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 2681|       |
 2682|       |                //combining sign-left and sign_right
 2683|   739k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2684|       |
 2685|       |                //storing the row 1 left for next row.
 2686|   739k|                signup0_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 2687|       |
 2688|       |                //combining sign-left and sign_right
 2689|   739k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 2690|       |                //manipulation for bottom - row 1
 2691|   739k|                signup0_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signup0_16x8b, 15);
 2692|       |                //eliminating old left for row 0 and row 1
 2693|   739k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 2694|       |                //bottom - row1
 2695|   739k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signup0_16x8b);
 2696|   739k|                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|   739k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2699|   739k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2700|       |                //for the next iteration bottom -row1
 2701|   739k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2702|       |                //row1  getting it right for left of next block
 2703|   739k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 15);
 2704|       |                //adding constant 2
 2705|   739k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2706|   739k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 2707|       |                //shuffle to get sao index
 2708|   739k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2709|   739k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 2710|       |                //using availability mask
 2711|   739k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 2712|   739k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 2713|       |                //shuffle to get sao offset
 2714|   739k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2715|   739k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 2716|       |                //row0  getting it right for left of next block
 2717|   739k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 2718|       |                //copying the next top
 2719|   739k|                src_top_16x8b = src_temp1_16x8b;
 2720|       |                //cnvert to 16 bit then add and then saturated pack
 2721|   739k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2722|   739k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2723|   739k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2724|   739k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2725|   739k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2726|   739k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2727|   739k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2728|   739k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2729|       |
 2730|   739k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 2731|   739k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 2732|   739k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 2733|   739k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 2734|   739k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2735|   739k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 2736|   739k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 2737|   739k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 2738|       |
 2739|       |                //store left boundary
 2740|   739k|                _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|   739k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2743|       |                // row = 1
 2744|   739k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 2745|       |
 2746|   739k|                src_temp0_16x8b = src_bottom_16x8b;
 2747|   739k|                pu1_src_cpy += (src_strd << 1);
 2748|   739k|                pu1_src_left_cpy += 2;
 2749|   739k|                pu1_src_left_str += 2;
 2750|   739k|            }
 2751|  56.1k|            ht_rem = ht & 0x1;
 2752|       |
 2753|  56.1k|            if(ht_rem)
  ------------------
  |  Branch (2753:16): [True: 11.3k, False: 44.7k]
  ------------------
 2754|  11.3k|            {
 2755|  11.3k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 2756|  11.3k|                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.3k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 2760|  11.3k|                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.3k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2763|  11.3k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2764|       |                //combining the appropriate sign change
 2765|  11.3k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2766|       |                //adding top and botton and constant 2
 2767|  11.3k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2768|  11.3k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2769|       |                //eliminating old left for row 0 and row 1
 2770|  11.3k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 2771|       |
 2772|  11.3k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2773|       |                //using availability mask
 2774|  11.3k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 2775|       |
 2776|  11.3k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2777|       |
 2778|       |                //row0  getting it right for left of next block
 2779|  11.3k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 2780|       |                //copying the next top
 2781|  11.3k|                src_top_16x8b = src_temp0_16x8b;
 2782|       |                //cnvert to 16 bit then add and then saturated pack
 2783|  11.3k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2784|  11.3k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2785|  11.3k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2786|  11.3k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2787|  11.3k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2788|  11.3k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2789|  11.3k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2790|  11.3k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2791|       |                //store left boundary
 2792|  11.3k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 2793|       |
 2794|  11.3k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2795|  11.3k|                pu1_src_cpy += (src_strd);
 2796|  11.3k|                pu1_src_left_cpy += 1;
 2797|  11.3k|                pu1_src_left_str += 1;
 2798|  11.3k|            }
 2799|  56.1k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2799:16): [True: 4.95k, False: 51.1k]
  ------------------
 2800|  4.95k|            {
 2801|  4.95k|                src_top_16x8b = src_bottom_16x8b;
 2802|  4.95k|                pu1_src_left_str[0] = pu1_src_cpy[15];
 2803|  4.95k|            }
 2804|  56.1k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (2804:16): [True: 7.59k, False: 48.5k]
  ------------------
 2805|  7.59k|            {
 2806|  7.59k|                pu1_src_left_str[-ht_0] = pu1_src[15 - src_strd];
 2807|  7.59k|            }
 2808|       |
 2809|       |            //for the top left of next part of the block
 2810|  56.1k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 2811|       |            //updating top flag
 2812|  56.1k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2813|  56.1k|            pu1_src += 16;
 2814|  56.1k|            au1_mask_cpy += 16;
 2815|       |
 2816|       |
 2817|  56.1k|            pu1_left_tmp = pu1_src_left_cpy2;
 2818|  56.1k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 2819|  56.1k|            pu1_src_left_str2 = pu1_left_tmp;
 2820|       |
 2821|  56.1k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 2822|  56.1k|            pu1_src_left_str = pu1_src_left_str2;
 2823|  56.1k|        }
 2824|       |
 2825|  68.2k|        wd_rem = wd & 0xF;
 2826|  68.2k|        if(wd_rem)
  ------------------
  |  Branch (2826:12): [True: 66.8k, False: 1.32k]
  ------------------
 2827|  66.8k|        {
 2828|  66.8k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 2829|  66.8k|            pu1_src_left_str = pu1_src_left_str2;
 2830|  66.8k|            pu1_src_cpy = pu1_src;
 2831|  66.8k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 2832|       |            //row = 0
 2833|  66.8k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 2834|  66.8k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 15);
 2835|  66.8k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 2836|       |            //separating +ve and and -ve values.
 2837|  66.8k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2838|  66.8k|            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|  66.8k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2841|  66.8k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2842|       |            //preparing au1_mask
 2843|  66.8k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 2844|       |            //combining the appropriate sign change
 2845|  66.8k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2846|  66.8k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 2847|       |
 2848|   402k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (2848:27): [True: 335k, False: 66.8k]
  ------------------
 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|  66.8k|            ht_rem = ht & 0x2;
 3042|  66.8k|            if(ht_rem)
  ------------------
  |  Branch (3042:16): [True: 15.2k, False: 51.6k]
  ------------------
 3043|  15.2k|            {
 3044|  15.2k|                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|  15.2k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3047|       |                // row = 2
 3048|  15.2k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3049|       |
 3050|       |                //row 0 -row 1
 3051|  15.2k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);
 3052|       |                //separating +ve and and -ve values.
 3053|  15.2k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3054|  15.2k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3055|       |                //manipulation for row 1 -row 0
 3056|  15.2k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 15);
 3057|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3058|  15.2k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3059|  15.2k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3060|       |                //manipulation for row 1 - row 0
 3061|  15.2k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 15);
 3062|       |                //combining the appropriate sign change
 3063|  15.2k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3064|       |
 3065|       |                //row1-row0
 3066|       |                //separating +ve and and -ve values.
 3067|  15.2k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3068|  15.2k|                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|  15.2k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3072|  15.2k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3073|       |                //combining the appropriate sign chang
 3074|  15.2k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3075|       |                //row 1 -bottom
 3076|  15.2k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 1);
 3077|       |
 3078|  15.2k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 3079|  15.2k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 3080|       |                //row1 -bottom
 3081|  15.2k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3082|  15.2k|                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|  15.2k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3086|  15.2k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3087|       |                //combining the appropriate sign change
 3088|  15.2k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 3089|  15.2k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 3090|       |                //manipulation for bottom -row1
 3091|  15.2k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 3092|       |                //manipulation for bottom- row 1
 3093|  15.2k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 3094|       |                //adding top and down substraction
 3095|  15.2k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 3096|       |                //bottom - row 1
 3097|  15.2k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3098|  15.2k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3099|       |
 3100|       |                //eliminating old left for row 0,1
 3101|  15.2k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 3102|  15.2k|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 3103|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3104|  15.2k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3105|  15.2k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3106|       |                //for the next iteration signup0_16x8b
 3107|  15.2k|                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|  15.2k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 3111|       |                //for storing right of row 1
 3112|  15.2k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3113|       |
 3114|  15.2k|                src_top_16x8b = src_temp1_16x8b;
 3115|       |                //storing right of row 0 into left
 3116|  15.2k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 3117|       |
 3118|       |                //adding constant 2
 3119|  15.2k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3120|       |
 3121|       |                //shuffle to get sao index
 3122|  15.2k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3123|       |                //using availability mask
 3124|  15.2k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3125|       |                //shuffle to get sao offset
 3126|  15.2k|                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|  15.2k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3131|  15.2k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3132|  15.2k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3133|  15.2k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 3134|  15.2k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 3135|  15.2k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3136|  15.2k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 3137|  15.2k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 3138|       |
 3139|  15.2k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 3140|       |
 3141|  15.2k|                _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|  15.2k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3144|       |                // row = 1
 3145|  15.2k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 3146|  15.2k|                src_temp0_16x8b = src_bottom_16x8b;
 3147|  15.2k|                pu1_src_cpy += (src_strd << 1);
 3148|  15.2k|                pu1_src_left_cpy += 2;
 3149|  15.2k|                pu1_src_left_str += 2;
 3150|  15.2k|            }
 3151|  66.8k|            ht_rem = ht & 0x1;
 3152|  66.8k|            if(ht_rem)
  ------------------
  |  Branch (3152:16): [True: 14.8k, False: 52.0k]
  ------------------
 3153|  14.8k|            {
 3154|  14.8k|                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|  14.8k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3157|       |                //left store manipulation 1
 3158|  14.8k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 3159|       |                //row 0 -row1
 3160|  14.8k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 1);
 3161|       |                //separating +ve and and -ve values.
 3162|  14.8k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3163|  14.8k|                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|  14.8k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3166|  14.8k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3167|       |                //combining the appropriate sign change
 3168|  14.8k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3169|       |                //adding top and down substraction
 3170|  14.8k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3171|       |                //for row 0 right to put into left store
 3172|  14.8k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3173|       |                //adding constant 2
 3174|  14.8k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3175|  14.8k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 3176|  14.8k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 3177|       |                //filling the left boundary value
 3178|  14.8k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 3179|       |
 3180|       |                //shuffle to get sao index
 3181|  14.8k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3182|       |                //using availability mask
 3183|  14.8k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3184|       |                //shuffle to get sao offset
 3185|  14.8k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3186|  14.8k|                src_top_16x8b = src_temp0_16x8b;
 3187|       |                //cnvert to 16 bit then add and then saturated pack
 3188|  14.8k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3189|  14.8k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3190|  14.8k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3191|  14.8k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 3192|  14.8k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 3193|       |
 3194|  14.8k|                _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|  14.8k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3197|  14.8k|                pu1_src_cpy += (src_strd);
 3198|  14.8k|                pu1_src_left_cpy += 1;
 3199|  14.8k|                pu1_src_left_str += 1;
 3200|  14.8k|            }
 3201|  66.8k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (3201:16): [True: 6.36k, False: 60.5k]
  ------------------
 3202|  6.36k|            {
 3203|  6.36k|                src_top_16x8b = src_bottom_16x8b;
 3204|  6.36k|                pu1_src_left_str[0] = pu1_src_cpy[7];
 3205|  6.36k|            }
 3206|       |
 3207|  66.8k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (3207:16): [True: 9.25k, False: 57.6k]
  ------------------
 3208|  9.25k|            {
 3209|  9.25k|                pu1_src_left_str[-ht_0] = pu1_src[7 - src_strd];
 3210|  9.25k|            }
 3211|       |
 3212|  66.8k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 3213|  66.8k|            pu1_src += 8;
 3214|  66.8k|            au1_mask_cpy += 16;
 3215|       |
 3216|  66.8k|            pu1_left_tmp = pu1_src_left_cpy2;
 3217|  66.8k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 3218|  66.8k|            pu1_src_left_str2 = pu1_left_tmp;
 3219|       |
 3220|  66.8k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 3221|  66.8k|            pu1_src_left_str = pu1_src_left_str2;
 3222|  66.8k|        }
 3223|  68.2k|        pu1_src_org[0] = u1_pos_0_0_tmp;
 3224|  68.2k|        pu1_src_org[wd - 1 + (ht_tmp - 1) * src_strd] = u1_pos_wd_ht_tmp;
 3225|  68.2k|        pu1_src_left_cpy = (0 == pu1_avail[2]) ? (pu1_src_left_cpy - 1) : pu1_src_left_cpy;
  ------------------
  |  Branch (3225:28): [True: 9.37k, False: 58.8k]
  ------------------
 3226|  1.49M|        for(row = 0; row < ht_tmp; row++)
  ------------------
  |  Branch (3226:22): [True: 1.42M, False: 68.2k]
  ------------------
 3227|  1.42M|        {
 3228|  1.42M|            pu1_src_left[row] = pu1_src_left_cpy[row];
 3229|  1.42M|        }
 3230|  68.2k|    }
 3231|       |
 3232|  68.2k|}
ihevc_sao_edge_offset_class2_chroma_ssse3:
 3247|  44.2k|{
 3248|  44.2k|    WORD32 row, col;
 3249|  44.2k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 3250|  44.2k|    UWORD8 *pu1_left_tmp, *pu1_src_left_str, *pu1_src_left_str2;
 3251|  44.2k|    UWORD8 *pu1_firstleft;
 3252|  44.2k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 3253|  44.2k|    UWORD8 au1_mask[2 * MAX_CTB_SIZE], *au1_mask_cpy;
 3254|  44.2k|    UWORD8 au1_src_left_tmp[2 * (MAX_CTB_SIZE + 8)];
 3255|  44.2k|    UWORD8 au1_src_left_tmp1[2 * (MAX_CTB_SIZE + 8)];
 3256|  44.2k|    WORD32 wd_rem;
 3257|  44.2k|    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|  44.2k|    WORD32 ht_tmp;
 3259|  44.2k|    WORD32 ht_0;
 3260|       |
 3261|  44.2k|    WORD32 bit_depth;
 3262|  44.2k|    UWORD8 u1_avail0, u1_avail1;
 3263|       |
 3264|  44.2k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 3265|  44.2k|    __m128i signup0_16x8b, signdwn1_16x8b;
 3266|  44.2k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 3267|  44.2k|    __m128i edge0_16x8b, edge1_16x8b;
 3268|  44.2k|    __m128i src_top_16x8b, src_bottom_16x8b;
 3269|  44.2k|    __m128i au1_mask8x16b;
 3270|  44.2k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 3271|  44.2k|    __m128i const2_16x8b, const0_16x8b;
 3272|  44.2k|    __m128i left_store_16x8b;
 3273|  44.2k|    __m128i chroma_offset_8x16b;
 3274|       |
 3275|  44.2k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  44.2k|#define UNUSED(x) ((void)(x))
  ------------------
 3276|  44.2k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  44.2k|#define UNUSED(x) ((void)(x))
  ------------------
 3277|       |
 3278|  44.2k|    ht_0 = ht; ht_tmp = ht;
 3279|  44.2k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 3280|       |    /* Updating left and top-left  */
 3281|  1.07M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (3281:18): [True: 1.03M, False: 44.2k]
  ------------------
 3282|  1.03M|    {
 3283|  1.03M|        au1_src_left_tmp[row] = pu1_src_left[row];
 3284|  1.03M|    }
 3285|       |    //setting availability mask to ff size MAX_CTB_SIZE
 3286|   400k|    for(col = 0; col < 2 * MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   400k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (3286:18): [True: 356k, False: 44.2k]
  ------------------
 3287|   356k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 3288|  44.2k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  44.2k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  44.2k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3289|  44.2k|    pu1_src_org = pu1_src;
 3290|  44.2k|    pu1_src_top_cpy = pu1_src_top;
 3291|  44.2k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 3292|  44.2k|    pu1_src_left_cpy = au1_src_left_tmp;
 3293|  44.2k|    pu1_src_left_str2 = au1_src_left_tmp1;
 3294|  44.2k|    pu1_src_left_str = au1_src_left_tmp1;
 3295|  44.2k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 3296|  44.2k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 3297|  44.2k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 3298|  44.2k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 3299|       |
 3300|       |    /* If top-left is available, process separately */
 3301|  44.2k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (3301:8): [True: 30.6k, False: 13.6k]
  ------------------
 3302|  30.6k|    {
 3303|  30.6k|        WORD32 edge_idx;
 3304|       |
 3305|       |        /* U */
 3306|  30.6k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  30.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.2k, False: 3.44k]
  |  |  |  Branch (44:34): [True: 4.09k, False: 23.1k]
  |  |  ------------------
  ------------------
 3307|  30.6k|                        SIGN(pu1_src[0] - pu1_src[2 + src_strd]);
  ------------------
  |  |   44|  30.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.8k, False: 2.82k]
  |  |  |  Branch (44:34): [True: 3.67k, False: 24.1k]
  |  |  ------------------
  ------------------
 3308|       |
 3309|  30.6k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3310|       |
 3311|  30.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (3311:12): [True: 6.81k, False: 23.8k]
  ------------------
 3312|  6.81k|        {
 3313|  6.81k|            u1_pos_0_0_tmp_u = CLIP3(pu1_src[0] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  6.81k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 366, False: 6.44k]
  |  |  |  Branch (40:53): [True: 312, False: 6.13k]
  |  |  ------------------
  ------------------
 3314|  6.81k|        }
 3315|  23.8k|        else
 3316|  23.8k|        {
 3317|  23.8k|            u1_pos_0_0_tmp_u = pu1_src[0];
 3318|  23.8k|        }
 3319|       |
 3320|       |        /* V */
 3321|  30.6k|        edge_idx = 2 + SIGN(pu1_src[1] - pu1_src_top_left[1]) +
  ------------------
  |  |   44|  30.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.9k, False: 3.68k]
  |  |  |  Branch (44:34): [True: 3.94k, False: 23.0k]
  |  |  ------------------
  ------------------
 3322|  30.6k|                        SIGN(pu1_src[1] - pu1_src[1 + 2 + src_strd]);
  ------------------
  |  |   44|  30.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.8k, False: 2.79k]
  |  |  |  Branch (44:34): [True: 3.89k, False: 23.9k]
  |  |  ------------------
  ------------------
 3323|       |
 3324|  30.6k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3325|       |
 3326|  30.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (3326:12): [True: 7.10k, False: 23.5k]
  ------------------
 3327|  7.10k|        {
 3328|  7.10k|            u1_pos_0_0_tmp_v = CLIP3(pu1_src[1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.10k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 252, False: 6.85k]
  |  |  |  Branch (40:53): [True: 322, False: 6.53k]
  |  |  ------------------
  ------------------
 3329|  7.10k|        }
 3330|  23.5k|        else
 3331|  23.5k|        {
 3332|  23.5k|            u1_pos_0_0_tmp_v = pu1_src[1];
 3333|  23.5k|        }
 3334|  30.6k|    }
 3335|  13.6k|    else
 3336|  13.6k|    {
 3337|  13.6k|        u1_pos_0_0_tmp_u = pu1_src[0];
 3338|  13.6k|        u1_pos_0_0_tmp_v = pu1_src[1];
 3339|  13.6k|    }
 3340|       |
 3341|       |    /* If bottom-right is available, process separately */
 3342|  44.2k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (3342:8): [True: 34.1k, False: 10.0k]
  ------------------
 3343|  34.1k|    {
 3344|  34.1k|        WORD32 edge_idx;
 3345|       |
 3346|       |        /* U */
 3347|  34.1k|        edge_idx = 2 + SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  34.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 32.3k, False: 1.79k]
  |  |  |  Branch (44:34): [True: 1.93k, False: 30.4k]
  |  |  ------------------
  ------------------
 3348|  34.1k|                        SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  34.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.9k, False: 4.24k]
  |  |  |  Branch (44:34): [True: 3.94k, False: 25.9k]
  |  |  ------------------
  ------------------
 3349|       |
 3350|  34.1k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3351|       |
 3352|  34.1k|        if(0 != edge_idx)
  ------------------
  |  Branch (3352:12): [True: 7.45k, False: 26.7k]
  ------------------
 3353|  7.45k|        {
 3354|  7.45k|            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.45k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 297, False: 7.15k]
  |  |  |  Branch (40:53): [True: 278, False: 6.88k]
  |  |  ------------------
  ------------------
 3355|  7.45k|        }
 3356|  26.7k|        else
 3357|  26.7k|        {
 3358|  26.7k|            u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
 3359|  26.7k|        }
 3360|       |
 3361|       |        /* V */
 3362|  34.1k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  34.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 32.0k, False: 2.11k]
  |  |  |  Branch (44:34): [True: 2.28k, False: 29.7k]
  |  |  ------------------
  ------------------
 3363|  34.1k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  34.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 30.0k, False: 4.18k]
  |  |  |  Branch (44:34): [True: 4.40k, False: 25.6k]
  |  |  ------------------
  ------------------
 3364|       |
 3365|  34.1k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3366|       |
 3367|  34.1k|        if(0 != edge_idx)
  ------------------
  |  Branch (3367:12): [True: 7.90k, False: 26.2k]
  ------------------
 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: 253, False: 7.65k]
  |  |  |  Branch (40:53): [True: 297, False: 7.35k]
  |  |  ------------------
  ------------------
 3370|  7.90k|        }
 3371|  26.2k|        else
 3372|  26.2k|        {
 3373|  26.2k|            u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
 3374|  26.2k|        }
 3375|  34.1k|    }
 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|  44.2k|    pu1_firstleft = pu1_src_top_left;
 3382|       |
 3383|       |    /* Update height and source pointers based on the availability flags */
 3384|  44.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (3384:8): [True: 8.06k, False: 36.2k]
  ------------------
 3385|  8.06k|    {
 3386|  8.06k|        pu1_firstleft = pu1_src_left_cpy2;
 3387|  8.06k|        pu1_src_left_cpy2 += 2;
 3388|  8.06k|        pu1_src_left_str2 += 2;
 3389|  8.06k|        pu1_src_top_cpy = pu1_src;
 3390|  8.06k|        pu1_src += src_strd;
 3391|  8.06k|        ht--;
 3392|  8.06k|    }
 3393|  44.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (3393:8): [True: 5.07k, False: 39.2k]
  ------------------
 3394|  5.07k|    {
 3395|  5.07k|        ht--;
 3396|  5.07k|        ht_0--;
 3397|  5.07k|    }
 3398|       |    //storing top left in a mmx register
 3399|  44.2k|    left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_firstleft);
 3400|  44.2k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 3401|  44.2k|    const2_16x8b = _mm_set1_epi8(2);
 3402|  44.2k|    const0_16x8b = _mm_setzero_si128();
 3403|  44.2k|    left_store_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 3404|       |
 3405|       |    //availability mask creation
 3406|  44.2k|    u1_avail0 = pu1_avail[0];
 3407|  44.2k|    u1_avail1 = pu1_avail[1];
 3408|  44.2k|    au1_mask[0] = u1_avail0;
 3409|  44.2k|    au1_mask[1] = u1_avail0;
 3410|  44.2k|    au1_mask[wd - 1] = u1_avail1;
 3411|  44.2k|    au1_mask[wd - 2] = u1_avail1;
 3412|       |
 3413|       |    /* top-left arrays */
 3414|  44.2k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 3415|  44.2k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
 3416|  44.2k|    {
 3417|  44.2k|        WORD32 ht_rem;
 3418|  44.2k|        au1_mask_cpy = au1_mask;
 3419|       |
 3420|  44.2k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 3421|  44.2k|        pu1_src_left_str = pu1_src_left_str2;
 3422|   107k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (3422:23): [True: 62.7k, False: 44.2k]
  ------------------
 3423|  62.7k|        {
 3424|  62.7k|            pu1_src_cpy = pu1_src;
 3425|  62.7k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 3426|       |            //row = 0
 3427|  62.7k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 3428|  62.7k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 14);
 3429|       |            //loading the mask
 3430|  62.7k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 3431|       |            //separating +ve and and -ve values.
 3432|  62.7k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 3433|  62.7k|            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|  62.7k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3436|  62.7k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3437|       |            //combining the appropriate sign change
 3438|  62.7k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3439|       |
 3440|       |
 3441|   460k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (3441:27): [True: 397k, False: 62.7k]
  ------------------
 3442|   397k|            {
 3443|   397k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3444|       |                //row = 1
 3445|   397k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3446|       |                // row = 1 right
 3447|   397k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 2));
 3448|       |                //to insert left in row 0
 3449|   397k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 3450|       |                //row 0 -row1
 3451|       |                //separating +ve and and -ve values.
 3452|   397k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 3453|   397k|                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|   397k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3457|   397k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3458|       |                //manipulation for row 1 - row 0
 3459|   397k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 14);
 3460|       |                //combining the appropriate sign change
 3461|   397k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 3462|       |                //row1-row0
 3463|       |                //separating +ve and and -ve values.
 3464|   397k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3465|   397k|                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|   397k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3468|   397k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3469|       |                 // row = 2 right
 3470|   397k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd + 2));
 3471|   397k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 3472|       |
 3473|       |
 3474|       |                //row1 -bottom
 3475|   397k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 3476|   397k|                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|   397k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3479|   397k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3480|       |                //combining the appropriate sign change
 3481|   397k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3482|       |                // row = 2
 3483|   397k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3484|       |
 3485|       |                //combining sign-left and sign_right
 3486|   397k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3487|       |
 3488|       |                //storing the row 1 left for next row.
 3489|   397k|                signup0_16x8b = _mm_slli_si128(left_store_16x8b, 12);
 3490|       |
 3491|       |                //combining sign-left and sign_right
 3492|   397k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 3493|       |                //manipulation for bottom - row 1
 3494|   397k|                signup0_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signup0_16x8b, 14);
 3495|       |                //eliminating old left for row 0 and row 1
 3496|   397k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 3497|       |                //bottom - row1
 3498|   397k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signup0_16x8b);
 3499|   397k|                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|   397k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3502|   397k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3503|       |                //for the next iteration bottom -row1
 3504|   397k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3505|       |                //row1  getting it right for left of next iteration
 3506|   397k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 14);
 3507|       |                //copying the next top
 3508|   397k|                src_top_16x8b = src_temp1_16x8b;
 3509|       |                //row0  getting its right for left of next iteration.
 3510|   397k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 3511|       |
 3512|       |
 3513|       |                //adding constant 2
 3514|   397k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3515|   397k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 3516|       |                //shuffle to get sao index
 3517|   397k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3518|   397k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 3519|       |                //using availability mask
 3520|   397k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3521|   397k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 3522|       |                //adding chroma offset to access U and V
 3523|   397k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3524|   397k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 3525|       |
 3526|       |
 3527|       |                //shuffle to get sao offset
 3528|   397k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3529|   397k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 3530|       |                //cnvert to 16 bit then add and then saturated pack
 3531|   397k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3532|   397k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3533|   397k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3534|   397k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 3535|   397k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3536|   397k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3537|   397k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 3538|   397k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 3539|       |
 3540|   397k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 3541|   397k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 3542|   397k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 3543|   397k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 3544|   397k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 3545|   397k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3546|   397k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 3547|   397k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 3548|       |
 3549|       |                //store left boundary
 3550|   397k|                _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|   397k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3553|       |                // row = 1
 3554|   397k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 3555|       |
 3556|   397k|                src_temp0_16x8b = src_bottom_16x8b;
 3557|   397k|                pu1_src_cpy += (src_strd << 1);
 3558|   397k|                pu1_src_left_cpy += 4;
 3559|   397k|                pu1_src_left_str += 4;
 3560|   397k|            }
 3561|  62.7k|            ht_rem = ht & 0x1;
 3562|       |
 3563|  62.7k|            if(ht_rem)
  ------------------
  |  Branch (3563:16): [True: 18.4k, False: 44.3k]
  ------------------
 3564|  18.4k|            {
 3565|  18.4k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3566|  18.4k|                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|  18.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 3570|  18.4k|                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|  18.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3573|  18.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3574|       |                //combining the appropriate sign change
 3575|  18.4k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3576|       |                //adding top and botton and constant 2
 3577|  18.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3578|  18.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3579|       |
 3580|       |                //eliminating old left for row 0 and row 1
 3581|  18.4k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 3582|       |                //copying the next top
 3583|  18.4k|                src_top_16x8b = src_temp0_16x8b;
 3584|       |                //row0  getting it right for left of next block
 3585|  18.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 3586|       |
 3587|  18.4k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3588|       |                //using availability mask
 3589|  18.4k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3590|       |                //adding chroma offset to access U and V
 3591|  18.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3592|       |
 3593|  18.4k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3594|       |
 3595|       |                //cnvert to 16 bit then add and then saturated pack
 3596|  18.4k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3597|  18.4k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3598|  18.4k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3599|  18.4k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 3600|  18.4k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3601|  18.4k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3602|  18.4k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 3603|  18.4k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 3604|       |
 3605|  18.4k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3606|       |
 3607|  18.4k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3608|  18.4k|                pu1_src_cpy += (src_strd);
 3609|  18.4k|                pu1_src_left_cpy += 2;
 3610|  18.4k|                pu1_src_left_str += 2;
 3611|  18.4k|            }
 3612|  62.7k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (3612:16): [True: 8.42k, False: 54.3k]
  ------------------
 3613|  8.42k|            {
 3614|  8.42k|                src_top_16x8b = src_bottom_16x8b;
 3615|  8.42k|                pu1_src_left_str[1] = pu1_src_cpy[15];
 3616|  8.42k|                pu1_src_left_str[0] = pu1_src_cpy[14];
 3617|  8.42k|            }
 3618|  62.7k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (3618:16): [True: 12.8k, False: 49.9k]
  ------------------
 3619|  12.8k|            {
 3620|  12.8k|                pu1_src_left_str[-2 * ht_0] = pu1_src[14 - src_strd];
 3621|  12.8k|                pu1_src_left_str[-2 * ht_0 + 1] = pu1_src[15 - src_strd];
 3622|  12.8k|            }
 3623|       |
 3624|       |            //for the top left of next part of the block
 3625|  62.7k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 3626|       |            //updating top flag
 3627|  62.7k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 3628|  62.7k|            pu1_src += 16;
 3629|  62.7k|            au1_mask_cpy += 16;
 3630|       |
 3631|  62.7k|            pu1_left_tmp = pu1_src_left_cpy2;
 3632|  62.7k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 3633|  62.7k|            pu1_src_left_str2 = pu1_left_tmp;
 3634|       |
 3635|  62.7k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 3636|  62.7k|            pu1_src_left_str = pu1_src_left_str2;
 3637|  62.7k|        }
 3638|  44.2k|        wd_rem = wd & 0xF;
 3639|  44.2k|        if(wd_rem)
  ------------------
  |  Branch (3639:12): [True: 3.14k, False: 41.1k]
  ------------------
 3640|  3.14k|        {
 3641|  3.14k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 3642|  3.14k|            pu1_src_left_str = pu1_src_left_str2;
 3643|  3.14k|            pu1_src_cpy = pu1_src;
 3644|  3.14k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 3645|       |            //row = 0
 3646|  3.14k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 3647|  3.14k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 14);
 3648|  3.14k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 3649|       |            //separating +ve and and -ve values.
 3650|  3.14k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 3651|  3.14k|            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.14k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3654|  3.14k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3655|       |            //preparing au1_mask
 3656|  3.14k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 3657|       |            //combining the appropriate sign change
 3658|  3.14k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3659|  3.14k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 3660|       |
 3661|  9.12k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (3661:27): [True: 5.98k, False: 3.14k]
  ------------------
 3662|  5.98k|            {
 3663|  5.98k|                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|  5.98k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3666|       |                // row = 2
 3667|  5.98k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3668|       |                //right row1
 3669|  5.98k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3670|       |                //row 0 -row1
 3671|       |                //separating +ve and and -ve values.
 3672|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3673|  5.98k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3674|       |                //manipulation for row 1 -row 0
 3675|  5.98k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 3676|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3677|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3678|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3679|       |                //row 0 left
 3680|  5.98k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 14);
 3681|       |                //combining the appropriate sign change
 3682|  5.98k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3683|       |                //row 1 -row0
 3684|       |                //separating +ve and and -ve values.
 3685|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3686|  5.98k|                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|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3690|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3691|       |                //row1-row0
 3692|  5.98k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3693|       |
 3694|  5.98k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 3695|       |
 3696|  5.98k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 3697|       |                //right row2
 3698|  5.98k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 3699|       |                //packing row 0 n row 1
 3700|  5.98k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 3701|       |                //row1 -row2
 3702|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3703|  5.98k|                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|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3706|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3707|       |                //combining the appropriate sign change
 3708|  5.98k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 3709|  5.98k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 3710|       |                //manipulation for row 2 -row 1
 3711|  5.98k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 3712|       |                //row 1 left
 3713|  5.98k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 3714|       |                //row = 3
 3715|  5.98k|                src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 3 * src_strd));
 3716|       |
 3717|       |                // row = 4
 3718|  5.98k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 4 * src_strd));
 3719|       |
 3720|  5.98k|                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|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3724|  5.98k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3725|       |                //manipulation for row 3 -row 2
 3726|  5.98k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 10);
 3727|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3728|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3729|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3730|       |                //row 2 left
 3731|  5.98k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 3732|       |                //combining the appropriate sign change
 3733|  5.98k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1)
 3734|       |
 3735|       |                //separating +ve and and -ve values.(3,2)
 3736|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 3737|  5.98k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 3738|  5.98k|                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|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3741|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3742|       |                //right row3
 3743|  5.98k|                signdwn1_16x8b = _mm_srli_si128(src_top_16x8b, 2);
 3744|       |                //combining the appropriate sign change
 3745|  5.98k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-2)
 3746|       |
 3747|  5.98k|                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|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3751|  5.98k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3752|       |                //right row 4
 3753|  5.98k|                signdwn1_16x8b =  _mm_srli_si128(src_temp1_16x8b, 2);
 3754|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3755|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3756|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3757|       |                //combining the appropriate sign change
 3758|  5.98k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 3759|       |
 3760|       |                //separating +ve and and -ve values.(3,bottom)
 3761|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 3762|  5.98k|                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|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3766|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3767|  5.98k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8); //aligned left (2-3)
 3768|       |                //combining the appropriate sign change
 3769|  5.98k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-bottom)
 3770|  5.98k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-bottom),(2-3)
 3771|       |
 3772|       |                //manipulation for bottom -row 3
 3773|  5.98k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 8);
 3774|       |                //eliminating old left for row 0,1,2,3
 3775|  5.98k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 8);
 3776|       |                //packing row 2 n row 3
 3777|  5.98k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 3778|       |                //row 3 left
 3779|  5.98k|                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|  5.98k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 3783|       |                //separating +ve and and -ve values.(botttom,3)
 3784|  5.98k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3785|  5.98k|                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|  5.98k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3789|  5.98k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3790|  5.98k|                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|  5.98k|                signdwn1_16x8b = _mm_slli_si128(src_bottom_16x8b, 8);
 3794|       |                //loading row 3 right into left
 3795|  5.98k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_bottom_16x8b, 14);
 3796|       |                //storing right of row 2into left
 3797|  5.98k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 3798|       |                //to store right of row 0
 3799|  5.98k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3800|       |                //storing right of row 1 into left
 3801|  5.98k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 3802|       |                //storing right of row 0 into left
 3803|  5.98k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 3804|       |
 3805|       |                //adding constant 2
 3806|  5.98k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3807|  5.98k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 3808|       |                //shuffle to get sao index
 3809|  5.98k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3810|  5.98k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 3811|       |                //using availability mask
 3812|  5.98k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3813|  5.98k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 3814|       |
 3815|       |                //adding chroma offset to access U and V
 3816|  5.98k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3817|  5.98k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 3818|       |
 3819|       |                //shuffle to get sao offset
 3820|  5.98k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3821|  5.98k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 3822|       |                //cnvert to 16 bit then add and then saturated pack
 3823|  5.98k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3824|  5.98k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3825|  5.98k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3826|  5.98k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 3827|  5.98k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3828|  5.98k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3829|  5.98k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 3830|  5.98k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 3831|       |
 3832|  5.98k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 3833|  5.98k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 3834|  5.98k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 3835|  5.98k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 3836|  5.98k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 3837|  5.98k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3838|  5.98k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, edge1_16x8b);
 3839|  5.98k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 3840|       |
 3841|  5.98k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 3842|  5.98k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 3843|       |
 3844|       |
 3845|  5.98k|                _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|  5.98k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3848|       |                // row = 1
 3849|  5.98k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 3850|       |                //row = 2
 3851|  5.98k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 3852|       |                // row = 3
 3853|  5.98k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 3854|       |
 3855|  5.98k|                src_temp0_16x8b = src_temp1_16x8b;
 3856|  5.98k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 3857|  5.98k|                pu1_src_cpy += (src_strd << 2);
 3858|  5.98k|                pu1_src_left_cpy += 8;
 3859|  5.98k|                pu1_src_left_str += 8;
 3860|  5.98k|            }
 3861|  3.14k|            ht_rem = ht & 0x2;
 3862|  3.14k|            if(ht_rem)
  ------------------
  |  Branch (3862:16): [True: 697, False: 2.44k]
  ------------------
 3863|    697|            {
 3864|    697|                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|    697|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3867|       |                // row = 2
 3868|    697|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3869|       |
 3870|       |                //row 0 -row 1
 3871|    697|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3872|       |                //separating +ve and and -ve values.
 3873|    697|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3874|    697|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3875|       |                //manipulation for row 1 -row 0
 3876|    697|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 3877|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3878|    697|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3879|    697|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3880|       |                //manipulation for row 1 - row 0
 3881|    697|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 14);
 3882|       |                //combining the appropriate sign change
 3883|    697|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3884|       |
 3885|       |                //row1-row0
 3886|       |                //separating +ve and and -ve values.
 3887|    697|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3888|    697|                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|    697|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3892|    697|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3893|       |                //combining the appropriate sign chang
 3894|    697|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3895|       |                //row 1 -bottom
 3896|    697|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 3897|       |
 3898|    697|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 3899|    697|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 3900|       |                //row1 -bottom
 3901|    697|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3902|    697|                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|    697|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3906|    697|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3907|       |                //combining the appropriate sign change
 3908|    697|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 3909|    697|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 3910|       |                //manipulation for bottom -row1
 3911|    697|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 3912|       |                //eliminating old left for row 0,1
 3913|    697|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 3914|       |                //manipulation for bottom- row 1
 3915|    697|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 3916|       |                //adding top and down substraction
 3917|    697|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 3918|       |                //bottom - row 1
 3919|    697|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3920|    697|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3921|       |
 3922|       |                //shifting row 1
 3923|    697|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 3924|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3925|    697|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3926|    697|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3927|       |                //for the next iteration signup0_16x8b
 3928|    697|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1) for next
 3929|       |                //storing right of row 1 into left
 3930|    697|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14); //for storing right of row 0
 3931|    697|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3932|       |                //the next top  in  src_top_16x8b
 3933|    697|                src_top_16x8b = src_temp1_16x8b;
 3934|       |                //storing right of row 0 into left
 3935|    697|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 3936|       |
 3937|       |
 3938|       |                //adding constant 2
 3939|    697|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3940|       |
 3941|       |                //shuffle to get sao index
 3942|    697|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3943|       |                //using availability mask
 3944|    697|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3945|       |
 3946|       |                //adding chroma offset to access U and V
 3947|    697|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3948|       |
 3949|       |                //shuffle to get sao offset
 3950|    697|                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|    697|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3954|    697|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3955|    697|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3956|    697|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 3957|    697|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3958|    697|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 3959|    697|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge0_16x8b);
 3960|    697|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 3961|       |
 3962|    697|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 3963|       |
 3964|    697|                _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|    697|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3967|       |                // row = 1
 3968|    697|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 3969|    697|                src_temp0_16x8b = src_bottom_16x8b;
 3970|    697|                pu1_src_cpy += (src_strd << 1);
 3971|    697|                pu1_src_left_cpy += 4;
 3972|    697|                pu1_src_left_str += 4;
 3973|    697|            }
 3974|  3.14k|            ht_rem = ht & 0x1;
 3975|  3.14k|            if(ht_rem)
  ------------------
  |  Branch (3975:16): [True: 571, False: 2.57k]
  ------------------
 3976|    571|            {
 3977|    571|                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|    571|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3980|       |
 3981|       |                //row 0 -row1
 3982|    571|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 3983|       |                //separating +ve and and -ve values.
 3984|    571|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3985|    571|                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|    571|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3988|    571|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3989|       |                //combining the appropriate sign change
 3990|    571|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3991|       |                //adding top and down substraction
 3992|    571|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3993|       |
 3994|       |                //for row 0 right to put into left store
 3995|    571|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3996|       |                //left store manipulation 1
 3997|    571|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 3998|    571|                src_top_16x8b = src_temp0_16x8b;
 3999|       |                //filling the left boundary value
 4000|    571|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 4001|       |
 4002|       |                //adding constant 2
 4003|    571|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4004|    571|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 4005|    571|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 4006|       |
 4007|       |
 4008|       |                //shuffle to get sao index
 4009|    571|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4010|       |                //using availability mask
 4011|    571|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4012|       |                //adding chroma offset to access U and V
 4013|    571|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 4014|       |
 4015|       |                //shuffle to get sao offset
 4016|    571|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4017|       |
 4018|       |                //cnvert to 16 bit then add and then saturated pack
 4019|    571|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4020|    571|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4021|    571|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4022|    571|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4023|    571|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 4024|       |
 4025|    571|                _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|    571|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4028|    571|                pu1_src_cpy += (src_strd);
 4029|    571|                pu1_src_left_cpy += 2;
 4030|    571|                pu1_src_left_str += 2;
 4031|    571|            }
 4032|  3.14k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (4032:16): [True: 365, False: 2.78k]
  ------------------
 4033|    365|            {
 4034|    365|                src_top_16x8b = src_bottom_16x8b;
 4035|    365|                pu1_src_left_str[1] = pu1_src_cpy[7];
 4036|    365|                pu1_src_left_str[0] = pu1_src_cpy[6];
 4037|    365|            }
 4038|       |
 4039|  3.14k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (4039:16): [True: 458, False: 2.68k]
  ------------------
 4040|    458|            {
 4041|    458|                pu1_src_left_str[-2 * ht_0] = pu1_src[6 - src_strd];
 4042|    458|                pu1_src_left_str[-2 * ht_0 + 1] = pu1_src[7 - src_strd];
 4043|    458|            }
 4044|       |
 4045|  3.14k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 4046|  3.14k|            pu1_src += 8;
 4047|       |
 4048|  3.14k|            pu1_left_tmp = pu1_src_left_cpy2;
 4049|  3.14k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 4050|  3.14k|            pu1_src_left_str2 = pu1_left_tmp;
 4051|       |
 4052|  3.14k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4053|  3.14k|            pu1_src_left_str = pu1_src_left_str2;
 4054|  3.14k|        }
 4055|  44.2k|        pu1_src_org[0] = u1_pos_0_0_tmp_u;
 4056|  44.2k|        pu1_src_org[1] = u1_pos_0_0_tmp_v;
 4057|  44.2k|        pu1_src_org[wd - 2 + (ht_tmp - 1) * src_strd] = u1_pos_wd_ht_tmp_u;
 4058|  44.2k|        pu1_src_org[wd - 1 + (ht_tmp - 1) * src_strd] = u1_pos_wd_ht_tmp_v;
 4059|  44.2k|        pu1_src_left_cpy = (0 == pu1_avail[2]) ? (pu1_src_left_cpy - 2) : pu1_src_left_cpy;
  ------------------
  |  Branch (4059:28): [True: 8.06k, False: 36.2k]
  ------------------
 4060|  1.08M|        for(row = 0; row < 2 * ht_tmp; row++)
  ------------------
  |  Branch (4060:22): [True: 1.03M, False: 44.2k]
  ------------------
 4061|  1.03M|        {
 4062|  1.03M|            pu1_src_left[row] = pu1_src_left_cpy[row];
 4063|  1.03M|        }
 4064|  44.2k|    }
 4065|       |
 4066|  44.2k|}
ihevc_sao_edge_offset_class3_ssse3:
 4079|  50.5k|{
 4080|  50.5k|    WORD32 row, col;
 4081|  50.5k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 4082|  50.5k|    UWORD8 *pu1_left_tmp, *pu1_src_left_str, *pu1_src_left_str2;
 4083|  50.5k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 4084|  50.5k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE + 8];
 4085|  50.5k|    UWORD8 au1_src_left_tmp1[MAX_CTB_SIZE + 8];
 4086|  50.5k|    UWORD8 au1_mask[MAX_CTB_SIZE], *au1_mask_cpy;
 4087|  50.5k|    WORD32 wd_rem;
 4088|  50.5k|    UWORD8 u1_pos_wd_0_tmp, u1_pos_0_ht_tmp;
 4089|  50.5k|    WORD32 ht_tmp;
 4090|  50.5k|    WORD32 bit_depth;
 4091|  50.5k|    UWORD8 u1_avail0, u1_avail1;
 4092|       |
 4093|  50.5k|    __m128i src_top_16x8b, src_bottom_16x8b;
 4094|  50.5k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 4095|  50.5k|    __m128i signup0_16x8b, signdwn1_16x8b;
 4096|  50.5k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 4097|  50.5k|    __m128i edge0_16x8b, edge1_16x8b;
 4098|  50.5k|    __m128i au1_mask8x16b;
 4099|  50.5k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 4100|  50.5k|    __m128i const2_16x8b, const0_16x8b;
 4101|  50.5k|    __m128i left_store_16x8b;
 4102|       |
 4103|  50.5k|    ht_tmp = ht;
 4104|  50.5k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 4105|       |
 4106|  50.5k|    au1_src_left_tmp[0] = pu1_src[(wd - 1)];
 4107|       |    //manipulation for bottom left
 4108|  1.07M|    for(row = 1; row < ht; row++)
  ------------------
  |  Branch (4108:18): [True: 1.02M, False: 50.5k]
  ------------------
 4109|  1.02M|    {
 4110|  1.02M|        au1_src_left_tmp[row] = pu1_src_left[row];
 4111|  1.02M|    }
 4112|  50.5k|    au1_src_left_tmp[ht] = pu1_src_bot_left[0];
 4113|       |
 4114|  50.5k|    *pu1_src_top_left = pu1_src_top[wd - 1];
 4115|       |    //setting availability mask to ff size MAX_CTB_SIZE
 4116|   252k|    for(col = 0; col < MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   252k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (4116:18): [True: 202k, False: 50.5k]
  ------------------
 4117|   202k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 4118|  50.5k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  50.5k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  50.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4119|  50.5k|    pu1_src_org = pu1_src;
 4120|  50.5k|    pu1_src_top_cpy = pu1_src_top;
 4121|  50.5k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 4122|  50.5k|    pu1_src_left_cpy = au1_src_left_tmp;
 4123|  50.5k|    pu1_src_left_str2 = au1_src_left_tmp1;
 4124|  50.5k|    pu1_src_left_str = au1_src_left_tmp1;
 4125|  50.5k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 4126|  50.5k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
 4127|       |
 4128|       |    /* If top-right is available, process separately */
 4129|  50.5k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (4129:8): [True: 38.5k, False: 11.9k]
  ------------------
 4130|  38.5k|    {
 4131|  38.5k|        WORD32 edge_idx;
 4132|       |
 4133|  38.5k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  38.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 32.6k, False: 5.92k]
  |  |  |  Branch (44:34): [True: 4.11k, False: 28.5k]
  |  |  ------------------
  ------------------
 4134|  38.5k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 1 + src_strd]);
  ------------------
  |  |   44|  38.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.9k, False: 3.59k]
  |  |  |  Branch (44:34): [True: 5.07k, False: 29.9k]
  |  |  ------------------
  ------------------
 4135|       |
 4136|  38.5k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4137|       |
 4138|  38.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (4138:12): [True: 7.62k, False: 30.9k]
  ------------------
 4139|  7.62k|        {
 4140|  7.62k|            u1_pos_wd_0_tmp = CLIP3(pu1_src[wd - 1] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.62k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 385, False: 7.24k]
  |  |  |  Branch (40:53): [True: 304, False: 6.94k]
  |  |  ------------------
  ------------------
 4141|  7.62k|        }
 4142|  30.9k|        else
 4143|  30.9k|        {
 4144|  30.9k|            u1_pos_wd_0_tmp = pu1_src[wd - 1];
 4145|  30.9k|        }
 4146|  38.5k|    }
 4147|  11.9k|    else
 4148|  11.9k|    {
 4149|  11.9k|        u1_pos_wd_0_tmp = pu1_src[wd - 1];
 4150|  11.9k|    }
 4151|       |
 4152|       |    /* If bottom-left is available, process separately */
 4153|  50.5k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (4153:8): [True: 39.5k, False: 11.0k]
  ------------------
 4154|  39.5k|    {
 4155|  39.5k|        WORD32 edge_idx;
 4156|       |
 4157|  39.5k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 1 - src_strd]) +
  ------------------
  |  |   44|  39.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 35.5k, False: 4.01k]
  |  |  |  Branch (44:34): [True: 4.29k, False: 31.2k]
  |  |  ------------------
  ------------------
 4158|  39.5k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  39.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 35.3k, False: 4.22k]
  |  |  |  Branch (44:34): [True: 6.36k, False: 28.9k]
  |  |  ------------------
  ------------------
 4159|       |
 4160|  39.5k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4161|       |
 4162|  39.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (4162:12): [True: 7.23k, False: 32.3k]
  ------------------
 4163|  7.23k|        {
 4164|  7.23k|            u1_pos_0_ht_tmp = CLIP3(pu1_src[(ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.23k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 335, False: 6.90k]
  |  |  |  Branch (40:53): [True: 127, False: 6.77k]
  |  |  ------------------
  ------------------
 4165|  7.23k|        }
 4166|  32.3k|        else
 4167|  32.3k|        {
 4168|  32.3k|            u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 4169|  32.3k|        }
 4170|  39.5k|    }
 4171|  11.0k|    else
 4172|  11.0k|    {
 4173|  11.0k|        u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 4174|  11.0k|    }
 4175|       |
 4176|       |
 4177|       |
 4178|       |    /* Update height and source pointers based on the availability flags */
 4179|  50.5k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (4179:8): [True: 7.37k, False: 43.2k]
  ------------------
 4180|  7.37k|    {
 4181|  7.37k|        pu1_src_left_cpy2++;
 4182|  7.37k|        pu1_src_left_str2++;
 4183|  7.37k|        pu1_src_top_cpy = pu1_src;
 4184|  7.37k|        pu1_src += src_strd;
 4185|  7.37k|        ht--;
 4186|  7.37k|    }
 4187|  50.5k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (4187:8): [True: 4.80k, False: 45.7k]
  ------------------
 4188|  4.80k|    {
 4189|  4.80k|        ht--;
 4190|  4.80k|    }
 4191|       |
 4192|       |
 4193|  50.5k|    const2_16x8b = _mm_set1_epi8(2);
 4194|  50.5k|    const0_16x8b = _mm_setzero_si128();
 4195|       |
 4196|       |
 4197|       |    //availability mask creation
 4198|  50.5k|    u1_avail0 = pu1_avail[0];
 4199|  50.5k|    u1_avail1 = pu1_avail[1];
 4200|  50.5k|    au1_mask[0] = u1_avail0;
 4201|  50.5k|    au1_mask[wd - 1] = u1_avail1;
 4202|  50.5k|    {
 4203|  50.5k|        WORD32 ht_rem;
 4204|       |
 4205|  50.5k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 4206|  50.5k|        pu1_src_left_str = pu1_src_left_str2;
 4207|  50.5k|        au1_mask_cpy = au1_mask;
 4208|  94.4k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (4208:23): [True: 43.8k, False: 50.5k]
  ------------------
 4209|  43.8k|        {
 4210|  43.8k|            pu1_src_cpy = pu1_src;
 4211|  43.8k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col + 1));
 4212|       |            //row = 0
 4213|  43.8k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 4214|       |
 4215|       |            //loading the mask
 4216|  43.8k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 4217|       |            //separating +ve and and -ve values.
 4218|  43.8k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 4219|  43.8k|            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|  43.8k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4222|  43.8k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4223|       |            //combining the appropriate sign change
 4224|  43.8k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4225|       |
 4226|   630k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (4226:27): [True: 586k, False: 43.8k]
  ------------------
 4227|   586k|            {
 4228|   586k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
 4229|       |                //row = 1
 4230|   586k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4231|       |                //to insert left in row 1
 4232|   586k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 4233|       |                // row = 0 right
 4234|   586k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 1));
 4235|       |
 4236|       |                //manipulation for row 1 - row 0
 4237|   586k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 4238|       |                //row 0 -row1
 4239|       |                //separating +ve and and -ve values.
 4240|   586k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4241|   586k|                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|   586k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4245|   586k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4246|       |
 4247|       |                //combining the appropriate sign change
 4248|   586k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 4249|       |                //combining sign-left and sign_right
 4250|   586k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 4251|       |
 4252|       |                //row1-row0
 4253|       |                //separating +ve and and -ve values.
 4254|   586k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 4255|   586k|                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|   586k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4258|   586k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4259|       |
 4260|       |                // row = 2
 4261|   586k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 4262|       |                // row = 1 right
 4263|   586k|                signdwn1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 1));
 4264|   586k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 4265|       |
 4266|       |                //bottom - row1
 4267|   586k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4268|   586k|                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|   586k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4271|   586k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4272|       |                //for the next iteration bottom -row1
 4273|   586k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4274|       |
 4275|       |                //to insert left in row 1
 4276|   586k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 13);
 4277|       |                //manipulation for row 1 - bottom
 4278|   586k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4279|       |
 4280|       |                //row1 -bottom
 4281|   586k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4282|   586k|                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|   586k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4285|   586k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4286|       |                //combining the appropriate sign change
 4287|   586k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4288|       |
 4289|       |                //combining sign-left and sign_right
 4290|   586k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 4291|       |
 4292|       |                //eliminating old left for row 0 and row 1
 4293|   586k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 4294|       |
 4295|       |                //row1  getting it right for left of next block
 4296|   586k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 15);
 4297|       |                //adding constant 2
 4298|   586k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4299|   586k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 4300|       |                //shuffle to get sao index
 4301|   586k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4302|   586k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 4303|       |                //using availability mask
 4304|   586k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4305|   586k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 4306|       |                //shuffle to get sao offset
 4307|   586k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4308|   586k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 4309|       |                //row0  getting it right for left of next block
 4310|   586k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4311|       |                //copying the next top
 4312|   586k|                src_top_16x8b = src_temp1_16x8b;
 4313|       |                //cnvert to 16 bit then add and then saturated pack
 4314|   586k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4315|   586k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4316|   586k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4317|   586k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 4318|   586k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4319|   586k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4320|   586k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4321|   586k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 4322|       |
 4323|   586k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 4324|   586k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 4325|   586k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 4326|   586k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 4327|   586k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4328|   586k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 4329|   586k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 4330|   586k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 4331|       |                //store left boundary
 4332|   586k|                _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|   586k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4335|       |                // row = 1
 4336|   586k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 4337|       |
 4338|   586k|                src_temp0_16x8b = src_bottom_16x8b;
 4339|   586k|                pu1_src_cpy += (src_strd << 1);
 4340|   586k|                pu1_src_left_cpy += 2;
 4341|   586k|                pu1_src_left_str += 2;
 4342|   586k|            }
 4343|  43.8k|            ht_rem = ht & 0x1;
 4344|       |
 4345|  43.8k|            if(ht_rem)
  ------------------
  |  Branch (4345:16): [True: 11.1k, False: 32.7k]
  ------------------
 4346|  11.1k|            {
 4347|  11.1k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4348|  11.1k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4349|       |                //to insert left in row 1
 4350|  11.1k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 4351|       |                //manipulation for row 1 - row 0
 4352|  11.1k|                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|  11.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4357|  11.1k|                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|  11.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4360|  11.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4361|       |                //combining the appropriate sign change
 4362|  11.1k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4363|       |                //adding top and bottom and constant 2
 4364|  11.1k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 4365|  11.1k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4366|       |                //eliminating old left for row 0 and row 1
 4367|  11.1k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4368|       |
 4369|  11.1k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4370|       |                //using availability mask
 4371|  11.1k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4372|       |
 4373|  11.1k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4374|       |
 4375|       |                //row0  getting it right for left of next block
 4376|  11.1k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4377|       |                //copying the next top
 4378|  11.1k|                src_top_16x8b = src_temp0_16x8b;
 4379|       |                //cnvert to 16 bit then add and then saturated pack
 4380|  11.1k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4381|  11.1k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4382|  11.1k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4383|  11.1k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 4384|  11.1k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4385|  11.1k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4386|  11.1k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4387|  11.1k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 4388|       |                //store left boundary
 4389|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4390|       |
 4391|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4392|  11.1k|                pu1_src_cpy += (src_strd);
 4393|  11.1k|                src_temp0_16x8b = src_bottom_16x8b;
 4394|  11.1k|                pu1_src_left_cpy++;
 4395|  11.1k|                pu1_src_left_str++;
 4396|  11.1k|            }
 4397|  43.8k|            {   //for bottom right
 4398|  43.8k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4399|  43.8k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4400|  43.8k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4401|  43.8k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4402|  43.8k|            }
 4403|  43.8k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (4403:16): [True: 5.39k, False: 38.4k]
  ------------------
 4404|  5.39k|            {
 4405|  5.39k|                src_top_16x8b = src_bottom_16x8b;
 4406|  5.39k|            }
 4407|       |            //for the top left of next part of the block
 4408|  43.8k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 4409|       |            //updating top flag
 4410|  43.8k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 4411|  43.8k|            pu1_src += 16;
 4412|  43.8k|            au1_mask_cpy += 16;
 4413|       |
 4414|  43.8k|            pu1_left_tmp = pu1_src_left_cpy2;
 4415|  43.8k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 4416|  43.8k|            pu1_src_left_str2 = pu1_left_tmp;
 4417|       |
 4418|  43.8k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4419|  43.8k|            pu1_src_left_str = pu1_src_left_str2;
 4420|  43.8k|        }
 4421|       |
 4422|  50.5k|        wd_rem = wd & 0xF;
 4423|  50.5k|        if(wd_rem)
  ------------------
  |  Branch (4423:12): [True: 48.7k, False: 1.81k]
  ------------------
 4424|  48.7k|        {
 4425|  48.7k|            pu1_src_cpy = pu1_src;
 4426|  48.7k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4427|  48.7k|            pu1_src_left_str = pu1_src_left_str2;
 4428|  48.7k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col + 1));
 4429|       |            //row = 0
 4430|  48.7k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 4431|  48.7k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 4432|       |            //separating +ve and and -ve values.
 4433|  48.7k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 4434|  48.7k|            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|  48.7k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4437|  48.7k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4438|       |            //preparing au1_mask
 4439|  48.7k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 4440|       |            //combining the appropriate sign change
 4441|  48.7k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4442|  48.7k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 4443|       |
 4444|   299k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (4444:27): [True: 250k, False: 48.7k]
  ------------------
 4445|   250k|            {
 4446|   250k|                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|   250k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4449|       |                // row = 2
 4450|   250k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 4451|       |                //manipulation for row 0 -row 1
 4452|   250k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 4453|       |                //row 1 left
 4454|   250k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 4455|       |                //row 0 -row1
 4456|       |                //separating +ve and and -ve values.
 4457|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4458|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4462|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4463|       |                //manipulatiing for row 1 -row 0
 4464|   250k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 1);
 4465|       |                //combining the appropriate sign change
 4466|   250k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4467|       |                //row 1 -row0
 4468|       |                //separating +ve and and -ve values.
 4469|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4470|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4474|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4475|       |                //row1-row0
 4476|   250k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4477|       |
 4478|   250k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 4479|       |
 4480|   250k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 4481|       |                //manipulation for row 1 -row 2
 4482|   250k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 13);
 4483|       |                //row 2 left
 4484|   250k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4485|       |                //packing row 0 n row 1
 4486|   250k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 4487|       |                //row1 -row2
 4488|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4489|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4492|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4493|       |                //combining the appropriate sign change
 4494|   250k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 4495|   250k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 4496|       |
 4497|       |                //row 1 right
 4498|   250k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);
 4499|       |                //row = 3
 4500|   250k|                src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 3 * src_strd));
 4501|       |
 4502|       |                // row = 4
 4503|   250k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 4 * src_strd));
 4504|       |
 4505|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4509|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4513|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4514|       |                //row 2 right
 4515|   250k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 1);
 4516|       |                //combining the appropriate sign change
 4517|   250k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1)
 4518|       |
 4519|       |                //separating +ve and and -ve values.(3,2)
 4520|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 4521|   250k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 4522|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4525|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4526|       |                //manipulation for row 2 -row 3
 4527|   250k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 4528|       |                //row 3 left
 4529|   250k|                signdwn1_16x8b = _mm_alignr_epi8(src_top_16x8b, signdwn1_16x8b, 15);
 4530|       |                //combining the appropriate sign change
 4531|   250k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-2)
 4532|       |
 4533|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4537|   250k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 4538|       |
 4539|       |                //manipulation for row 3 -bottom
 4540|   250k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 11);
 4541|       |                //bottom left
 4542|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4546|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4547|       |                //combining the appropriate sign change
 4548|   250k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 4549|       |
 4550|       |                //separating +ve and and -ve values.(3,bottom)
 4551|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 4552|   250k|                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|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4556|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4557|   250k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8); //aligned left (2-3)
 4558|       |                //combining the appropriate sign change
 4559|   250k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-bottom)
 4560|   250k|                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|   250k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 4565|       |                //packing row 2 n row 3
 4566|   250k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 4567|       |                //row 3 right
 4568|   250k|                signdwn1_16x8b = _mm_srli_si128(src_top_16x8b, 1);
 4569|       |                //loading row 3 right into left
 4570|   250k|                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|   250k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 4573|       |                //separating +ve and and -ve values.(botttom,3)
 4574|   250k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4575|   250k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 4576|       |                //to store right of row 2
 4577|   250k|                signdwn1_16x8b = _mm_slli_si128(src_bottom_16x8b, 8);
 4578|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4579|   250k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4580|   250k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4581|   250k|                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|   250k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4585|       |                //to store right of row 0
 4586|   250k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4587|       |                //storing right of row 1 into left
 4588|   250k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4589|       |
 4590|       |                //adding constant 2
 4591|   250k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4592|   250k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 4593|       |                //shuffle to get sao index
 4594|   250k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4595|   250k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 4596|       |                //using availability mask
 4597|   250k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4598|   250k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 4599|       |                //shuffle to get sao offset
 4600|   250k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4601|   250k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 4602|       |
 4603|       |                //storing right of row 0 into left
 4604|   250k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4605|       |                //cnvert to 16 bit then add and then saturated pack
 4606|   250k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4607|   250k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4608|   250k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4609|   250k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 4610|   250k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4611|   250k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4612|   250k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4613|   250k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 4614|       |
 4615|   250k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 4616|   250k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 4617|   250k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 4618|   250k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 4619|   250k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4620|   250k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 4621|   250k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, cmp_lt0_16x8b);
 4622|   250k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 4623|       |
 4624|   250k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 4625|   250k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 4626|       |
 4627|   250k|                _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|   250k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4630|       |                // row = 1
 4631|   250k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 4632|       |                //row = 2
 4633|   250k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 4634|       |                // row = 3
 4635|   250k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 4636|       |
 4637|   250k|                src_temp0_16x8b = src_temp1_16x8b;
 4638|   250k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 4639|   250k|                pu1_src_cpy += (src_strd << 2);
 4640|   250k|                pu1_src_left_cpy += 4;
 4641|   250k|                pu1_src_left_str += 4;
 4642|   250k|            }
 4643|  48.7k|            ht_rem = ht & 0x2;
 4644|  48.7k|            if(ht_rem)
  ------------------
  |  Branch (4644:16): [True: 11.3k, False: 37.3k]
  ------------------
 4645|  11.3k|            {
 4646|  11.3k|                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|  11.3k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4649|       |                // row = 2
 4650|  11.3k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 4651|       |
 4652|       |                //manipulation for row 0 -row 1
 4653|  11.3k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 4654|       |                //bottom left
 4655|  11.3k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 4656|       |                //separating +ve and and -ve values.
 4657|  11.3k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4658|  11.3k|                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|  11.3k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4662|  11.3k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4663|       |                //manipulation for row 1 - row 0
 4664|  11.3k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 1);
 4665|       |                //combining the appropriate sign change
 4666|  11.3k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4667|       |
 4668|       |                //row1-row0
 4669|       |                //separating +ve and and -ve values.
 4670|  11.3k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4671|  11.3k|                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|  11.3k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4675|  11.3k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4676|       |                //combining the appropriate sign chang
 4677|  11.3k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4678|       |
 4679|       |                //manipulation for row 1 -bottom
 4680|  11.3k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 13);
 4681|       |                //bottom left
 4682|  11.3k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4683|       |
 4684|  11.3k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 4685|  11.3k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 4686|       |                //row1 -bottom
 4687|  11.3k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4688|  11.3k|                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|  11.3k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4692|  11.3k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4693|       |                //combining the appropriate sign change
 4694|  11.3k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 4695|  11.3k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 4696|       |                //manipulation for bottom- row 1 (row 1 right)
 4697|  11.3k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);
 4698|       |                //adding top and down substraction
 4699|  11.3k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 4700|       |                //bottom - row 1
 4701|  11.3k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4702|  11.3k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 4703|       |
 4704|       |                //eliminating old left for row 0,1
 4705|  11.3k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 4706|  11.3k|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 4707|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4708|  11.3k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4709|  11.3k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4710|       |                //for the next iteration signup0_16x8b
 4711|  11.3k|                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|  11.3k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4715|       |                //for storing right of row 1
 4716|  11.3k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4717|       |
 4718|  11.3k|                src_top_16x8b = src_temp1_16x8b;
 4719|       |                //storing right of row 0 into left
 4720|  11.3k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4721|       |
 4722|       |                //adding constant 2
 4723|  11.3k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4724|       |
 4725|       |                //shuffle to get sao index
 4726|  11.3k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4727|       |                //using availability mask
 4728|  11.3k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4729|       |                //shuffle to get sao offset
 4730|  11.3k|                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|  11.3k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4735|  11.3k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4736|  11.3k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4737|  11.3k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 4738|  11.3k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4739|  11.3k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4740|  11.3k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 4741|  11.3k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 4742|       |
 4743|  11.3k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 4744|       |
 4745|  11.3k|                _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|  11.3k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4748|       |                // row = 1
 4749|  11.3k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 4750|  11.3k|                src_temp0_16x8b = src_bottom_16x8b;
 4751|  11.3k|                pu1_src_cpy += (src_strd << 1);
 4752|  11.3k|                pu1_src_left_cpy += 2;
 4753|  11.3k|                pu1_src_left_str += 2;
 4754|  11.3k|            }
 4755|  48.7k|            ht_rem = ht & 0x1;
 4756|  48.7k|            if(ht_rem)
  ------------------
  |  Branch (4756:16): [True: 10.7k, False: 38.0k]
  ------------------
 4757|  10.7k|            {
 4758|  10.7k|                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|  10.7k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4761|       |
 4762|       |
 4763|       |                //manipulation for row 0 -bottom
 4764|  10.7k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 4765|       |                //bottom left
 4766|  10.7k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4767|       |                //separating +ve and and -ve values.
 4768|  10.7k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4769|  10.7k|                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|  10.7k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4772|  10.7k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4773|       |                //combining the appropriate sign change
 4774|  10.7k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4775|       |                //adding top and down substraction
 4776|  10.7k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 4777|       |                //for row 0 right to put into left store
 4778|  10.7k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4779|       |                //adding constant 2
 4780|  10.7k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4781|  10.7k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 4782|  10.7k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 4783|       |                //left store manipulation 1
 4784|  10.7k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4785|       |                //filling the left boundary value
 4786|  10.7k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4787|       |
 4788|       |                //shuffle to get sao index
 4789|  10.7k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4790|       |                //using availability mask
 4791|  10.7k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4792|       |                //shuffle to get sao offset
 4793|  10.7k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4794|  10.7k|                src_top_16x8b = src_temp0_16x8b;
 4795|       |                //cnvert to 16 bit then add and then saturated pack
 4796|  10.7k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4797|  10.7k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4798|  10.7k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4799|  10.7k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4800|  10.7k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 4801|       |
 4802|  10.7k|                _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|  10.7k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4805|  10.7k|                pu1_src_cpy += (src_strd);
 4806|  10.7k|                src_temp0_16x8b = src_bottom_16x8b;
 4807|  10.7k|                pu1_src_left_cpy++;
 4808|  10.7k|                pu1_src_left_str++;
 4809|  10.7k|            }
 4810|  48.7k|            {   //for bottom right
 4811|  48.7k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4812|  48.7k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4813|  48.7k|                src_temp0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4814|  48.7k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4815|  48.7k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4816|  48.7k|            }
 4817|  48.7k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (4817:16): [True: 4.76k, False: 43.9k]
  ------------------
 4818|  4.76k|            {
 4819|  4.76k|                src_top_16x8b = src_bottom_16x8b;
 4820|  4.76k|            }
 4821|  48.7k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 4822|  48.7k|            pu1_src += 8;
 4823|       |
 4824|  48.7k|            pu1_left_tmp = pu1_src_left_cpy2;
 4825|  48.7k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 4826|  48.7k|            pu1_src_left_str2 = pu1_left_tmp;
 4827|       |
 4828|  48.7k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4829|  48.7k|            pu1_src_left_str = pu1_src_left_str2;
 4830|       |
 4831|  48.7k|        }
 4832|  50.5k|        pu1_src_org[wd - 1] = u1_pos_wd_0_tmp;
 4833|  50.5k|        pu1_src_org[(ht_tmp - 1) * src_strd] = u1_pos_0_ht_tmp;
 4834|  50.5k|        pu1_src_left_cpy = (0 == pu1_avail[2]) ? (pu1_src_left_cpy - 1) : pu1_src_left_cpy;
  ------------------
  |  Branch (4834:28): [True: 7.37k, False: 43.2k]
  ------------------
 4835|  50.5k|        pu1_src_left[0] = au1_src_left_tmp[0];
 4836|  1.07M|        for(row = 1; row < ht_tmp; row++)
  ------------------
  |  Branch (4836:22): [True: 1.02M, False: 50.5k]
  ------------------
 4837|  1.02M|        {
 4838|  1.02M|            pu1_src_left[row] = pu1_src_left_cpy[row];
 4839|  1.02M|        }
 4840|  50.5k|    }
 4841|       |
 4842|  50.5k|}
ihevc_sao_edge_offset_class3_chroma_ssse3:
 4856|  74.2k|{
 4857|  74.2k|    WORD32 row, col;
 4858|  74.2k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 4859|  74.2k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 4860|  74.2k|    UWORD8 au1_src_left_tmp[2 * (MAX_CTB_SIZE + 8)];
 4861|  74.2k|    UWORD8 au1_mask[2 * MAX_CTB_SIZE], *au1_mask_cpy;
 4862|  74.2k|    WORD32 wd_rem;
 4863|  74.2k|    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|  74.2k|    WORD32 ht_tmp;
 4865|  74.2k|    WORD32 bit_depth;
 4866|  74.2k|    UWORD8 u1_avail0, u1_avail1;
 4867|       |
 4868|  74.2k|    __m128i src_top_16x8b, src_bottom_16x8b;
 4869|  74.2k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 4870|  74.2k|    __m128i signup0_16x8b, signdwn1_16x8b;
 4871|  74.2k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 4872|  74.2k|    __m128i edge0_16x8b, edge1_16x8b;
 4873|  74.2k|    __m128i au1_mask8x16b;
 4874|  74.2k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 4875|  74.2k|    __m128i left_store_16x8b;
 4876|  74.2k|    __m128i const0_16x8b, const2_16x8b;
 4877|  74.2k|    __m128i chroma_offset_8x16b;
 4878|       |
 4879|  74.2k|    ht_tmp = ht;
 4880|  74.2k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 4881|       |
 4882|       |
 4883|  74.2k|    au1_src_left_tmp[0] = pu1_src[(wd - 2)];
 4884|  74.2k|    au1_src_left_tmp[1] = pu1_src[(wd - 1)];
 4885|       |    //manipulation for bottom left
 4886|  1.48M|    for(row = 2; row < 2 * ht; row++)
  ------------------
  |  Branch (4886:18): [True: 1.40M, False: 74.2k]
  ------------------
 4887|  1.40M|    {
 4888|  1.40M|        au1_src_left_tmp[row] = pu1_src_left[row];
 4889|  1.40M|    }
 4890|  74.2k|    au1_src_left_tmp[2 * ht] = pu1_src_bot_left[0];
 4891|  74.2k|    au1_src_left_tmp[2 * ht + 1] = pu1_src_bot_left[1];
 4892|       |
 4893|  74.2k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 4894|  74.2k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
 4895|       |    //setting availability mask to ff size MAX_CTB_SIZE
 4896|   669k|    for(col = 0; col < 2 * MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   669k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (4896:18): [True: 595k, False: 74.2k]
  ------------------
 4897|   595k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 4898|  74.2k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  74.2k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  74.2k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4899|  74.2k|    pu1_src_org = pu1_src;
 4900|  74.2k|    pu1_src_top_cpy = pu1_src_top;
 4901|  74.2k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 4902|  74.2k|    pu1_src_left_cpy = au1_src_left_tmp;
 4903|  74.2k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 4904|  74.2k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 4905|  74.2k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 4906|  74.2k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 4907|       |    /* If top-right is available, process separately */
 4908|  74.2k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (4908:8): [True: 50.5k, False: 23.7k]
  ------------------
 4909|  50.5k|    {
 4910|  50.5k|        WORD32 edge_idx;
 4911|       |
 4912|       |        /* U */
 4913|  50.5k|        edge_idx = 2 + SIGN(pu1_src[wd - 2] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  50.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 45.3k, False: 5.16k]
  |  |  |  Branch (44:34): [True: 4.98k, False: 40.3k]
  |  |  ------------------
  ------------------
 4914|  50.5k|                        SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 - 2 + src_strd]);
  ------------------
  |  |   44|  50.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 46.9k, False: 3.59k]
  |  |  |  Branch (44:34): [True: 3.64k, False: 43.2k]
  |  |  ------------------
  ------------------
 4915|       |
 4916|  50.5k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4917|       |
 4918|  50.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (4918:12): [True: 8.64k, False: 41.8k]
  ------------------
 4919|  8.64k|        {
 4920|  8.64k|            u1_pos_wd_0_tmp_u = CLIP3(pu1_src[wd - 2] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.64k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 446, False: 8.19k]
  |  |  |  Branch (40:53): [True: 626, False: 7.57k]
  |  |  ------------------
  ------------------
 4921|  8.64k|        }
 4922|  41.8k|        else
 4923|  41.8k|        {
 4924|  41.8k|            u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 4925|  41.8k|        }
 4926|       |
 4927|       |        /* V */
 4928|  50.5k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[1]) +
  ------------------
  |  |   44|  50.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 45.4k, False: 5.00k]
  |  |  |  Branch (44:34): [True: 5.04k, False: 40.4k]
  |  |  ------------------
  ------------------
 4929|  50.5k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 2 + src_strd]);
  ------------------
  |  |   44|  50.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 47.0k, False: 3.46k]
  |  |  |  Branch (44:34): [True: 3.54k, False: 43.5k]
  |  |  ------------------
  ------------------
 4930|       |
 4931|  50.5k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4932|       |
 4933|  50.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (4933:12): [True: 8.64k, False: 41.8k]
  ------------------
 4934|  8.64k|        {
 4935|  8.64k|            u1_pos_wd_0_tmp_v = CLIP3(pu1_src[wd - 1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.64k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 411, False: 8.23k]
  |  |  |  Branch (40:53): [True: 575, False: 7.66k]
  |  |  ------------------
  ------------------
 4936|  8.64k|        }
 4937|  41.8k|        else
 4938|  41.8k|        {
 4939|  41.8k|            u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 4940|  41.8k|        }
 4941|  50.5k|    }
 4942|  23.7k|    else
 4943|  23.7k|    {
 4944|  23.7k|        u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 4945|  23.7k|        u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 4946|  23.7k|    }
 4947|       |
 4948|       |    /* If bottom-left is available, process separately */
 4949|  74.2k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (4949:8): [True: 53.6k, False: 20.6k]
  ------------------
 4950|  53.6k|    {
 4951|  53.6k|        WORD32 edge_idx;
 4952|       |
 4953|       |        /* U */
 4954|  53.6k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 2 - src_strd]) +
  ------------------
  |  |   44|  53.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 50.2k, False: 3.34k]
  |  |  |  Branch (44:34): [True: 3.77k, False: 46.4k]
  |  |  ------------------
  ------------------
 4955|  53.6k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  53.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 48.6k, False: 4.97k]
  |  |  |  Branch (44:34): [True: 5.08k, False: 43.5k]
  |  |  ------------------
  ------------------
 4956|       |
 4957|  53.6k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4958|       |
 4959|  53.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (4959:12): [True: 8.53k, False: 45.0k]
  ------------------
 4960|  8.53k|        {
 4961|  8.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|  8.53k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 459, False: 8.07k]
  |  |  |  Branch (40:53): [True: 746, False: 7.33k]
  |  |  ------------------
  ------------------
 4962|  8.53k|        }
 4963|  45.0k|        else
 4964|  45.0k|        {
 4965|  45.0k|            u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 4966|  45.0k|        }
 4967|       |
 4968|       |        /* V */
 4969|  53.6k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src[(ht - 1) * src_strd + 1 + 2 - src_strd]) +
  ------------------
  |  |   44|  53.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 50.6k, False: 2.98k]
  |  |  |  Branch (44:34): [True: 3.61k, False: 47.0k]
  |  |  ------------------
  ------------------
 4970|  53.6k|                        SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src_bot_left[1]);
  ------------------
  |  |   44|  53.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 48.7k, False: 4.81k]
  |  |  |  Branch (44:34): [True: 5.22k, False: 43.5k]
  |  |  ------------------
  ------------------
 4971|       |
 4972|  53.6k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4973|       |
 4974|  53.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (4974:12): [True: 8.49k, False: 45.1k]
  ------------------
 4975|  8.49k|        {
 4976|  8.49k|            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.49k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 502, False: 7.99k]
  |  |  |  Branch (40:53): [True: 665, False: 7.32k]
  |  |  ------------------
  ------------------
 4977|  8.49k|        }
 4978|  45.1k|        else
 4979|  45.1k|        {
 4980|  45.1k|            u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 4981|  45.1k|        }
 4982|  53.6k|    }
 4983|  20.6k|    else
 4984|  20.6k|    {
 4985|  20.6k|        u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 4986|  20.6k|        u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 4987|  20.6k|    }
 4988|       |
 4989|       |
 4990|       |
 4991|       |    /* Update height and source pointers based on the availability flags */
 4992|  74.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (4992:8): [True: 16.5k, False: 57.6k]
  ------------------
 4993|  16.5k|    {
 4994|  16.5k|        pu1_src_left_cpy2 += 2;
 4995|  16.5k|        pu1_src_top_cpy = pu1_src;
 4996|  16.5k|        pu1_src += src_strd;
 4997|  16.5k|        ht--;
 4998|  16.5k|    }
 4999|  74.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (4999:8): [True: 10.2k, False: 63.9k]
  ------------------
 5000|  10.2k|    {
 5001|  10.2k|        ht--;
 5002|  10.2k|    }
 5003|       |
 5004|  74.2k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 5005|  74.2k|    const2_16x8b = _mm_set1_epi8(2);
 5006|  74.2k|    const0_16x8b = _mm_setzero_si128();
 5007|       |
 5008|       |
 5009|       |    //availability mask creation
 5010|  74.2k|    u1_avail0 = pu1_avail[0];
 5011|  74.2k|    u1_avail1 = pu1_avail[1];
 5012|  74.2k|    au1_mask[0] = u1_avail0;
 5013|  74.2k|    au1_mask[1] = u1_avail0;
 5014|  74.2k|    au1_mask[wd - 1] = u1_avail1;
 5015|  74.2k|    au1_mask[wd - 2] = u1_avail1;
 5016|  74.2k|    {
 5017|  74.2k|        WORD32 ht_rem;
 5018|  74.2k|        au1_mask_cpy = au1_mask;
 5019|   161k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (5019:23): [True: 87.0k, False: 74.2k]
  ------------------
 5020|  87.0k|        {
 5021|  87.0k|            pu1_src_cpy = pu1_src;
 5022|  87.0k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col + 2));
 5023|       |            //row = 0
 5024|  87.0k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 5025|       |
 5026|       |            //loading the mask
 5027|  87.0k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 5028|       |            //separating +ve and and -ve values.
 5029|  87.0k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 5030|  87.0k|            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|  87.0k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5033|  87.0k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5034|       |            //combining the appropriate sign change
 5035|  87.0k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5036|  87.0k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 5037|       |
 5038|   594k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (5038:27): [True: 507k, False: 87.0k]
  ------------------
 5039|   507k|            {
 5040|   507k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
 5041|       |                //row = 1
 5042|   507k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5043|       |                //to insert left in row 1
 5044|   507k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 12);
 5045|       |                // row = 0 right
 5046|   507k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2));
 5047|       |
 5048|       |                //manipulation for row 1 - row 0
 5049|   507k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 5050|       |                //row 0 -row1
 5051|       |                //separating +ve and and -ve values.
 5052|   507k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5053|   507k|                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|   507k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5057|   507k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5058|       |
 5059|       |                //combining the appropriate sign change
 5060|   507k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 5061|       |                //combining sign-left and sign_right
 5062|   507k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 5063|       |
 5064|       |                //row1-row0
 5065|       |                //separating +ve and and -ve values.
 5066|   507k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 5067|   507k|                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|   507k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5070|   507k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5071|       |
 5072|       |                // row = 2
 5073|   507k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 5074|       |                // row = 1 right
 5075|   507k|                signdwn1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 2));
 5076|   507k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 5077|       |
 5078|       |                //bottom - row1
 5079|   507k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5080|   507k|                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|   507k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5083|   507k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5084|       |                //for the next iteration bottom -row1
 5085|   507k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5086|       |
 5087|       |                //to insert left in row 1
 5088|   507k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 10);
 5089|       |                //manipulation for row 1 - bottom
 5090|   507k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5091|       |
 5092|       |                //row1 -bottom
 5093|   507k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5094|   507k|                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|   507k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5097|   507k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5098|       |                //combining the appropriate sign change
 5099|   507k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5100|       |
 5101|       |                //combining sign-left and sign_right
 5102|   507k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 5103|       |
 5104|       |                //eliminating old left for row 0 and row 1
 5105|   507k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 5106|       |                //row1  getting it right for left of next block
 5107|   507k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 14);
 5108|       |                //row0  getting it right for left of next block
 5109|   507k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5110|       |                //copying the next top
 5111|   507k|                src_top_16x8b = src_temp1_16x8b;
 5112|       |
 5113|       |
 5114|       |                //adding constant 2
 5115|   507k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5116|   507k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 5117|       |                //shuffle to get sao index
 5118|   507k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5119|   507k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 5120|       |                //using availability mask
 5121|   507k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5122|   507k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 5123|       |
 5124|       |                //adding chroma offset to access U and V
 5125|   507k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5126|   507k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 5127|       |
 5128|       |                //shuffle to get sao offset
 5129|   507k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5130|   507k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 5131|       |                //cnvert to 16 bit then add and then saturated pack
 5132|   507k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5133|   507k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5134|   507k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5135|   507k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 5136|   507k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5137|   507k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5138|   507k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 5139|   507k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 5140|       |
 5141|   507k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 5142|   507k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 5143|   507k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 5144|   507k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 5145|   507k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 5146|   507k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5147|   507k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 5148|   507k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 5149|       |                //store left boundary
 5150|   507k|                _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|   507k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5153|       |                // row = 1
 5154|   507k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 5155|       |
 5156|   507k|                src_temp0_16x8b = src_bottom_16x8b;
 5157|   507k|                pu1_src_cpy += (src_strd << 1);
 5158|   507k|                pu1_src_left_cpy += 4;
 5159|   507k|            }
 5160|  87.0k|            ht_rem = ht & 0x1;
 5161|       |
 5162|  87.0k|            if(ht_rem)
  ------------------
  |  Branch (5162:16): [True: 30.2k, False: 56.8k]
  ------------------
 5163|  30.2k|            {
 5164|  30.2k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5165|  30.2k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5166|       |                //to insert left in row 1
 5167|  30.2k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 12);
 5168|       |                //manipulation for row 1 - row 0
 5169|  30.2k|                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.2k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5174|  30.2k|                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.2k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5177|  30.2k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5178|       |                //combining the appropriate sign change
 5179|  30.2k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5180|       |                //adding top and bottom and constant 2
 5181|  30.2k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 5182|  30.2k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5183|       |                //eliminating old left for row 0 and row 1
 5184|  30.2k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5185|       |                //row0  getting it right for left of next block
 5186|  30.2k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5187|       |                //copying the next top
 5188|  30.2k|                src_top_16x8b = src_temp0_16x8b;
 5189|       |
 5190|  30.2k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5191|       |                //using availability mask
 5192|  30.2k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5193|       |
 5194|       |                //adding chroma offset to access U and V
 5195|  30.2k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5196|       |
 5197|       |
 5198|  30.2k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5199|       |
 5200|       |                //cnvert to 16 bit then add and then saturated pack
 5201|  30.2k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5202|  30.2k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5203|  30.2k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5204|  30.2k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 5205|  30.2k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5206|  30.2k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5207|  30.2k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 5208|  30.2k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 5209|       |
 5210|       |                //store left boundary
 5211|  30.2k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5212|       |
 5213|  30.2k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5214|  30.2k|                pu1_src_cpy += (src_strd);
 5215|  30.2k|                src_temp0_16x8b = src_bottom_16x8b;
 5216|  30.2k|                pu1_src_left_cpy += 2;
 5217|  30.2k|            }
 5218|  87.0k|            {   //for bottom right
 5219|  87.0k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5220|  87.0k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5221|  87.0k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5222|  87.0k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5223|  87.0k|            }
 5224|  87.0k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (5224:16): [True: 11.7k, False: 75.3k]
  ------------------
 5225|  11.7k|            {
 5226|  11.7k|                src_top_16x8b = src_bottom_16x8b;
 5227|  11.7k|            }
 5228|       |            //for the top left of next part of the block
 5229|  87.0k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 5230|       |            //updating top flag
 5231|  87.0k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 5232|  87.0k|            pu1_src += 16;
 5233|  87.0k|            au1_mask_cpy += 16;
 5234|  87.0k|        }
 5235|  74.2k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 5236|  74.2k|        wd_rem = wd & 0xF;
 5237|  74.2k|        if(wd_rem)
  ------------------
  |  Branch (5237:12): [True: 6.63k, False: 67.5k]
  ------------------
 5238|  6.63k|        {
 5239|  6.63k|            pu1_src_cpy = pu1_src;
 5240|  6.63k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col + 2));
 5241|       |            //row = 0
 5242|  6.63k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 5243|  6.63k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 5244|       |            //separating +ve and and -ve values.
 5245|  6.63k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 5246|  6.63k|            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|  6.63k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5249|  6.63k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5250|       |            //preparing au1_mask
 5251|  6.63k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 5252|       |            //combining the appropriate sign change
 5253|  6.63k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5254|  6.63k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 5255|  6.63k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 5256|  18.7k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (5256:27): [True: 12.1k, False: 6.63k]
  ------------------
 5257|  12.1k|            {
 5258|  12.1k|                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|  12.1k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5261|       |                // row = 2
 5262|  12.1k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 5263|       |                //manipulation for row 0 -row 1
 5264|  12.1k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 5265|       |                //row 1 left
 5266|  12.1k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 5267|       |                //row 0 -row1
 5268|       |                //separating +ve and and -ve values.
 5269|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5270|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5274|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5275|       |                //manipulatiing for row 1 -row 0
 5276|  12.1k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 2);
 5277|       |                //combining the appropriate sign change
 5278|  12.1k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5279|       |                //row 1 -row0
 5280|       |                //separating +ve and and -ve values.
 5281|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5282|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5286|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5287|       |                //row1-row0
 5288|  12.1k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5289|       |
 5290|  12.1k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 5291|       |
 5292|  12.1k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 5293|       |                //manipulation for row 1 -row 2
 5294|  12.1k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 10);
 5295|       |                //row 2 left
 5296|  12.1k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5297|       |                //packing row 0 n row 1
 5298|  12.1k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 5299|       |                //row1 -row2
 5300|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5301|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5304|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5305|       |                //combining the appropriate sign change
 5306|  12.1k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 5307|  12.1k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 5308|       |
 5309|       |                //row 1 right
 5310|  12.1k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 5311|       |                //row = 3
 5312|  12.1k|                src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 3 * src_strd));
 5313|       |
 5314|       |                // row = 4
 5315|  12.1k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 4 * src_strd));
 5316|       |
 5317|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5321|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5325|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5326|       |                //row 2 right
 5327|  12.1k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 5328|       |                //combining the appropriate sign change
 5329|  12.1k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1)
 5330|       |
 5331|       |                //separating +ve and and -ve values.(3,2)
 5332|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 5333|  12.1k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 5334|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5337|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5338|       |                //manipulation for row 2 -row 3
 5339|  12.1k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 8);
 5340|       |                //row 3 left
 5341|  12.1k|                signdwn1_16x8b = _mm_alignr_epi8(src_top_16x8b, signdwn1_16x8b, 14);
 5342|       |                //combining the appropriate sign change
 5343|  12.1k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-2)
 5344|       |
 5345|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5349|  12.1k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 5350|       |
 5351|       |                //manipulation for row 3 -bottom
 5352|  12.1k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 6);
 5353|       |                //bottom left
 5354|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5358|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5359|       |                //combining the appropriate sign change
 5360|  12.1k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 5361|       |
 5362|       |                //separating +ve and and -ve values.(3,bottom)
 5363|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 5364|  12.1k|                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|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5368|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5369|  12.1k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8); //aligned left (2-3)
 5370|       |                //combining the appropriate sign change
 5371|  12.1k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-bottom)
 5372|  12.1k|                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|  12.1k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 8);
 5377|       |                //packing row 2 n row 3
 5378|  12.1k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 5379|       |                //row 3 right
 5380|  12.1k|                signdwn1_16x8b = _mm_srli_si128(src_top_16x8b, 2);
 5381|       |                //loading row 3 right into left
 5382|  12.1k|                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|  12.1k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 5385|       |                //separating +ve and and -ve values.(botttom,3)
 5386|  12.1k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5387|  12.1k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 5388|       |                //to store right of row 2
 5389|  12.1k|                signdwn1_16x8b = _mm_slli_si128(src_bottom_16x8b, 8);
 5390|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5391|  12.1k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5392|  12.1k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5393|  12.1k|                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|  12.1k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5397|       |                //to store right of row 0
 5398|  12.1k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5399|       |                //storing right of row 1 into left
 5400|  12.1k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5401|       |                //storing right of row 0 into left
 5402|  12.1k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5403|       |
 5404|       |
 5405|       |                //adding constant 2
 5406|  12.1k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5407|  12.1k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 5408|       |                //shuffle to get sao index
 5409|  12.1k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5410|  12.1k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 5411|       |                //using availability mask
 5412|  12.1k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5413|  12.1k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 5414|       |                //adding chroma offset to access U and V
 5415|  12.1k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5416|  12.1k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 5417|       |                //shuffle to get sao offset
 5418|  12.1k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5419|  12.1k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 5420|       |
 5421|       |                //cnvert to 16 bit then add and then saturated pack
 5422|  12.1k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5423|  12.1k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5424|  12.1k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5425|  12.1k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 5426|  12.1k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5427|  12.1k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5428|  12.1k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 5429|  12.1k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 5430|       |
 5431|  12.1k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 5432|  12.1k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 5433|  12.1k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 5434|  12.1k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 5435|  12.1k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 5436|  12.1k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5437|  12.1k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, edge1_16x8b);
 5438|  12.1k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 5439|       |
 5440|  12.1k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 5441|  12.1k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 5442|  12.1k|                _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|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5445|       |                // row = 1
 5446|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 5447|       |                //row = 2
 5448|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 5449|       |                // row = 3
 5450|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 5451|       |
 5452|  12.1k|                src_temp0_16x8b = src_temp1_16x8b;
 5453|  12.1k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 5454|  12.1k|                pu1_src_cpy += (src_strd << 2);
 5455|  12.1k|                pu1_src_left_cpy += 8;
 5456|  12.1k|            }
 5457|  6.63k|            ht_rem = ht & 0x2;
 5458|  6.63k|            if(ht_rem)
  ------------------
  |  Branch (5458:16): [True: 1.96k, False: 4.67k]
  ------------------
 5459|  1.96k|            {
 5460|  1.96k|                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|  1.96k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5463|       |                // row = 2
 5464|  1.96k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 5465|       |
 5466|       |                //manipulation for row 0 -row 1
 5467|  1.96k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 5468|       |                //bottom left
 5469|  1.96k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 5470|       |                //separating +ve and and -ve values.
 5471|  1.96k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5472|  1.96k|                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|  1.96k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5476|  1.96k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5477|       |                //manipulation for row 1 - row 0
 5478|  1.96k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 2);
 5479|       |                //combining the appropriate sign change
 5480|  1.96k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5481|       |
 5482|       |                //row1-row0
 5483|       |                //separating +ve and and -ve values.
 5484|  1.96k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5485|  1.96k|                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|  1.96k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5489|  1.96k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5490|       |                //combining the appropriate sign chang
 5491|  1.96k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5492|       |
 5493|       |                //manipulation for row 1 -bottom
 5494|  1.96k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 10);
 5495|       |                //bottom left
 5496|  1.96k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5497|       |
 5498|  1.96k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 5499|  1.96k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 5500|       |                //row1 -bottom
 5501|  1.96k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5502|  1.96k|                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|  1.96k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5506|  1.96k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5507|       |                //combining the appropriate sign change
 5508|  1.96k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 5509|  1.96k|                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|  1.96k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 5513|       |                //adding top and down substraction
 5514|  1.96k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 5515|       |                //bottom - row 1
 5516|  1.96k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5517|  1.96k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 5518|       |
 5519|       |                //eliminating old left for row 0,1
 5520|  1.96k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 5521|  1.96k|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 5522|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5523|  1.96k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5524|  1.96k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5525|       |                //for the next iteration signup0_16x8b
 5526|  1.96k|                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|  1.96k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5530|       |                //for storing right of row 1
 5531|  1.96k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5532|       |
 5533|  1.96k|                src_top_16x8b = src_temp1_16x8b;
 5534|       |                //storing right of row 0 into left
 5535|  1.96k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5536|       |
 5537|       |                //adding constant 2
 5538|  1.96k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5539|       |
 5540|       |                //shuffle to get sao index
 5541|  1.96k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5542|       |                //using availability mask
 5543|  1.96k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5544|       |                //adding chroma offset to access U and V
 5545|  1.96k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5546|       |                //shuffle to get sao offset
 5547|  1.96k|                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|  1.96k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5551|  1.96k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5552|  1.96k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5553|  1.96k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 5554|  1.96k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5555|  1.96k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 5556|  1.96k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge0_16x8b);
 5557|  1.96k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 5558|       |
 5559|  1.96k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 5560|       |
 5561|  1.96k|                _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|  1.96k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5564|       |                // row = 1
 5565|  1.96k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 5566|  1.96k|                src_temp0_16x8b = src_bottom_16x8b;
 5567|  1.96k|                pu1_src_cpy += (src_strd << 1);
 5568|  1.96k|                pu1_src_left_cpy += 4;
 5569|  1.96k|            }
 5570|  6.63k|            ht_rem = ht & 0x1;
 5571|  6.63k|            if(ht_rem)
  ------------------
  |  Branch (5571:16): [True: 1.88k, False: 4.74k]
  ------------------
 5572|  1.88k|            {
 5573|  1.88k|                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|  1.88k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5576|       |
 5577|       |
 5578|       |                //manipulation for row 0 -bottom
 5579|  1.88k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 5580|       |                //bottom left
 5581|  1.88k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5582|       |                //separating +ve and and -ve values.
 5583|  1.88k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5584|  1.88k|                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|  1.88k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5587|  1.88k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5588|       |                //combining the appropriate sign change
 5589|  1.88k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5590|       |                //adding top and down substraction
 5591|  1.88k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 5592|       |                //for row 0 right to put into left store
 5593|  1.88k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5594|       |                //adding constant 2
 5595|  1.88k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5596|  1.88k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 5597|  1.88k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 5598|       |                //left store manipulation 1
 5599|  1.88k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5600|       |                //filling the left boundary value
 5601|  1.88k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5602|  1.88k|                src_top_16x8b = src_temp0_16x8b;
 5603|       |
 5604|       |                //shuffle to get sao index
 5605|  1.88k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5606|       |                //using availability mask
 5607|  1.88k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5608|       |                //adding chroma offset to access U and V
 5609|  1.88k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5610|       |                //shuffle to get sao offset
 5611|  1.88k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5612|       |
 5613|       |                //cnvert to 16 bit then add and then saturated pack
 5614|  1.88k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5615|  1.88k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5616|  1.88k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5617|  1.88k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 5618|  1.88k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 5619|       |
 5620|  1.88k|                _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|  1.88k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5623|  1.88k|                pu1_src_cpy += (src_strd);
 5624|  1.88k|                src_temp0_16x8b = src_bottom_16x8b;
 5625|  1.88k|                pu1_src_left_cpy += 2;
 5626|  1.88k|            }
 5627|  6.63k|            {   //for bottom right
 5628|  6.63k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5629|  6.63k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5630|  6.63k|                src_temp0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5631|  6.63k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5632|  6.63k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5633|  6.63k|            }
 5634|  6.63k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (5634:16): [True: 927, False: 5.70k]
  ------------------
 5635|    927|            {
 5636|    927|                src_top_16x8b = src_bottom_16x8b;
 5637|    927|            }
 5638|       |
 5639|  6.63k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 5640|  6.63k|            pu1_src += 8;
 5641|  6.63k|        }
 5642|  74.2k|        pu1_src_org[wd - 2] = u1_pos_wd_0_tmp_u;
 5643|  74.2k|        pu1_src_org[wd - 1] = u1_pos_wd_0_tmp_v;
 5644|  74.2k|        pu1_src_org[(ht_tmp - 1) * src_strd] = u1_pos_0_ht_tmp_u;
 5645|  74.2k|        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.56M, False: 74.2k]
  ------------------
 5647|  1.56M|        {
 5648|  1.56M|            pu1_src_left[row] = au1_src_left_tmp[row];
 5649|  1.56M|        }
 5650|  74.2k|    }
 5651|       |
 5652|  74.2k|}

ihevc_weighted_pred_uni_sse42:
  120|  55.9k|{
  121|  55.9k|    WORD32 row, col, temp;
  122|  55.9k|    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|  55.9k|    __m128i src_temp0_4x32b, src_temp1_4x32b, src_temp2_4x32b, src_temp3_4x32b;
  127|  55.9k|    __m128i const_temp_4x32b, lvl_shift_4x32b, wgt0_4x32b, off0_4x32b;
  128|       |
  129|  55.9k|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  55.9k|#define ASSERT(x) {}
  ------------------
  130|  55.9k|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  55.9k|#define ASSERT(x) {}
  ------------------
  131|       |
  132|  55.9k|    temp = 1 << (shift - 1);
  133|       |
  134|       |    // seting values in register
  135|  55.9k|    const_temp_4x32b = _mm_set1_epi32(temp);
  136|  55.9k|    lvl_shift_4x32b = _mm_set1_epi32(lvl_shift);
  137|  55.9k|    wgt0_4x32b = _mm_set1_epi32(wgt0);
  138|  55.9k|    off0_4x32b = _mm_set1_epi32(off0);
  139|       |
  140|  55.9k|    if(0 == (wd & 7)) /* wd multiple of 8 case */
  ------------------
  |  Branch (140:8): [True: 50.1k, False: 5.79k]
  ------------------
  141|  50.1k|    {
  142|  50.1k|        __m128i src_temp4_4x32b, src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b;
  143|       |
  144|       |        /*  outer for loop starts from here */
  145|   175k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (145:22): [True: 124k, False: 50.1k]
  ------------------
  146|   124k|        {
  147|   385k|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (147:26): [True: 261k, False: 124k]
  ------------------
  148|   261k|            {   /* for row =0 ,1,2,3*/
  149|       |
  150|       |                /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  151|   261k|                src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
  152|       |                /* row = 1 */
  153|   261k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  154|       |                /* row = 2 */
  155|   261k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 2 * src_strd));
  156|       |                /* row = 3 */
  157|   261k|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 3 * src_strd));
  158|       |
  159|       |                /* row = 0 */ /* Last 4 pixels */
  160|   261k|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 4));
  161|       |                /* row = 1 */
  162|   261k|                src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 4));
  163|       |                /* row = 2 */
  164|   261k|                src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 2 * src_strd + 4));
  165|       |                /* row = 3 */
  166|   261k|                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|   261k|                src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  170|   261k|                src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  171|   261k|                src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  172|   261k|                src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  173|       |
  174|       |                /* (pi2_src[col] + lvl_shift)*/ /* First 4 pixels */
  175|   261k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
  176|   261k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
  177|   261k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
  178|   261k|                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|   261k|                src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
  182|   261k|                src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
  183|   261k|                src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
  184|   261k|                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|   261k|                src_temp4_4x32b  = _mm_cvtepi16_epi32(src_temp4_4x32b);
  188|   261k|                src_temp5_4x32b  = _mm_cvtepi16_epi32(src_temp5_4x32b);
  189|   261k|                src_temp6_4x32b  = _mm_cvtepi16_epi32(src_temp6_4x32b);
  190|   261k|                src_temp7_4x32b  = _mm_cvtepi16_epi32(src_temp7_4x32b);
  191|       |
  192|       |                /* (pi2_src[col] + lvl_shift)*/ /* Last 4 pixels */
  193|   261k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift_4x32b);
  194|   261k|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift_4x32b);
  195|   261k|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift_4x32b);
  196|   261k|                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|   261k|                src_temp4_4x32b  = _mm_mullo_epi32(src_temp4_4x32b, wgt0_4x32b);
  200|   261k|                src_temp5_4x32b  = _mm_mullo_epi32(src_temp5_4x32b, wgt0_4x32b);
  201|   261k|                src_temp6_4x32b  = _mm_mullo_epi32(src_temp6_4x32b, wgt0_4x32b);
  202|   261k|                src_temp7_4x32b  = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
  203|       |
  204|       |                /* i4_tmp += 1 << (shift - 1) */ /* First 4 pixels */
  205|   261k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
  206|   261k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
  207|   261k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
  208|   261k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
  209|       |
  210|       |                /* (i4_tmp >> shift) */ /* First 4 pixels */
  211|   261k|                src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b, shift);
  212|   261k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b, shift);
  213|   261k|                src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b, shift);
  214|   261k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b, shift);
  215|       |
  216|       |                /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
  217|   261k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, const_temp_4x32b);
  218|   261k|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
  219|   261k|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, const_temp_4x32b);
  220|   261k|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
  221|       |
  222|       |                /* (i4_tmp >> shift) */ /* Last 4 pixels */
  223|   261k|                src_temp4_4x32b = _mm_srai_epi32(src_temp4_4x32b, shift);
  224|   261k|                src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b, shift);
  225|   261k|                src_temp6_4x32b = _mm_srai_epi32(src_temp6_4x32b, shift);
  226|   261k|                src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b, shift);
  227|       |
  228|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */ /* First 4 pixels */
  229|   261k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
  230|   261k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
  231|   261k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
  232|   261k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
  233|       |
  234|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  235|   261k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, off0_4x32b);
  236|   261k|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, off0_4x32b);
  237|   261k|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, off0_4x32b);
  238|   261k|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, off0_4x32b);
  239|       |
  240|   261k|                src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp4_4x32b);
  241|   261k|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp5_4x32b);
  242|   261k|                src_temp2_4x32b = _mm_packs_epi32(src_temp2_4x32b, src_temp6_4x32b);
  243|   261k|                src_temp3_4x32b = _mm_packs_epi32(src_temp3_4x32b, src_temp7_4x32b);
  244|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  245|   261k|                src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp0_4x32b);
  246|   261k|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
  247|   261k|                src_temp2_4x32b = _mm_packus_epi16(src_temp2_4x32b, src_temp2_4x32b);
  248|   261k|                src_temp3_4x32b = _mm_packus_epi16(src_temp3_4x32b, src_temp3_4x32b);
  249|       |
  250|       |                /* store four 8-bit output values  */
  251|   261k|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp0_4x32b); /* row = 0*/
  252|   261k|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp1_4x32b); /* row = 2*/
  253|   261k|                _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_temp2_4x32b); /* row = 1*/
  254|   261k|                _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_temp3_4x32b); /* row = 3*/
  255|       |
  256|       |                /* To update pointer */
  257|   261k|                pi2_src += 8;
  258|   261k|                pu1_dst += 8;
  259|       |
  260|   261k|            } /* inner loop ends here(4-output values in single iteration) */
  261|       |
  262|   124k|            pi2_src = pi2_src - wd + 4 * src_strd;    /* Pointer update */
  263|   124k|            pu1_dst = pu1_dst - wd + 4 * dst_strd; /* Pointer update */
  264|       |
  265|   124k|        }
  266|  50.1k|    }
  267|  5.79k|    else  /* wd multiple of 4 case */
  268|  5.79k|    {
  269|       |        /*  outer for loop starts from here */
  270|  18.9k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (270:22): [True: 13.1k, False: 5.79k]
  ------------------
  271|  13.1k|        {
  272|  28.7k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (272:26): [True: 15.6k, False: 13.1k]
  ------------------
  273|  15.6k|            {   /* for row =0 ,1,2,3*/
  274|       |
  275|       |                /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  276|  15.6k|                src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
  277|       |                /* row = 1 */
  278|  15.6k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  279|       |                /* row = 2 */
  280|  15.6k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 2 * src_strd));
  281|       |                /* row = 3 */
  282|  15.6k|                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|  15.6k|                src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  286|  15.6k|                src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  287|  15.6k|                src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  288|  15.6k|                src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  289|       |
  290|       |                /* (pi2_src[col] + lvl_shift)*/
  291|  15.6k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
  292|  15.6k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
  293|  15.6k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
  294|  15.6k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift_4x32b);
  295|       |
  296|       |                /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  297|  15.6k|                src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
  298|  15.6k|                src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
  299|  15.6k|                src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
  300|  15.6k|                src_temp3_4x32b  = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
  301|       |
  302|       |                /* i4_tmp += 1 << (shift - 1) */
  303|  15.6k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
  304|  15.6k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
  305|  15.6k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
  306|  15.6k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
  307|       |
  308|       |                /* (i4_tmp >> shift) */
  309|  15.6k|                src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b, shift);
  310|  15.6k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b, shift);
  311|  15.6k|                src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b, shift);
  312|  15.6k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b, shift);
  313|       |
  314|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */
  315|  15.6k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
  316|  15.6k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
  317|  15.6k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
  318|  15.6k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
  319|       |
  320|  15.6k|                src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp1_4x32b);
  321|  15.6k|                src_temp2_4x32b = _mm_packs_epi32(src_temp2_4x32b, src_temp3_4x32b);
  322|       |
  323|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  324|  15.6k|                src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp2_4x32b);
  325|       |
  326|  15.6k|                dst0 = _mm_cvtsi128_si32(src_temp0_4x32b);
  327|       |                /* dst row = 1 to 3 */
  328|  15.6k|                src_temp1_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 1);
  329|  15.6k|                src_temp2_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 2);
  330|  15.6k|                src_temp3_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 3);
  331|       |
  332|       |                /* store four 8-bit output values  */
  333|  15.6k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
  334|       |
  335|  15.6k|                dst1 = _mm_cvtsi128_si32(src_temp1_4x32b);
  336|  15.6k|                dst2 = _mm_cvtsi128_si32(src_temp2_4x32b);
  337|  15.6k|                dst3 = _mm_cvtsi128_si32(src_temp3_4x32b);
  338|       |
  339|       |                /* row = 1 to row = 3 */
  340|  15.6k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
  341|  15.6k|                *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2;
  342|  15.6k|                *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3;
  343|       |
  344|       |                /* To update pointer */
  345|  15.6k|                pi2_src += 4;
  346|  15.6k|                pu1_dst += 4;
  347|       |
  348|  15.6k|            } /* inner loop ends here(4-output values in single iteration) */
  349|       |
  350|  13.1k|            pi2_src = pi2_src - wd + 4 * src_strd;    /* Pointer update */
  351|  13.1k|            pu1_dst = pu1_dst - wd + 4 * dst_strd; /* Pointer update */
  352|       |
  353|  13.1k|        }
  354|  5.79k|    }
  355|  55.9k|}
ihevc_weighted_pred_chroma_uni_sse42:
  421|  52.5k|{
  422|  52.5k|    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|  52.5k|    __m128i src_temp0_4x32b, src_temp1_4x32b;
  427|  52.5k|    __m128i const_temp_4x32b, lvl_shift_4x32b, wgt0_4x32b, off0_4x32b;
  428|       |
  429|  52.5k|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  52.5k|#define ASSERT(x) {}
  ------------------
  430|  52.5k|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  52.5k|#define ASSERT(x) {}
  ------------------
  431|       |
  432|  52.5k|    temp = 1 << (shift - 1);
  433|  52.5k|    wdx2 = 2 * wd;
  434|       |
  435|       |    // seting values in register
  436|  52.5k|    const_temp_4x32b = _mm_set1_epi32(temp);
  437|  52.5k|    lvl_shift_4x32b = _mm_set1_epi32(lvl_shift);
  438|  52.5k|    wgt0_4x32b = _mm_set_epi32(wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb);
  439|  52.5k|    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|  52.5k|    {
  912|  52.5k|        if(0 == (wdx2 & 15)) /* 2*wd multiple of 168 case */
  ------------------
  |  Branch (912:12): [True: 4.03k, False: 48.4k]
  ------------------
  913|  4.03k|        {
  914|  4.03k|            __m128i src_temp2_4x32b, src_temp3_4x32b;
  915|  4.03k|            __m128i src_temp4_4x32b, src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b;
  916|       |            /*  outer for loop starts from here */
  917|  37.0k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (917:26): [True: 33.0k, False: 4.03k]
  ------------------
  918|  33.0k|            {
  919|   118k|                for(col = 0; col < wdx2; col += 16)
  ------------------
  |  Branch (919:30): [True: 85.3k, False: 33.0k]
  ------------------
  920|  85.3k|                {
  921|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  922|  85.3k|                    src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
  923|       |                    /* row = 1 */
  924|  85.3k|                    src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  925|       |
  926|       |                    /* row = 0 */ /* Second 4 pixels */
  927|  85.3k|                    src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 4));
  928|       |                    /* row = 1 */
  929|  85.3k|                    src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 4));
  930|       |                    /* row = 0 */ /* Third 4 pixels */
  931|  85.3k|                    src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 8));
  932|       |                    /* row = 1 */
  933|  85.3k|                    src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 8));
  934|       |                    /* row = 0 */ /* Last 4 pixels */
  935|  85.3k|                    src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 12));
  936|       |                    /* row = 1 */
  937|  85.3k|                    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|  85.3k|                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  941|  85.3k|                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  942|       |                    /* (pi2_src[col] + lvl_shift)*/
  943|  85.3k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
  944|  85.3k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
  945|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  946|  85.3k|                    src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
  947|  85.3k|                    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|  85.3k|                    src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  951|  85.3k|                    src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  952|       |                    /* (pi2_src[col] + lvl_shift)*/
  953|  85.3k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
  954|  85.3k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift_4x32b);
  955|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  956|  85.3k|                    src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
  957|  85.3k|                    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|  85.3k|                    src_temp4_4x32b  = _mm_cvtepi16_epi32(src_temp4_4x32b);
  961|  85.3k|                    src_temp5_4x32b  = _mm_cvtepi16_epi32(src_temp5_4x32b);
  962|       |                    /* (pi2_src[col] + lvl_shift)*/
  963|  85.3k|                    src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift_4x32b);
  964|  85.3k|                    src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift_4x32b);
  965|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  966|  85.3k|                    src_temp4_4x32b  = _mm_mullo_epi32(src_temp4_4x32b, wgt0_4x32b);
  967|  85.3k|                    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|  85.3k|                    src_temp6_4x32b  = _mm_cvtepi16_epi32(src_temp6_4x32b);
  971|  85.3k|                    src_temp7_4x32b  = _mm_cvtepi16_epi32(src_temp7_4x32b);
  972|       |                    /* (pi2_src[col] + lvl_shift)*/
  973|  85.3k|                    src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift_4x32b);
  974|  85.3k|                    src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, lvl_shift_4x32b);
  975|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  976|  85.3k|                    src_temp6_4x32b  = _mm_mullo_epi32(src_temp6_4x32b, wgt0_4x32b);
  977|  85.3k|                    src_temp7_4x32b  = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
  978|       |
  979|       |                    /* i4_tmp += 1 << (shift - 1) */
  980|  85.3k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
  981|  85.3k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
  982|       |                    /* (i4_tmp >> shift) */
  983|  85.3k|                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
  984|  85.3k|                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
  985|       |
  986|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Second 4 pixels */
  987|  85.3k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
  988|  85.3k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
  989|       |                    /* (i4_tmp >> shift) */
  990|  85.3k|                    src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b,  shift);
  991|  85.3k|                    src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
  992|       |
  993|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Third 4 pixels */
  994|  85.3k|                    src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, const_temp_4x32b);
  995|  85.3k|                    src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
  996|       |                    /* (i4_tmp >> shift) */
  997|  85.3k|                    src_temp4_4x32b = _mm_srai_epi32(src_temp4_4x32b,  shift);
  998|  85.3k|                    src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
  999|       |
 1000|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
 1001|  85.3k|                    src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, const_temp_4x32b);
 1002|  85.3k|                    src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
 1003|       |                    /* (i4_tmp >> shift) */
 1004|  85.3k|                    src_temp6_4x32b = _mm_srai_epi32(src_temp6_4x32b,  shift);
 1005|  85.3k|                    src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
 1006|       |
 1007|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
 1008|  85.3k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
 1009|  85.3k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
 1010|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Second 4 pixels */
 1011|  85.3k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
 1012|  85.3k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
 1013|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Third 4 pixels */
 1014|  85.3k|                    src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, off0_4x32b);
 1015|  85.3k|                    src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, off0_4x32b);
 1016|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
 1017|  85.3k|                    src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, off0_4x32b);
 1018|  85.3k|                    src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, off0_4x32b);
 1019|       |
 1020|  85.3k|                    src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp2_4x32b);
 1021|  85.3k|                    src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1022|  85.3k|                    src_temp4_4x32b = _mm_packs_epi32(src_temp4_4x32b, src_temp6_4x32b);
 1023|  85.3k|                    src_temp5_4x32b = _mm_packs_epi32(src_temp5_4x32b, src_temp7_4x32b);
 1024|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
 1025|  85.3k|                    src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp4_4x32b);
 1026|  85.3k|                    src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp5_4x32b);
 1027|       |
 1028|       |                    /* store 16 8-bit output values  */
 1029|  85.3k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 0 * dst_strd), src_temp0_4x32b); /* row = 0*/
 1030|  85.3k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src_temp1_4x32b); /* row = 1*/
 1031|       |
 1032|  85.3k|                    pi2_src += 16;  /* Pointer update */
 1033|  85.3k|                    pu1_dst += 16; /* Pointer update */
 1034|       |
 1035|  85.3k|                } /* inner loop ends here(4-output values in single iteration) */
 1036|  33.0k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
 1037|  33.0k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
 1038|  33.0k|            }
 1039|  4.03k|        }
 1040|  48.4k|        else if(0 == (wdx2 & 7)) /* 2*wd multiple of 8 case */
  ------------------
  |  Branch (1040:17): [True: 42.7k, False: 5.77k]
  ------------------
 1041|  42.7k|        {
 1042|  42.7k|            __m128i src_temp2_4x32b, src_temp3_4x32b;
 1043|       |            /*  outer for loop starts from here */
 1044|   130k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1044:26): [True: 88.0k, False: 42.7k]
  ------------------
 1045|  88.0k|            {
 1046|   176k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (1046:30): [True: 88.6k, False: 88.0k]
  ------------------
 1047|  88.6k|                {
 1048|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1049|  88.6k|                    src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
 1050|       |                    /* row = 1 */
 1051|  88.6k|                    src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
 1052|       |
 1053|       |                    /* row = 0 */ /* Last 4 pixels */
 1054|  88.6k|                    src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 4));
 1055|       |                    /* row = 1 */
 1056|  88.6k|                    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|  88.6k|                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
 1060|  88.6k|                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1061|       |                    /* (pi2_src[col] + lvl_shift)*/
 1062|  88.6k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
 1063|  88.6k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
 1064|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
 1065|  88.6k|                    src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
 1066|  88.6k|                    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|  88.6k|                    src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1070|  88.6k|                    src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1071|       |                    /* (pi2_src[col] + lvl_shift)*/
 1072|  88.6k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
 1073|  88.6k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift_4x32b);
 1074|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
 1075|  88.6k|                    src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
 1076|  88.6k|                    src_temp3_4x32b  = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1077|       |
 1078|       |                    /* i4_tmp += 1 << (shift - 1) */
 1079|  88.6k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
 1080|  88.6k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1081|       |                    /* (i4_tmp >> shift) */
 1082|  88.6k|                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
 1083|  88.6k|                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1084|       |
 1085|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
 1086|  88.6k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
 1087|  88.6k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1088|       |                    /* (i4_tmp >> shift) */
 1089|  88.6k|                    src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b,  shift);
 1090|  88.6k|                    src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1091|       |
 1092|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
 1093|  88.6k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
 1094|  88.6k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
 1095|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
 1096|  88.6k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
 1097|  88.6k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
 1098|       |
 1099|  88.6k|                    src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp2_4x32b);
 1100|  88.6k|                    src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1101|       |
 1102|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
 1103|  88.6k|                    src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp0_4x32b);
 1104|  88.6k|                    src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1105|       |
 1106|       |                    /* store four 8-bit output values  */
 1107|  88.6k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp0_4x32b); /* row = 0*/
 1108|  88.6k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp1_4x32b); /* row = 1*/
 1109|       |
 1110|  88.6k|                    pi2_src += 8;   /* Pointer update */
 1111|  88.6k|                    pu1_dst += 8; /* Pointer update */
 1112|       |
 1113|  88.6k|                } /* inner loop ends here(4-output values in single iteration) */
 1114|  88.0k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
 1115|  88.0k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
 1116|  88.0k|            }
 1117|  42.7k|        }
 1118|  5.77k|        else /* 2*wd multiple of 4 case */
 1119|  5.77k|        {
 1120|  5.77k|            WORD32 dst0, dst1;
 1121|       |            /*  outer for loop starts from here */
 1122|  18.8k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1122:26): [True: 13.0k, False: 5.77k]
  ------------------
 1123|  13.0k|            {
 1124|  28.6k|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (1124:30): [True: 15.5k, False: 13.0k]
  ------------------
 1125|  15.5k|                {
 1126|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1127|  15.5k|                    src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
 1128|       |                    /* row = 1 */
 1129|  15.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|  15.5k|                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
 1133|  15.5k|                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1134|       |
 1135|       |                    /* (pi2_src[col] + lvl_shift)*/
 1136|  15.5k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
 1137|  15.5k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
 1138|       |
 1139|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
 1140|  15.5k|                    src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
 1141|  15.5k|                    src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1142|       |
 1143|       |                    /* i4_tmp += 1 << (shift - 1) */
 1144|  15.5k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
 1145|  15.5k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1146|       |
 1147|       |                    /* (i4_tmp >> shift) */
 1148|  15.5k|                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
 1149|  15.5k|                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1150|       |
 1151|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
 1152|  15.5k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
 1153|  15.5k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
 1154|       |
 1155|  15.5k|                    src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp1_4x32b);
 1156|       |
 1157|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
 1158|  15.5k|                    src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp0_4x32b);
 1159|       |
 1160|  15.5k|                    dst0 = _mm_cvtsi128_si32(src_temp0_4x32b);
 1161|       |                    /* dst row = 1 to 3 */
 1162|  15.5k|                    src_temp1_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 1);
 1163|       |
 1164|       |                    /* store four 8-bit output values  */
 1165|  15.5k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1166|       |
 1167|  15.5k|                    dst1 = _mm_cvtsi128_si32(src_temp1_4x32b);
 1168|       |                    /* row = 1 */
 1169|  15.5k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1170|       |
 1171|  15.5k|                    pi2_src += 4;   /* Pointer update */
 1172|  15.5k|                    pu1_dst += 4; /* Pointer update */
 1173|       |
 1174|  15.5k|                } /* inner loop ends here(4-output values in single iteration) */
 1175|  13.0k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
 1176|  13.0k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
 1177|  13.0k|            }
 1178|  5.77k|        }
 1179|  52.5k|    }
 1180|  52.5k|}
ihevc_weighted_pred_bi_sse42:
 1261|  1.30M|{
 1262|  1.30M|    WORD32 row, col, temp;
 1263|       |
 1264|  1.30M|    __m128i src_temp1_4x32b, src_temp2_4x32b, src_temp3_4x32b, src_temp4_4x32b;
 1265|  1.30M|    __m128i const_temp_4x32b, lvl_shift1_4x32b, lvl_shift2_4x32b, wgt0_4x32b, wgt1_4x32b;
 1266|       |
 1267|       |
 1268|  1.30M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.30M|#define ASSERT(x) {}
  ------------------
 1269|  1.30M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.30M|#define ASSERT(x) {}
  ------------------
 1270|       |
 1271|  1.30M|    temp = (off0 + off1 + 1) << (shift - 1);
 1272|       |
 1273|       |    // seting values in register
 1274|  1.30M|    const_temp_4x32b = _mm_set1_epi32(temp);
 1275|  1.30M|    lvl_shift1_4x32b = _mm_set1_epi32(lvl_shift1);
 1276|  1.30M|    lvl_shift2_4x32b = _mm_set1_epi32(lvl_shift2);
 1277|  1.30M|    wgt0_4x32b = _mm_set1_epi32(wgt0);
 1278|  1.30M|    wgt1_4x32b = _mm_set1_epi32(wgt1);
 1279|       |
 1280|  1.30M|    if(0 == (wd & 7)) /* wd multiple of 8 case */
  ------------------
  |  Branch (1280:8): [True: 1.51M, False: 18.4E]
  ------------------
 1281|  1.51M|    {
 1282|  1.51M|        __m128i src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b, src_temp8_4x32b;
 1283|       |        /*  outer for loop starts from here */
 1284|  7.51M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1284:22): [True: 5.99M, False: 1.51M]
  ------------------
 1285|  5.99M|        {
 1286|  12.1M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1286:26): [True: 6.18M, False: 5.99M]
  ------------------
 1287|  6.18M|            {
 1288|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1289|  6.18M|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1290|  6.18M|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1291|  6.18M|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1292|  6.18M|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1293|       |                /* Next 4 pixels */
 1294|  6.18M|                src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 4)); /* row = 0 */
 1295|  6.18M|                src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 4)); /* row = 0 */
 1296|  6.18M|                src_temp7_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1 + 4)); /* row = 1 */
 1297|  6.18M|                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|  6.18M|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1301|  6.18M|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1302|       |                /* (pi2_src1[col] + lvl_shift1) */
 1303|  6.18M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1304|       |                /* (pi2_src2[col] + lvl_shift2) */
 1305|  6.18M|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1306|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1307|  6.18M|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1308|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1309|  6.18M|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1310|       |
 1311|  6.18M|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1312|  6.18M|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1313|  6.18M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1314|  6.18M|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1315|  6.18M|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1316|  6.18M|                src_temp4_4x32b = _mm_mullo_epi32(src_temp4_4x32b, wgt1_4x32b);
 1317|       |
 1318|       |                /* Next 4 Pixels */
 1319|  6.18M|                src_temp5_4x32b = _mm_cvtepi16_epi32(src_temp5_4x32b);
 1320|  6.18M|                src_temp6_4x32b = _mm_cvtepi16_epi32(src_temp6_4x32b);
 1321|  6.18M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift1_4x32b);
 1322|  6.18M|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift2_4x32b);
 1323|  6.18M|                src_temp5_4x32b = _mm_mullo_epi32(src_temp5_4x32b, wgt0_4x32b);
 1324|  6.18M|                src_temp6_4x32b = _mm_mullo_epi32(src_temp6_4x32b, wgt1_4x32b);
 1325|  6.18M|                src_temp7_4x32b = _mm_cvtepi16_epi32(src_temp7_4x32b);
 1326|  6.18M|                src_temp8_4x32b = _mm_cvtepi16_epi32(src_temp8_4x32b);
 1327|  6.18M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, lvl_shift1_4x32b);
 1328|  6.18M|                src_temp8_4x32b = _mm_add_epi32(src_temp8_4x32b, lvl_shift2_4x32b);
 1329|  6.18M|                src_temp7_4x32b = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
 1330|  6.18M|                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|  6.18M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1334|  6.18M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1335|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1336|  6.18M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1337|  6.18M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1338|       |                /* (i4_tmp >> shift) */
 1339|  6.18M|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1340|  6.18M|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1341|       |
 1342|       |                /* Next 4 Pixels */
 1343|  6.18M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, src_temp6_4x32b);
 1344|  6.18M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, src_temp8_4x32b);
 1345|  6.18M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
 1346|  6.18M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
 1347|  6.18M|                src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
 1348|  6.18M|                src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
 1349|       |
 1350|  6.18M|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp5_4x32b);
 1351|  6.18M|                src_temp3_4x32b = _mm_packs_epi32(src_temp3_4x32b, src_temp7_4x32b);
 1352|       |
 1353|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1354|  6.18M|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1355|  6.18M|                src_temp3_4x32b = _mm_packus_epi16(src_temp3_4x32b, src_temp3_4x32b);
 1356|       |
 1357|       |                /* store four 8-bit output values  */
 1358|  6.18M|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_4x32b); /* row = 0*/
 1359|  6.18M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_4x32b); /* row = 1*/
 1360|       |
 1361|  6.18M|                pi2_src1 += 8;  /* Pointer update */
 1362|  6.18M|                pi2_src2 += 8;  /* Pointer update */
 1363|  6.18M|                pu1_dst  += 8;  /* Pointer update */
 1364|       |
 1365|  6.18M|            } /* inner loop ends here(4-output values in single iteration) */
 1366|       |
 1367|  5.99M|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1;  /* Pointer update */
 1368|  5.99M|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2;  /* Pointer update */
 1369|  5.99M|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;   /* Pointer update */
 1370|       |
 1371|  5.99M|        } /* outer loop ends */
 1372|  1.51M|    }
 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: 37.2k, False: 18.4E]
  ------------------
 1378|  37.2k|        {
 1379|   111k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1379:26): [True: 74.4k, False: 37.2k]
  ------------------
 1380|  74.4k|            {
 1381|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1382|  74.4k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1383|  74.4k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1384|  74.4k|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1385|  74.4k|                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|  74.4k|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1389|  74.4k|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1390|       |                /* (pi2_src1[col] + lvl_shift1) */
 1391|  74.4k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1392|       |                /* (pi2_src2[col] + lvl_shift2) */
 1393|  74.4k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1394|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1395|  74.4k|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1396|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1397|  74.4k|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1398|       |
 1399|  74.4k|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1400|  74.4k|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1401|  74.4k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1402|  74.4k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1403|  74.4k|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1404|  74.4k|                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|  74.4k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1408|  74.4k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1409|       |
 1410|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1411|  74.4k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1412|  74.4k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1413|       |
 1414|       |                /* (i4_tmp >> shift) */
 1415|  74.4k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1416|  74.4k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1417|       |
 1418|  74.4k|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1419|       |
 1420|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1421|  74.4k|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1422|       |
 1423|  74.4k|                dst0 = _mm_cvtsi128_si32(src_temp1_4x32b);
 1424|       |
 1425|       |                /* dst row = 1 to 3 */
 1426|  74.4k|                src_temp2_4x32b = _mm_shuffle_epi32(src_temp1_4x32b, 1);
 1427|       |
 1428|       |                /* store four 8-bit output values  */
 1429|  74.4k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1430|       |
 1431|  74.4k|                dst1 = _mm_cvtsi128_si32(src_temp2_4x32b);
 1432|       |
 1433|       |                /* row = 1 to 3 */
 1434|  74.4k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1435|       |
 1436|  74.4k|                pi2_src1 += 4;  /* Pointer update */
 1437|  74.4k|                pi2_src2 += 4;  /* Pointer update */
 1438|  74.4k|                pu1_dst  += 4;  /* Pointer update */
 1439|       |
 1440|  74.4k|            } /* inner loop ends here(4-output values in single iteration) */
 1441|       |
 1442|  37.2k|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1;  /* Pointer update */
 1443|  37.2k|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2;  /* Pointer update */
 1444|  37.2k|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;   /* Pointer update */
 1445|       |
 1446|  37.2k|        } /* outer loop ends */
 1447|  18.4E|    }
 1448|       |
 1449|  1.30M|}
ihevc_weighted_pred_chroma_bi_sse42:
 1534|  1.36M|{
 1535|  1.36M|    WORD32 row, col, temp1, temp2;
 1536|  1.36M|    WORD32 wdx2;
 1537|       |
 1538|  1.36M|    __m128i src_temp1_4x32b, src_temp2_4x32b, src_temp3_4x32b, src_temp4_4x32b;
 1539|  1.36M|    __m128i const_temp_4x32b, lvl_shift1_4x32b, lvl_shift2_4x32b, wgt0_4x32b, wgt1_4x32b;
 1540|       |
 1541|       |
 1542|  1.36M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.36M|#define ASSERT(x) {}
  ------------------
 1543|  1.36M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.36M|#define ASSERT(x) {}
  ------------------
 1544|       |
 1545|  1.36M|    temp1 = (off0_cb + off1_cb + 1) << (shift - 1);
 1546|  1.36M|    temp2 = (off0_cr + off1_cr + 1) << (shift - 1);
 1547|       |
 1548|       |    // seting values in register
 1549|  1.36M|    const_temp_4x32b = _mm_set_epi32(temp2, temp1, temp2, temp1);
 1550|  1.36M|    lvl_shift1_4x32b = _mm_set1_epi32(lvl_shift1);
 1551|  1.36M|    lvl_shift2_4x32b = _mm_set1_epi32(lvl_shift2);
 1552|  1.36M|    wgt0_4x32b = _mm_set_epi32(wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb);
 1553|  1.36M|    wgt1_4x32b = _mm_set_epi32(wgt1_cr, wgt1_cb, wgt1_cr, wgt1_cb);
 1554|       |
 1555|  1.36M|    wdx2 = wd * 2;
 1556|       |
 1557|  1.36M|    if(0 == (wdx2 & 7)) /* wdx2 multiple of 8 case */
  ------------------
  |  Branch (1557:8): [True: 1.51M, False: 18.4E]
  ------------------
 1558|  1.51M|    {
 1559|  1.51M|        __m128i src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b, src_temp8_4x32b;
 1560|       |        /*  outer for loop starts from here */
 1561|  4.50M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1561:22): [True: 2.99M, False: 1.51M]
  ------------------
 1562|  2.99M|        {
 1563|  6.08M|            for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (1563:26): [True: 3.08M, False: 2.99M]
  ------------------
 1564|  3.08M|            {
 1565|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1566|  3.08M|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1567|  3.08M|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1568|  3.08M|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1569|  3.08M|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1570|       |                /* Next 4 pixels */
 1571|  3.08M|                src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 4)); /* row = 0 */
 1572|  3.08M|                src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 4)); /* row = 0 */
 1573|  3.08M|                src_temp7_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1 + 4)); /* row = 1 */
 1574|  3.08M|                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|  3.08M|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1578|  3.08M|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1579|       |                /* (pi2_src1[col] + lvl_shift1) */
 1580|  3.08M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1581|       |                /* (pi2_src2[col] + lvl_shift2) */
 1582|  3.08M|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1583|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1584|  3.08M|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1585|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1586|  3.08M|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1587|       |
 1588|  3.08M|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1589|  3.08M|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1590|  3.08M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1591|  3.08M|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1592|  3.08M|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1593|  3.08M|                src_temp4_4x32b = _mm_mullo_epi32(src_temp4_4x32b, wgt1_4x32b);
 1594|       |
 1595|       |                /* Next 4 Pixels */
 1596|  3.08M|                src_temp5_4x32b = _mm_cvtepi16_epi32(src_temp5_4x32b);
 1597|  3.08M|                src_temp6_4x32b = _mm_cvtepi16_epi32(src_temp6_4x32b);
 1598|  3.08M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift1_4x32b);
 1599|  3.08M|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift2_4x32b);
 1600|  3.08M|                src_temp5_4x32b = _mm_mullo_epi32(src_temp5_4x32b, wgt0_4x32b);
 1601|  3.08M|                src_temp6_4x32b = _mm_mullo_epi32(src_temp6_4x32b, wgt1_4x32b);
 1602|  3.08M|                src_temp7_4x32b = _mm_cvtepi16_epi32(src_temp7_4x32b);
 1603|  3.08M|                src_temp8_4x32b = _mm_cvtepi16_epi32(src_temp8_4x32b);
 1604|  3.08M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, lvl_shift1_4x32b);
 1605|  3.08M|                src_temp8_4x32b = _mm_add_epi32(src_temp8_4x32b, lvl_shift2_4x32b);
 1606|  3.08M|                src_temp7_4x32b = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
 1607|  3.08M|                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|  3.08M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1611|  3.08M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1612|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1613|  3.08M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1614|  3.08M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1615|       |                /* (i4_tmp >> shift) */
 1616|  3.08M|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1617|  3.08M|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1618|       |
 1619|       |                /* Next 4 Pixels */
 1620|  3.08M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, src_temp6_4x32b);
 1621|  3.08M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, src_temp8_4x32b);
 1622|  3.08M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
 1623|  3.08M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
 1624|  3.08M|                src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
 1625|  3.08M|                src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
 1626|       |
 1627|  3.08M|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp5_4x32b);
 1628|  3.08M|                src_temp3_4x32b = _mm_packs_epi32(src_temp3_4x32b, src_temp7_4x32b);
 1629|       |
 1630|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1631|  3.08M|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1632|  3.08M|                src_temp3_4x32b = _mm_packus_epi16(src_temp3_4x32b, src_temp3_4x32b);
 1633|       |
 1634|       |                /* store four 8-bit output values  */
 1635|  3.08M|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_4x32b); /* row = 0*/
 1636|  3.08M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_4x32b); /* row = 1*/
 1637|       |
 1638|  3.08M|                pi2_src1 += 8;  /* Pointer update */
 1639|  3.08M|                pi2_src2 += 8;  /* Pointer update */
 1640|  3.08M|                pu1_dst  += 8;  /* Pointer update */
 1641|       |
 1642|  3.08M|            } /* inner loop ends here(4-output values in single iteration) */
 1643|       |
 1644|  2.99M|            pi2_src1 = pi2_src1 - wdx2 + 2 * src_strd1;    /* Pointer update */
 1645|  2.99M|            pi2_src2 = pi2_src2 - wdx2 + 2 * src_strd2;    /* Pointer update */
 1646|  2.99M|            pu1_dst  = pu1_dst  - wdx2 + 2 * dst_strd;   /* Pointer update */
 1647|       |
 1648|  2.99M|        } /* outer loop ends */
 1649|  1.51M|    }
 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: 18.6k, False: 18.4E]
  ------------------
 1655|  18.6k|        {
 1656|  56.0k|            for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (1656:26): [True: 37.3k, False: 18.6k]
  ------------------
 1657|  37.3k|            {
 1658|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1659|  37.3k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1660|  37.3k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1661|  37.3k|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1662|  37.3k|                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|  37.3k|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1666|  37.3k|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1667|       |                /* (pi2_src1[col] + lvl_shift1) */
 1668|  37.3k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1669|       |                /* (pi2_src2[col] + lvl_shift2) */
 1670|  37.3k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1671|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1672|  37.3k|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1673|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1674|  37.3k|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1675|       |
 1676|  37.3k|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1677|  37.3k|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1678|  37.3k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1679|  37.3k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1680|  37.3k|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1681|  37.3k|                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|  37.3k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1685|  37.3k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1686|       |
 1687|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1688|  37.3k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1689|  37.3k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1690|       |
 1691|       |                /* (i4_tmp >> shift) */
 1692|  37.3k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1693|  37.3k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1694|       |
 1695|  37.3k|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1696|       |
 1697|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1698|  37.3k|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1699|       |
 1700|  37.3k|                dst0 = _mm_cvtsi128_si32(src_temp1_4x32b);
 1701|       |
 1702|       |                /* dst row = 1 to 3 */
 1703|  37.3k|                src_temp2_4x32b = _mm_shuffle_epi32(src_temp1_4x32b, 1);
 1704|       |
 1705|       |                /* store four 8-bit output values  */
 1706|  37.3k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1707|       |
 1708|  37.3k|                dst1 = _mm_cvtsi128_si32(src_temp2_4x32b);
 1709|       |
 1710|       |                /* row = 1 to 3 */
 1711|  37.3k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1712|       |
 1713|  37.3k|                pi2_src1 += 4;  /* Pointer update */
 1714|  37.3k|                pi2_src2 += 4;  /* Pointer update */
 1715|  37.3k|                pu1_dst  += 4;  /* Pointer update */
 1716|       |
 1717|  37.3k|            } /* inner loop ends here(4-output values in single iteration) */
 1718|       |
 1719|  18.6k|            pi2_src1 = pi2_src1 - wdx2 + 2 * src_strd1;    /* Pointer update */
 1720|  18.6k|            pi2_src2 = pi2_src2 - wdx2 + 2 * src_strd2;    /* Pointer update */
 1721|  18.6k|            pu1_dst  = pu1_dst  - wdx2 + 2 * dst_strd;   /* Pointer update */
 1722|  18.6k|        }
 1723|  18.4E|    }
 1724|       |
 1725|  1.36M|}
ihevc_weighted_pred_bi_default_sse42:
 1790|  16.7M|{
 1791|  16.7M|    WORD32 row, col, temp;
 1792|  16.7M|    WORD32 shift;
 1793|       |
 1794|  16.7M|    __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1795|  16.7M|    __m128i const_temp_8x16b, lvl_shift1_8x16b, lvl_shift2_8x16b;
 1796|  16.7M|    __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1797|       |
 1798|  16.7M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  16.7M|#define ASSERT(x) {}
  ------------------
 1799|  16.7M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  16.7M|#define ASSERT(x) {}
  ------------------
 1800|       |
 1801|  16.7M|    shift = SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|  16.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  16.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1802|  16.7M|    temp = 1 << (shift - 1);
 1803|       |
 1804|       |    // seting values in register
 1805|  16.7M|    lvl_shift1_8x16b = _mm_set1_epi16(lvl_shift1);
 1806|  16.7M|    lvl_shift2_8x16b = _mm_set1_epi16(lvl_shift2);
 1807|  16.7M|    const_temp_8x16b = _mm_set1_epi16(temp);
 1808|       |
 1809|  16.7M|    lvl_shift1_8x16b = _mm_adds_epi16(lvl_shift1_8x16b, lvl_shift2_8x16b);
 1810|  16.7M|    lvl_shift1_8x16b = _mm_adds_epi16(lvl_shift1_8x16b, const_temp_8x16b);
 1811|       |
 1812|  16.7M|    if(0 == (ht & 3)) /* ht multiple of 4*/
  ------------------
  |  Branch (1812:8): [True: 16.7M, False: 18.4E]
  ------------------
 1813|  16.7M|    {
 1814|  16.7M|        if(0 == (wd & 15)) /* wd multiple of 16 case */
  ------------------
  |  Branch (1814:12): [True: 405k, False: 16.3M]
  ------------------
 1815|   405k|        {
 1816|   405k|            __m128i src_temp9_8x16b,  src_temp10_8x16b, src_temp11_8x16b, src_temp12_8x16b;
 1817|   405k|            __m128i src_temp13_8x16b, src_temp14_8x16b, src_temp15_8x16b, src_temp16_8x16b;
 1818|       |            /*  outer for loop starts from here */
 1819|  2.61M|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1819:26): [True: 2.21M, False: 405k]
  ------------------
 1820|  2.21M|            {
 1821|  6.81M|                for(col = 0; col < wd; col += 16)
  ------------------
  |  Branch (1821:30): [True: 4.59M, False: 2.21M]
  ------------------
 1822|  4.59M|                {
 1823|       |                    /*load 8 pixel values */ /* First 8 Values */
 1824|  4.59M|                    src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1));
 1825|  4.59M|                    src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2));
 1826|       |                    /* row = 1 */
 1827|  4.59M|                    src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1));
 1828|  4.59M|                    src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2));
 1829|       |                    /* row = 2 */
 1830|  4.59M|                    src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1));
 1831|  4.59M|                    src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2));
 1832|       |                    /* row = 3 */
 1833|  4.59M|                    src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1));
 1834|  4.59M|                    src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2));
 1835|       |
 1836|       |                    /*load 8 pixel values */ /* Second 8 Values */
 1837|  4.59M|                    src_temp9_8x16b  = _mm_loadu_si128((__m128i *)(pi2_src1 + 8));
 1838|  4.59M|                    src_temp10_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 8));
 1839|       |                    /* row = 1 */
 1840|  4.59M|                    src_temp11_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1 + 8));
 1841|  4.59M|                    src_temp12_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2 + 8));
 1842|       |                    /* row = 2 */
 1843|  4.59M|                    src_temp13_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1 + 8));
 1844|  4.59M|                    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.59M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1848|  4.59M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1849|  4.59M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1850|  4.59M|                    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.59M|                    src_temp15_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1 + 8));
 1855|  4.59M|                    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.59M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1859|  4.59M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, lvl_shift1_8x16b);
 1860|  4.59M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 1861|  4.59M|                    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.59M|                    src_temp9_8x16b  = _mm_adds_epi16(src_temp9_8x16b,  src_temp10_8x16b);
 1865|  4.59M|                    src_temp11_8x16b = _mm_adds_epi16(src_temp11_8x16b, src_temp12_8x16b);
 1866|  4.59M|                    src_temp13_8x16b = _mm_adds_epi16(src_temp13_8x16b, src_temp14_8x16b);
 1867|  4.59M|                    src_temp15_8x16b = _mm_adds_epi16(src_temp15_8x16b, src_temp16_8x16b);
 1868|       |
 1869|       |                    /* (i4_tmp >> shift) */ /* First 8 Values */
 1870|  4.59M|                    src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1871|  4.59M|                    src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  shift);
 1872|  4.59M|                    src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 1873|  4.59M|                    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.59M|                    src_temp9_8x16b  = _mm_adds_epi16(src_temp9_8x16b, lvl_shift1_8x16b);
 1877|  4.59M|                    src_temp11_8x16b = _mm_adds_epi16(src_temp11_8x16b, lvl_shift1_8x16b);
 1878|  4.59M|                    src_temp13_8x16b = _mm_adds_epi16(src_temp13_8x16b, lvl_shift1_8x16b);
 1879|  4.59M|                    src_temp15_8x16b = _mm_adds_epi16(src_temp15_8x16b, lvl_shift1_8x16b);
 1880|       |
 1881|       |                    /* (i4_tmp >> shift) */ /* Second 8 Values */
 1882|  4.59M|                    src_temp9_8x16b  = _mm_srai_epi16(src_temp9_8x16b,  shift);
 1883|  4.59M|                    src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  shift);
 1884|  4.59M|                    src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  shift);
 1885|  4.59M|                    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.59M|                    src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp9_8x16b);
 1889|  4.59M|                    src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, src_temp11_8x16b);
 1890|  4.59M|                    src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp13_8x16b);
 1891|  4.59M|                    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.59M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_8x16b); /* row = 0*/
 1895|  4.59M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_8x16b); /* row = 2*/
 1896|  4.59M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 2 * dst_strd), src_temp5_8x16b); /* row = 1*/
 1897|  4.59M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 3 * dst_strd), src_temp7_8x16b); /* row = 3*/
 1898|       |
 1899|       |                    /* To update pointer */
 1900|  4.59M|                    pi2_src1 += 16;
 1901|  4.59M|                    pi2_src2 += 16;
 1902|  4.59M|                    pu1_dst  += 16;
 1903|       |
 1904|  4.59M|                } /* inner loop ends here(8-output values in single iteration) */
 1905|       |
 1906|  2.21M|                pi2_src1 = pi2_src1 - wd + 4 * src_strd1;  /* Pointer update */
 1907|  2.21M|                pi2_src2 = pi2_src2 - wd + 4 * src_strd2;  /* Pointer update */
 1908|  2.21M|                pu1_dst  = pu1_dst - wd + 4 * dst_strd;   /* Pointer update */
 1909|       |
 1910|  2.21M|            }
 1911|   405k|        }
 1912|  16.3M|        else if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (1912:17): [True: 16.3M, False: 11.5k]
  ------------------
 1913|  16.3M|        {
 1914|       |            /*  outer for loop starts from here */
 1915|  41.2M|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1915:26): [True: 24.8M, False: 16.3M]
  ------------------
 1916|  24.8M|            {
 1917|  49.7M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1917:30): [True: 24.8M, False: 24.8M]
  ------------------
 1918|  24.8M|                {
 1919|       |                    /*load 8 pixel values */
 1920|  24.8M|                    src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1));
 1921|  24.8M|                    src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2));
 1922|       |                    /* row = 1 */
 1923|  24.8M|                    src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1));
 1924|  24.8M|                    src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2));
 1925|       |                    /* row = 2 */
 1926|  24.8M|                    src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1));
 1927|  24.8M|                    src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2));
 1928|       |                    /* row = 3 */
 1929|  24.8M|                    src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1));
 1930|  24.8M|                    src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2));
 1931|       |
 1932|       |                    /* (pi2_src1[col] + pi2_src2[col]) */
 1933|  24.8M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1934|  24.8M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1935|  24.8M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1936|  24.8M|                    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|  24.8M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1940|  24.8M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, lvl_shift1_8x16b);
 1941|  24.8M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 1942|  24.8M|                    src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, lvl_shift1_8x16b);
 1943|       |
 1944|       |                    /* (i4_tmp >> shift) */
 1945|  24.8M|                    src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1946|  24.8M|                    src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  shift);
 1947|  24.8M|                    src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 1948|  24.8M|                    src_temp7_8x16b = _mm_srai_epi16(src_temp7_8x16b,  shift);
 1949|       |
 1950|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1951|  24.8M|                    src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 1952|  24.8M|                    src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, src_temp3_8x16b);
 1953|  24.8M|                    src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp5_8x16b);
 1954|  24.8M|                    src_temp7_8x16b = _mm_packus_epi16(src_temp7_8x16b, src_temp7_8x16b);
 1955|       |
 1956|       |                    /* store four 8-bit output values  */
 1957|  24.8M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_8x16b); /* row = 0*/
 1958|  24.8M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_8x16b); /* row = 2*/
 1959|  24.8M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_temp5_8x16b); /* row = 1*/
 1960|  24.8M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_temp7_8x16b); /* row = 3*/
 1961|       |
 1962|       |                    /* To update pointer */
 1963|  24.8M|                    pi2_src1 += 8;
 1964|  24.8M|                    pi2_src2 += 8;
 1965|  24.8M|                    pu1_dst  += 8;
 1966|       |
 1967|  24.8M|                } /* inner loop ends here(8-output values in single iteration) */
 1968|       |
 1969|  24.8M|                pi2_src1 = pi2_src1 - wd + 4 * src_strd1;  /* Pointer update */
 1970|  24.8M|                pi2_src2 = pi2_src2 - wd + 4 * src_strd2;  /* Pointer update */
 1971|  24.8M|                pu1_dst  = pu1_dst - wd + 4 * dst_strd;   /* Pointer update */
 1972|       |
 1973|  24.8M|            }
 1974|  16.3M|        }
 1975|  11.5k|        else /* wd multiple of 4 case*/
 1976|  11.5k|        {
 1977|  11.5k|            WORD32 dst0, dst1, dst2, dst3;
 1978|       |
 1979|       |            /*  outer for loop starts from here */
 1980|  49.2k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1980:26): [True: 37.6k, False: 11.5k]
  ------------------
 1981|  37.6k|            {
 1982|   115k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1982:30): [True: 77.7k, False: 37.6k]
  ------------------
 1983|  77.7k|                {
 1984|       |                    /*load 4 pixel values from 7:0 pos. relative to cur. pos.*/
 1985|  77.7k|                    src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1));
 1986|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1987|  77.7k|                    src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2));
 1988|       |
 1989|       |                    /* row = 1 */
 1990|  77.7k|                    src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + src_strd1));
 1991|  77.7k|                    src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + src_strd2));
 1992|       |                    /* row = 2 */
 1993|  77.7k|                    src_temp5_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 2 * src_strd1));
 1994|  77.7k|                    src_temp6_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 2 * src_strd2));
 1995|       |                    /* row = 3 */
 1996|  77.7k|                    src_temp7_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 3 * src_strd1));
 1997|  77.7k|                    src_temp8_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 3 * src_strd2));
 1998|       |
 1999|       |                    /* Pack two rows together */
 2000|  77.7k|                    src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
 2001|  77.7k|                    src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
 2002|  77.7k|                    src_temp5_8x16b = _mm_unpacklo_epi64(src_temp5_8x16b, src_temp7_8x16b);
 2003|  77.7k|                    src_temp6_8x16b = _mm_unpacklo_epi64(src_temp6_8x16b, src_temp8_8x16b);
 2004|       |
 2005|       |                    /* (pi2_src1[col] + pi2_src2[col]) */
 2006|  77.7k|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 2007|  77.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|  77.7k|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 2011|  77.7k|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 2012|       |
 2013|       |                    /* (i4_tmp >> shift) */
 2014|  77.7k|                    src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 2015|  77.7k|                    src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 2016|       |
 2017|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 2018|  77.7k|                    src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 2019|  77.7k|                    src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp5_8x16b);
 2020|       |
 2021|  77.7k|                    dst0 = _mm_cvtsi128_si32(src_temp1_8x16b);
 2022|       |                    /* dst row = 1 to 3 */
 2023|  77.7k|                    src_temp2_8x16b = _mm_shuffle_epi32(src_temp1_8x16b, 1);
 2024|  77.7k|                    src_temp4_8x16b = _mm_shuffle_epi32(src_temp5_8x16b, 1);
 2025|       |
 2026|       |                    /* store four 8-bit output values  */
 2027|  77.7k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 2028|       |
 2029|  77.7k|                    dst1 = _mm_cvtsi128_si32(src_temp2_8x16b);
 2030|  77.7k|                    dst2 = _mm_cvtsi128_si32(src_temp5_8x16b);
 2031|  77.7k|                    dst3 = _mm_cvtsi128_si32(src_temp4_8x16b);
 2032|       |
 2033|       |                    /* row = 1 to row = 3 */
 2034|  77.7k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 2035|  77.7k|                    *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2;
 2036|  77.7k|                    *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3;
 2037|       |
 2038|       |                    /* To update pointer */
 2039|  77.7k|                    pi2_src1 += 4;
 2040|  77.7k|                    pi2_src2 += 4;
 2041|  77.7k|                    pu1_dst  += 4;
 2042|       |
 2043|  77.7k|                } /* inner loop ends here(4-output values in single iteration) */
 2044|       |
 2045|  37.6k|                pi2_src1 = pi2_src1 - wd + 4 * src_strd1; /* Pointer update */
 2046|  37.6k|                pi2_src2 = pi2_src2 - wd + 4 * src_strd2; /* Pointer update */
 2047|  37.6k|                pu1_dst  = pu1_dst  - wd + 4 * dst_strd;  /* Pointer update */
 2048|       |
 2049|  37.6k|            }
 2050|  11.5k|        }
 2051|  16.7M|    }
 2052|  18.4E|    else /* ht multiple of 2 case and wd multiple of 4 case*/
 2053|  18.4E|    {
 2054|       |
 2055|  18.4E|        WORD32 dst0, dst1;
 2056|       |
 2057|       |        /*  outer for loop starts from here */
 2058|  18.4E|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (2058:22): [True: 10.7k, False: 18.4E]
  ------------------
 2059|  10.7k|        {
 2060|  53.5k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (2060:26): [True: 42.8k, False: 10.7k]
  ------------------
 2061|  42.8k|            {
 2062|       |                /*load 4 pixel values from 7:0 pos. relative to cur. pos.*/
 2063|  42.8k|                src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1));
 2064|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 2065|  42.8k|                src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2));
 2066|       |
 2067|       |                /* row = 1 */
 2068|  42.8k|                src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + src_strd1));
 2069|  42.8k|                src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + src_strd2));
 2070|       |
 2071|       |                /* Pack two rows together */
 2072|  42.8k|                src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
 2073|  42.8k|                src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
 2074|       |
 2075|       |                /* (pi2_src1[col] + pi2_src2[col]) */
 2076|  42.8k|                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|  42.8k|                src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 2080|       |
 2081|       |                /* (i4_tmp >> shift) */
 2082|  42.8k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 2083|       |
 2084|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 2085|  42.8k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 2086|       |
 2087|  42.8k|                dst0 = _mm_cvtsi128_si32(src_temp1_8x16b);
 2088|       |                /* dst row = 1 to 3 */
 2089|  42.8k|                src_temp2_8x16b = _mm_shuffle_epi32(src_temp1_8x16b, 1);
 2090|       |
 2091|       |                /* store four 8-bit output values  */
 2092|  42.8k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 2093|       |
 2094|  42.8k|                dst1 = _mm_cvtsi128_si32(src_temp2_8x16b);
 2095|       |
 2096|       |                /* row = 1 to row = 3 */
 2097|  42.8k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 2098|       |
 2099|       |                /* To update pointer */
 2100|  42.8k|                pi2_src1 += 4;
 2101|  42.8k|                pi2_src2 += 4;
 2102|  42.8k|                pu1_dst  += 4;
 2103|       |
 2104|  42.8k|            } /* inner loop ends here(4-output values in single iteration) */
 2105|       |
 2106|  10.7k|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1; /* Pointer update */
 2107|  10.7k|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2; /* Pointer update */
 2108|  10.7k|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;  /* Pointer update */
 2109|       |
 2110|  10.7k|        }
 2111|       |
 2112|  18.4E|    }
 2113|       |
 2114|  16.7M|}

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

ihevcd_set_default_params:
  921|  28.3k|{
  922|       |
  923|  28.3k|    WORD32 ret = IV_SUCCESS;
  924|       |
  925|  28.3k|    ps_codec->e_pic_skip_mode = ps_codec->u4_thumbnail_mode ? IVD_SKIP_PB : IVD_SKIP_NONE;
  ------------------
  |  Branch (925:33): [True: 0, False: 28.3k]
  ------------------
  926|  28.3k|    ps_codec->i4_strd = 0;
  927|  28.3k|    ps_codec->i4_disp_strd = 0;
  928|  28.3k|    ps_codec->i4_header_mode = 0;
  929|  28.3k|    ps_codec->e_frm_out_mode = ps_codec->u4_thumbnail_mode ? IVD_DECODE_FRAME_OUT : IVD_DISPLAY_FRAME_OUT;
  ------------------
  |  Branch (929:32): [True: 0, False: 28.3k]
  ------------------
  930|  28.3k|    return ret;
  931|  28.3k|}
ihevcd_update_function_ptr:
  934|  53.3k|{
  935|       |
  936|       |    /* Init inter pred function array */
  937|  53.3k|    ps_codec->apf_inter_pred[0] = NULL;
  938|  53.3k|    ps_codec->apf_inter_pred[1] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr;
  939|  53.3k|    ps_codec->apf_inter_pred[2] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr;
  940|  53.3k|    ps_codec->apf_inter_pred[3] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr;
  941|  53.3k|    ps_codec->apf_inter_pred[4] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  942|  53.3k|    ps_codec->apf_inter_pred[5] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr;
  943|  53.3k|    ps_codec->apf_inter_pred[6] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr;
  944|  53.3k|    ps_codec->apf_inter_pred[7] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  945|  53.3k|    ps_codec->apf_inter_pred[8] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  946|  53.3k|    ps_codec->apf_inter_pred[9] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr;
  947|  53.3k|    ps_codec->apf_inter_pred[10] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr;
  948|  53.3k|    ps_codec->apf_inter_pred[11] = NULL;
  949|  53.3k|    ps_codec->apf_inter_pred[12] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr;
  950|  53.3k|    ps_codec->apf_inter_pred[13] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr;
  951|  53.3k|    ps_codec->apf_inter_pred[14] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr;
  952|  53.3k|    ps_codec->apf_inter_pred[15] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  953|  53.3k|    ps_codec->apf_inter_pred[16] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr;
  954|  53.3k|    ps_codec->apf_inter_pred[17] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr;
  955|  53.3k|    ps_codec->apf_inter_pred[18] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  956|  53.3k|    ps_codec->apf_inter_pred[19] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  957|  53.3k|    ps_codec->apf_inter_pred[20] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr;
  958|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_luma[0] = (pf_intra_pred)NULL;
  962|  53.3k|    ps_codec->apf_intra_pred_luma[1] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr;
  963|  53.3k|    ps_codec->apf_intra_pred_luma[2] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr;
  964|  53.3k|    ps_codec->apf_intra_pred_luma[3] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr;
  965|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_luma[5] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr;
  967|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_luma[7] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr;
  969|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_luma[9] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr;
  971|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_chroma[0] = (pf_intra_pred)NULL;
  974|  53.3k|    ps_codec->apf_intra_pred_chroma[1] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr;
  975|  53.3k|    ps_codec->apf_intra_pred_chroma[2] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr;
  976|  53.3k|    ps_codec->apf_intra_pred_chroma[3] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr;
  977|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_chroma[5] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr;
  979|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_chroma[7] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr;
  981|  53.3k|    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|  53.3k|    ps_codec->apf_intra_pred_chroma[9] =  (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr;
  983|  53.3k|    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|  53.3k|    ps_codec->apf_itrans_res[0] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_4x4_ttype1_fptr;
  987|  53.3k|    ps_codec->apf_itrans_res[1] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_4x4_fptr;
  988|  53.3k|    ps_codec->apf_itrans_res[2] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_8x8_fptr;
  989|  53.3k|    ps_codec->apf_itrans_res[3] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_16x16_fptr;
  990|  53.3k|    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|  53.3k|    ps_codec->apf_itrans_recon[0] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr;
  994|  53.3k|    ps_codec->apf_itrans_recon[1] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr;
  995|  53.3k|    ps_codec->apf_itrans_recon[2] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr;
  996|  53.3k|    ps_codec->apf_itrans_recon[3] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr;
  997|  53.3k|    ps_codec->apf_itrans_recon[4] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr;
  998|  53.3k|    ps_codec->apf_itrans_recon[5] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr;
  999|  53.3k|    ps_codec->apf_itrans_recon[6] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr;
 1000|  53.3k|    ps_codec->apf_itrans_recon[7] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr;
 1001|  53.3k|    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|  53.3k|    ps_codec->apf_recon[0] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr;
 1005|  53.3k|    ps_codec->apf_recon[1] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_4x4_fptr;
 1006|  53.3k|    ps_codec->apf_recon[2] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_8x8_fptr;
 1007|  53.3k|    ps_codec->apf_recon[3] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_16x16_fptr;
 1008|  53.3k|    ps_codec->apf_recon[4] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_32x32_fptr;
 1009|  53.3k|    ps_codec->apf_recon[5] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr;
 1010|  53.3k|    ps_codec->apf_recon[6] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr;
 1011|  53.3k|    ps_codec->apf_recon[7] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr;
 1012|  53.3k|    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|  53.3k|    ps_codec->apf_itrans_recon_dc[0] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr;
 1016|  53.3k|    ps_codec->apf_itrans_recon_dc[1] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr;
 1017|       |
 1018|  53.3k|    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|  53.3k|    ps_codec->apf_sao_luma[0] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr;
 1022|  53.3k|    ps_codec->apf_sao_luma[1] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr;
 1023|  53.3k|    ps_codec->apf_sao_luma[2] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr;
 1024|  53.3k|    ps_codec->apf_sao_luma[3] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr;
 1025|       |
 1026|  53.3k|    ps_codec->apf_sao_chroma[0] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr;
 1027|  53.3k|    ps_codec->apf_sao_chroma[1] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr;
 1028|  53.3k|    ps_codec->apf_sao_chroma[2] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr;
 1029|  53.3k|    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|  53.3k|    ps_codec->apf_hbd_intra_pred_luma[0] = NULL; // Unused
 1033|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    ps_codec->apf_hbd_intra_pred_chroma[0] = NULL; // Unused
 1045|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    ps_codec->apf_hbd_itrans_recon[0] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_4x4_ttype1_fptr;
 1057|  53.3k|    ps_codec->apf_hbd_itrans_recon[1] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_4x4_fptr;
 1058|  53.3k|    ps_codec->apf_hbd_itrans_recon[2] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_8x8_fptr;
 1059|  53.3k|    ps_codec->apf_hbd_itrans_recon[3] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_16x16_fptr;
 1060|  53.3k|    ps_codec->apf_hbd_itrans_recon[4] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_32x32_fptr;
 1061|  53.3k|    ps_codec->apf_hbd_itrans_recon[5] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_itrans_recon_4x4_fptr;
 1062|  53.3k|    ps_codec->apf_hbd_itrans_recon[6] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_itrans_recon_8x8_fptr;
 1063|  53.3k|    ps_codec->apf_hbd_itrans_recon[7] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_itrans_recon_16x16_fptr;
 1064|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    ps_codec->apf_hbd_recon[0] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_4x4_ttype1_fptr;
 1070|  53.3k|    ps_codec->apf_hbd_recon[1] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_4x4_fptr;
 1071|  53.3k|    ps_codec->apf_hbd_recon[2] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_8x8_fptr;
 1072|  53.3k|    ps_codec->apf_hbd_recon[3] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_16x16_fptr;
 1073|  53.3k|    ps_codec->apf_hbd_recon[4] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_32x32_fptr;
 1074|  53.3k|    ps_codec->apf_hbd_recon[5] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_4x4_fptr;
 1075|  53.3k|    ps_codec->apf_hbd_recon[6] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_8x8_fptr;
 1076|  53.3k|    ps_codec->apf_hbd_recon[7] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_16x16_fptr;
 1077|  53.3k|    ps_codec->apf_hbd_recon[8] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_32x32_fptr;
 1078|       |
 1079|  53.3k|    ps_codec->apf_hbd_sao_luma[0] = (pf_hbd_sao_luma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class0_fptr;
 1080|  53.3k|    ps_codec->apf_hbd_sao_luma[1] = (pf_hbd_sao_luma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class1_fptr;
 1081|  53.3k|    ps_codec->apf_hbd_sao_luma[2] = (pf_hbd_sao_luma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class2_fptr;
 1082|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    ps_codec->apf_hbd_inter_pred[0] = NULL;
 1090|  53.3k|    ps_codec->apf_hbd_inter_pred[1] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_copy_fptr;
 1091|  53.3k|    ps_codec->apf_hbd_inter_pred[2] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_vert_fptr;
 1092|  53.3k|    ps_codec->apf_hbd_inter_pred[3] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_horz_fptr;
 1093|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    ps_codec->apf_hbd_inter_pred[12] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_copy_fptr;
 1102|  53.3k|    ps_codec->apf_hbd_inter_pred[13] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_vert_fptr;
 1103|  53.3k|    ps_codec->apf_hbd_inter_pred[14] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_horz_fptr;
 1104|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|    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|  53.3k|}
ihevcd_init:
 1133|  28.3k|{
 1134|  28.3k|    WORD32 status = IV_SUCCESS;
 1135|  28.3k|    WORD32 i;
 1136|       |
 1137|       |    /* Free any dynamic buffers that are allocated */
 1138|  28.3k|    ihevcd_free_dynamic_bufs(ps_codec);
 1139|       |
 1140|  28.3k|    ps_codec->u4_allocate_dynamic_done = 0;
 1141|  28.3k|    ps_codec->i4_num_disp_bufs = 1;
 1142|  28.3k|    ps_codec->i4_flush_mode = 0;
 1143|       |
 1144|  28.3k|    ps_codec->i4_ht = ps_codec->i4_disp_ht = 0;
 1145|  28.3k|    ps_codec->i4_wd = ps_codec->i4_disp_wd = 0;
 1146|  28.3k|    ps_codec->i4_strd = 0;
 1147|  28.3k|    ps_codec->i4_disp_strd = 0;
 1148|  28.3k|    ps_codec->i4_num_cores = 1;
 1149|       |
 1150|  28.3k|    ps_codec->u4_pic_cnt = 0;
 1151|  28.3k|    ps_codec->u4_disp_cnt = 0;
 1152|       |
 1153|  28.3k|    ps_codec->i4_header_mode = 0;
 1154|  28.3k|    ps_codec->i4_header_in_slice_mode = 0;
 1155|  28.3k|    ps_codec->i4_sps_done = 0;
 1156|  28.3k|    ps_codec->i4_pps_done = 0;
 1157|  28.3k|    ps_codec->i4_init_done   = 1;
 1158|  28.3k|    ps_codec->i4_first_pic_done = 0;
 1159|  28.3k|    ps_codec->s_parse.i4_first_pic_init = 0;
 1160|  28.3k|    ps_codec->i4_error_code = 0;
 1161|  28.3k|    ps_codec->i4_reset_flag = 0;
 1162|  28.3k|    ps_codec->i4_cra_as_first_pic = 1;
 1163|  28.3k|    ps_codec->i4_rasl_output_flag = 0;
 1164|       |
 1165|  28.3k|    ps_codec->i4_prev_poc_msb = 0;
 1166|  28.3k|    ps_codec->i4_prev_poc_lsb = -1;
 1167|  28.3k|    ps_codec->i4_max_prev_poc_lsb = -1;
 1168|  28.3k|    ps_codec->s_parse.i4_abs_pic_order_cnt = -1;
 1169|       |
 1170|  28.3k|    ps_codec->i4_chroma_format_idc = CHROMA_FMT_IDC_YUV420;
 1171|  28.3k|    ps_codec->i4_pixel_size_y = PIXEL_SIZE_1BYTE;
  ------------------
  |  |  279|  28.3k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
 1172|  28.3k|    ps_codec->i4_pixel_size_uv = PIXEL_SIZE_1BYTE;
  ------------------
  |  |  279|  28.3k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
 1173|  28.3k|    ps_codec->i4_bit_depth_luma = BIT_DEPTH_8BITS;
  ------------------
  |  |  276|  28.3k|#define BIT_DEPTH_8BITS     8
  ------------------
 1174|  28.3k|    ps_codec->i4_bit_depth_chroma = BIT_DEPTH_8BITS;
  ------------------
  |  |  276|  28.3k|#define BIT_DEPTH_8BITS     8
  ------------------
 1175|       |
 1176|       |    /* Set ref chroma format by default to 420SP UV interleaved */
 1177|  28.3k|    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|  28.3k|    if(IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1182:8): [True: 4.36k, False: 23.9k]
  ------------------
 1183|  4.36k|    {
 1184|  4.36k|        ps_codec->e_ref_chroma_fmt = IV_YUV_420SP_VU;
 1185|  4.36k|    }
 1186|       |
 1187|       |
 1188|       |
 1189|  28.3k|    ps_codec->i4_disable_deblk_pic = 0;
 1190|       |
 1191|  28.3k|    ps_codec->i4_degrade_pic_cnt    = 0;
 1192|  28.3k|    ps_codec->i4_degrade_pics       = 0;
 1193|  28.3k|    ps_codec->i4_degrade_type       = 0;
 1194|  28.3k|    ps_codec->i4_disable_sao_pic    = 0;
 1195|  28.3k|    ps_codec->i4_fullpel_inter_pred = 0;
 1196|  28.3k|    ps_codec->u4_enable_fmt_conv_ahead = 0;
 1197|  28.3k|    ps_codec->i4_share_disp_buf_cnt = 0;
 1198|       |
 1199|  28.3k|    {
 1200|  28.3k|        sps_t *ps_sps = ps_codec->ps_sps_base;
 1201|  28.3k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1202|       |
 1203|   510k|        for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  327|   510k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1203:20): [True: 481k, False: 28.3k]
  ------------------
 1204|   481k|        {
 1205|   481k|            ps_sps->i1_sps_valid = 0;
 1206|   481k|            ps_sps++;
 1207|   481k|        }
 1208|       |
 1209|  1.87M|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  344|  1.87M|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1209:20): [True: 1.84M, False: 28.3k]
  ------------------
 1210|  1.84M|        {
 1211|  1.84M|            ps_pps->i1_pps_valid = 0;
 1212|  1.84M|            ps_pps++;
 1213|  1.84M|        }
 1214|  28.3k|    }
 1215|       |
 1216|  28.3k|    ihevcd_set_default_params(ps_codec);
 1217|       |    /* Initialize MV Bank buffer manager */
 1218|  28.3k|    ihevc_buf_mgr_init((buf_mgr_t *)ps_codec->pv_mv_buf_mgr);
 1219|       |
 1220|       |    /* Initialize Picture buffer manager */
 1221|  28.3k|    ihevc_buf_mgr_init((buf_mgr_t *)ps_codec->pv_pic_buf_mgr);
 1222|       |
 1223|  28.3k|    ps_codec->ps_pic_buf = (pic_buf_t *)ps_codec->pv_pic_buf_base;
 1224|       |
 1225|  28.3k|    memset(ps_codec->ps_pic_buf, 0, BUF_MGR_MAX_CNT  * sizeof(pic_buf_t));
  ------------------
  |  |   37|  28.3k|#define BUF_MGR_MAX_CNT 64
  ------------------
 1226|       |
 1227|       |
 1228|       |
 1229|       |    /* Initialize display buffer manager */
 1230|  28.3k|    ihevc_disp_mgr_init((disp_mgr_t *)ps_codec->pv_disp_buf_mgr);
 1231|       |
 1232|       |    /* Initialize dpb manager */
 1233|  28.3k|    ihevc_dpb_mgr_init((dpb_mgr_t *)ps_codec->pv_dpb_mgr);
 1234|       |
 1235|  28.3k|    ps_codec->e_processor_soc = SOC_GENERIC;
 1236|       |    /* The following can be over-ridden using soc parameter as a hack */
 1237|  28.3k|    ps_codec->u4_nctb = 0x7FFFFFFF;
 1238|  28.3k|    ihevcd_init_arch(ps_codec);
 1239|       |
 1240|  28.3k|    ihevcd_init_function_ptr(ps_codec);
 1241|       |
 1242|  28.3k|    ihevcd_update_function_ptr(ps_codec);
 1243|       |
 1244|  28.3k|    return status;
 1245|  28.3k|}
ihevcd_allocate_static_bufs:
 1272|  24.9k|{
 1273|  24.9k|    WORD32 size;
 1274|  24.9k|    void *pv_buf;
 1275|  24.9k|    UWORD8 *pu1_buf;
 1276|  24.9k|    WORD32 i;
 1277|  24.9k|    codec_t *ps_codec;
 1278|  24.9k|    IV_API_CALL_STATUS_T status = IV_SUCCESS;
 1279|  24.9k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1280|  24.9k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1281|  24.9k|    void *pv_mem_ctxt;
 1282|       |
 1283|       |    /* Request memory for HEVCD object */
 1284|  24.9k|    ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 1285|       |
 1286|  24.9k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1287|  24.9k|    pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 1288|  24.9k|    pv_mem_ctxt  = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1289|       |
 1290|       |
 1291|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(iv_obj_t));
 1292|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1293|  24.9k|    memset(pv_buf, 0, sizeof(iv_obj_t));
 1294|  24.9k|    *pps_codec_obj = (iv_obj_t *)pv_buf;
 1295|  24.9k|    ps_create_op->s_ivd_create_op_t.pv_handle = *pps_codec_obj;
 1296|       |
 1297|       |
 1298|  24.9k|    (*pps_codec_obj)->pv_codec_handle = NULL;
 1299|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(codec_t));
 1300|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1301|  24.9k|    (*pps_codec_obj)->pv_codec_handle = (codec_t *)pv_buf;
 1302|  24.9k|    ps_codec = (codec_t *)pv_buf;
 1303|       |
 1304|  24.9k|    memset(ps_codec, 0, sizeof(codec_t));
 1305|       |
 1306|  24.9k|#ifndef LOGO_EN
 1307|  24.9k|    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.9k|    if((ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) &&
  ------------------
  |  Branch (1313:8): [True: 15.1k, False: 9.80k]
  ------------------
 1314|  15.1k|       (ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (1314:8): [True: 10.3k, False: 4.81k]
  ------------------
 1315|  10.3k|       (ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (1315:8): [True: 6.29k, False: 4.08k]
  ------------------
 1316|  6.29k|    {
 1317|  6.29k|        ps_codec->i4_share_disp_buf = 0;
 1318|  6.29k|    }
 1319|       |
 1320|  24.9k|    if (ps_create_ip->s_ivd_create_ip_t.u4_size == sizeof(ihevcd_cxa_create_ip_t))
  ------------------
  |  Branch (1320:9): [True: 24.9k, False: 0]
  ------------------
 1321|  24.9k|    {
 1322|  24.9k|        ps_codec->u1_enable_cu_info = ps_create_ip->u4_enable_frame_info;
 1323|  24.9k|    }
 1324|       |
 1325|  24.9k|    ps_codec->e_chroma_fmt = ps_create_ip->s_ivd_create_ip_t.e_output_format;
 1326|       |
 1327|  24.9k|    ps_codec->pf_aligned_alloc = pf_aligned_alloc;
 1328|  24.9k|    ps_codec->pf_aligned_free = pf_aligned_free;
 1329|  24.9k|    ps_codec->pv_mem_ctxt = pv_mem_ctxt;
 1330|  24.9k|    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.9k|    size = MAX_PROCESS_THREADS * ithread_get_handle_size();
  ------------------
  |  |  121|  24.9k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.9k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1334|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1335|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1336|  24.9k|    memset(pv_buf, 0, size);
 1337|       |
 1338|   224k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1338:16): [True: 199k, False: 24.9k]
  ------------------
 1339|   199k|    {
 1340|   199k|        WORD32 handle_size = ithread_get_handle_size();
 1341|   199k|        ps_codec->apv_process_thread_handle[i] =
 1342|   199k|                        (UWORD8 *)pv_buf + (i * handle_size);
 1343|   199k|    }
 1344|       |
 1345|  24.9k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1345:8): [True: 24.9k, False: 0]
  ------------------
 1346|  24.9k|    {
 1347|       |        /* Request memory to hold mutex (start/done) for each processing thread */
 1348|  24.9k|        size = 2 * MAX_PROCESS_THREADS * ithread_get_mutex_lock_size();
  ------------------
  |  |  121|  24.9k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.9k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1349|  24.9k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1350|  24.9k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1351|  24.9k|        memset(pv_buf, 0, size);
 1352|       |
 1353|   224k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1353:20): [True: 199k, False: 24.9k]
  ------------------
 1354|   199k|        {
 1355|   199k|            WORD32 ret;
 1356|   199k|            WORD32 mutex_size = ithread_get_mutex_lock_size();
 1357|   199k|            ps_codec->apv_proc_start_mutex[i] =
 1358|   199k|                            (UWORD8 *)pv_buf + (2 * i * mutex_size);
 1359|   199k|            ps_codec->apv_proc_done_mutex[i] =
 1360|   199k|                            (UWORD8 *)pv_buf + ((2 * i + 1) * mutex_size);
 1361|       |
 1362|   199k|            ret = ithread_mutex_init(ps_codec->apv_proc_start_mutex[i]);
 1363|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1364|       |
 1365|   199k|            ret = ithread_mutex_init(ps_codec->apv_proc_done_mutex[i]);
 1366|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1367|   199k|        }
 1368|       |
 1369|  24.9k|        size = 2 * MAX_PROCESS_THREADS * ithread_get_cond_struct_size();
  ------------------
  |  |  121|  24.9k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.9k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1370|  24.9k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1371|  24.9k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1372|  24.9k|        memset(pv_buf, 0, size);
 1373|       |
 1374|   224k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1374:20): [True: 199k, False: 24.9k]
  ------------------
 1375|   199k|        {
 1376|   199k|            WORD32 ret;
 1377|   199k|            WORD32 cond_size = ithread_get_cond_struct_size();
 1378|   199k|            ps_codec->apv_proc_start_condition[i] =
 1379|   199k|                            (UWORD8 *)pv_buf + (2 * i * cond_size);
 1380|   199k|            ps_codec->apv_proc_done_condition[i] =
 1381|   199k|                            (UWORD8 *)pv_buf + ((2 * i + 1) * cond_size);
 1382|       |
 1383|   199k|            ret = ithread_cond_init(ps_codec->apv_proc_start_condition[i]);
 1384|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1385|       |
 1386|   199k|            ret = ithread_cond_init(ps_codec->apv_proc_done_condition[i]);
 1387|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1388|   199k|        }
 1389|  24.9k|    }
 1390|       |
 1391|       |    /* Request memory for static bitstream buffer which holds bitstream after emulation prevention */
 1392|  24.9k|    size = MIN_BITSBUF_SIZE;
  ------------------
  |  |  180|  24.9k|#define MIN_BITSBUF_SIZE (1024 * 1024)
  ------------------
 1393|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); //Alloc extra for parse optimization
 1394|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1395|  24.9k|    memset(pv_buf, 0, size + 16);
 1396|  24.9k|    ps_codec->pu1_bitsbuf_static = pv_buf;
 1397|  24.9k|    ps_codec->u4_bitsbuf_size_static = size;
 1398|       |
 1399|       |    /* size for holding display manager context */
 1400|  24.9k|    size = sizeof(buf_mgr_t);
 1401|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1402|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1403|  24.9k|    memset(pv_buf, 0, size);
 1404|  24.9k|    ps_codec->pv_disp_buf_mgr = pv_buf;
 1405|       |
 1406|       |    /* size for holding dpb manager context */
 1407|  24.9k|    size = sizeof(dpb_mgr_t);
 1408|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1409|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1410|  24.9k|    memset(pv_buf, 0, size);
 1411|  24.9k|    ps_codec->pv_dpb_mgr = pv_buf;
 1412|       |
 1413|       |    /* size for holding buffer manager context */
 1414|  24.9k|    size = sizeof(buf_mgr_t);
 1415|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1416|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1417|  24.9k|    memset(pv_buf, 0, size);
 1418|  24.9k|    ps_codec->pv_pic_buf_mgr = pv_buf;
 1419|       |
 1420|       |    /* size for holding mv buffer manager context */
 1421|  24.9k|    size = sizeof(buf_mgr_t);
 1422|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1423|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1424|  24.9k|    memset(pv_buf, 0, size);
 1425|  24.9k|    ps_codec->pv_mv_buf_mgr = pv_buf;
 1426|       |
 1427|  24.9k|    size = MAX_VPS_CNT * sizeof(vps_t);
  ------------------
  |  |  299|  24.9k|#define MAX_VPS_CNT         16
  ------------------
 1428|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1429|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1430|  24.9k|    memset(pv_buf, 0, size);
 1431|  24.9k|    ps_codec->ps_vps_base = pv_buf;
 1432|  24.9k|    ps_codec->s_parse.ps_vps_base = ps_codec->ps_vps_base;
 1433|       |
 1434|  24.9k|    size = MAX_SPS_CNT * sizeof(sps_t);
  ------------------
  |  |  327|  24.9k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
 1435|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1436|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1437|  24.9k|    memset(pv_buf, 0, size);
 1438|  24.9k|    ps_codec->ps_sps_base = pv_buf;
 1439|  24.9k|    ps_codec->s_parse.ps_sps_base = ps_codec->ps_sps_base;
 1440|       |
 1441|  24.9k|    size = MAX_PPS_CNT * sizeof(pps_t);
  ------------------
  |  |  344|  24.9k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1442|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1443|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1444|  24.9k|    memset(pv_buf, 0, size);
 1445|  24.9k|    ps_codec->ps_pps_base = pv_buf;
 1446|  24.9k|    ps_codec->s_parse.ps_pps_base = ps_codec->ps_pps_base;
 1447|       |
 1448|  24.9k|    size = MAX_SLICE_HDR_CNT * sizeof(slice_header_t);
  ------------------
  |  |  153|  24.9k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  24.9k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1449|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1450|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1451|  24.9k|    memset(pv_buf, 0, size);
 1452|  24.9k|    ps_codec->ps_slice_hdr_base = (slice_header_t *)pv_buf;
 1453|  24.9k|    ps_codec->s_parse.ps_slice_hdr_base = ps_codec->ps_slice_hdr_base;
 1454|       |
 1455|       |
 1456|  24.9k|    SCALING_MAT_SIZE(size)
  ------------------
  |  |  186|  24.9k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  187|  24.9k|{                                                                            \
  |  |  188|  24.9k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.9k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.9k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  189|  24.9k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.9k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.9k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  190|  24.9k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.9k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.9k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  191|  24.9k|    m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.9k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.9k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  192|  24.9k|}
  ------------------
 1457|  24.9k|    size = (MAX_SPS_CNT + MAX_PPS_CNT) * size * sizeof(WORD16);
  ------------------
  |  |  327|  24.9k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
                  size = (MAX_SPS_CNT + MAX_PPS_CNT) * size * sizeof(WORD16);
  ------------------
  |  |  344|  24.9k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1458|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1459|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1460|  24.9k|    memset(pv_buf, 0, size);
 1461|  24.9k|    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.9k|    size = BUF_MGR_MAX_CNT * sizeof(pic_buf_t);
  ------------------
  |  |   37|  24.9k|#define BUF_MGR_MAX_CNT 64
  ------------------
 1469|  24.9k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1470|  24.9k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1471|  24.9k|    memset(pv_buf, 0, size);
 1472|  24.9k|    ps_codec->pv_pic_buf_base = (UWORD8 *)pv_buf;
 1473|       |
 1474|       |    /* TO hold scratch buffers needed for each SAO context */
 1475|  24.9k|    size = (4 * MAX_CTB_SIZE * MAX_CTB_SIZE + 8 * MAX_CTB_SIZE * MAX_CTB_SIZE) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|  24.9k|#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.9k|#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.9k|#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.9k|#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.9k|#define PIXEL_SIZE_2BYTES   sizeof(UWORD16)
  ------------------
 1476|       |
 1477|  24.9k|    size *= MAX_PROCESS_THREADS;
  ------------------
  |  |  121|  24.9k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.9k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1478|       |
 1479|  24.9k|    pu1_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1480|  24.9k|    RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1481|  24.9k|    memset(pu1_buf, 0, size);
 1482|       |
 1483|   224k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1483:16): [True: 199k, False: 24.9k]
  ------------------
 1484|   199k|    {
 1485|   199k|        ps_codec->as_process[i].s_sao_ctxt.pu1_tmp_buf_luma = (UWORD8 *)pu1_buf;
 1486|   199k|        pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES ;
  ------------------
  |  |  351|   199k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES ;
  ------------------
  |  |  351|   199k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES ;
  ------------------
  |  |  280|   199k|#define PIXEL_SIZE_2BYTES   sizeof(UWORD16)
  ------------------
 1487|       |
 1488|   199k|        ps_codec->as_process[i].s_sao_ctxt.pu1_tmp_buf_chroma = (UWORD8 *)pu1_buf;
 1489|   199k|        pu1_buf += 8 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|   199k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 8 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|   199k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 8 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  280|   199k|#define PIXEL_SIZE_2BYTES   sizeof(UWORD16)
  ------------------
 1490|   199k|    }
 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.9k|    size =  3 * 16 * sizeof(UWORD8);
 1496|  24.9k|    pu1_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1497|  24.9k|    RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1498|  24.9k|    memset(pu1_buf, 0, size);
 1499|  24.9k|    ps_codec->s_parse.pu1_luma_intra_pred_mode_left = pu1_buf;
 1500|  24.9k|    ps_codec->s_parse.pu1_luma_intra_pred_mode_top  = pu1_buf + 16;
 1501|       |
 1502|  24.9k|    {
 1503|  24.9k|        WORD32 inter_pred_tmp_buf_size, ntaps_luma;
 1504|  24.9k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1505|  24.9k|        WORD32 res_buf_size;
 1506|  24.9k|#endif
 1507|  24.9k|        WORD32 pic_pu_idx_map_size;
 1508|       |
 1509|       |        /* Max inter pred size */
 1510|  24.9k|        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.9k|        inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE * 2;
  ------------------
  |  |  351|  24.9k|#define MAX_CTB_SIZE        64
  ------------------
                      inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE * 2;
  ------------------
  |  |  351|  24.9k|#define MAX_CTB_SIZE        64
  ------------------
 1513|       |
 1514|  24.9k|        inter_pred_tmp_buf_size = ALIGN64(inter_pred_tmp_buf_size);
  ------------------
  |  |   50|  24.9k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1515|       |
 1516|  24.9k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1517|  24.9k|        res_buf_size = sizeof(WORD16) * (MAX_TU_SIZE * MAX_TU_SIZE);
  ------------------
  |  |  357|  24.9k|#define MAX_TU_SIZE         32
  ------------------
                      res_buf_size = sizeof(WORD16) * (MAX_TU_SIZE * MAX_TU_SIZE);
  ------------------
  |  |  357|  24.9k|#define MAX_TU_SIZE         32
  ------------------
 1518|  24.9k|        res_buf_size = ALIGN64(res_buf_size);
  ------------------
  |  |   50|  24.9k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1519|  24.9k|#endif
 1520|       |
 1521|       |        /* To hold pu_index w.r.t. frame level pu_t array for a CTB */
 1522|  24.9k|        pic_pu_idx_map_size = sizeof(WORD32) * (18 * 18);
 1523|  24.9k|        pic_pu_idx_map_size = ALIGN64(pic_pu_idx_map_size);
  ------------------
  |  |   50|  24.9k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1524|       |
 1525|  24.9k|        size =  inter_pred_tmp_buf_size * 2;
 1526|  24.9k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1527|  24.9k|        size += (res_buf_size * 4);
 1528|  24.9k|#endif
 1529|  24.9k|        size += pic_pu_idx_map_size;
 1530|  24.9k|        size *= MAX_PROCESS_THREADS;
  ------------------
  |  |  121|  24.9k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.9k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1531|       |
 1532|  24.9k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1533|  24.9k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.9k]
  |  |  ------------------
  ------------------
 1534|  24.9k|        memset(pu1_buf, 0, size);
 1535|       |
 1536|   224k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1536:20): [True: 199k, False: 24.9k]
  ------------------
 1537|   199k|        {
 1538|   199k|            ps_codec->as_process[i].pi2_inter_pred_tmp_buf1 = (WORD16 *)pu1_buf;
 1539|   199k|            pu1_buf += inter_pred_tmp_buf_size;
 1540|       |
 1541|   199k|            ps_codec->as_process[i].pi2_inter_pred_tmp_buf2 = (WORD16 *)pu1_buf;
 1542|   199k|            pu1_buf += inter_pred_tmp_buf_size;
 1543|       |
 1544|   199k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1545|   199k|            ps_codec->as_process[i].pi2_res_luma_buf = (WORD16 *)pu1_buf;
 1546|   199k|            pu1_buf += res_buf_size;
 1547|       |
 1548|   199k|            ps_codec->as_process[i].pi2_res_chroma_buf = (WORD16 *)pu1_buf;
 1549|   199k|            pu1_buf += res_buf_size;
 1550|       |
 1551|   199k|            ps_codec->as_process[i].pi2_invscan_out_subtu = (WORD16 *)pu1_buf;
 1552|   199k|            pu1_buf += (res_buf_size * 2);
 1553|   199k|#endif
 1554|       |
 1555|       |            /* Inverse transform intermediate and inverse scan output buffers reuse inter pred scratch buffers */
 1556|   199k|            ps_codec->as_process[i].pi2_itrans_intrmd_buf =
 1557|   199k|                            ps_codec->as_process[i].pi2_inter_pred_tmp_buf2;
 1558|   199k|            ps_codec->as_process[i].pi2_invscan_out =
 1559|   199k|                            ps_codec->as_process[i].pi2_inter_pred_tmp_buf1;
 1560|       |
 1561|   199k|            ps_codec->as_process[i].pu4_pic_pu_idx_map = (UWORD32 *)pu1_buf;
 1562|   199k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_pu_idx_map =
 1563|   199k|                            (UWORD32 *)pu1_buf;
 1564|   199k|            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|   199k|            ps_codec->as_process[i].i4_inter_pred_tmp_buf_strd = MAX_CTB_SIZE;
  ------------------
  |  |  351|   199k|#define MAX_CTB_SIZE        64
  ------------------
 1570|       |
 1571|   199k|        }
 1572|  24.9k|    }
 1573|       |    /* Initialize pointers in PPS structures */
 1574|      0|    {
 1575|  24.9k|        sps_t *ps_sps = ps_codec->ps_sps_base;
 1576|  24.9k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1577|  24.9k|        WORD16 *pi2_scaling_mat =  ps_codec->pi2_scaling_mat;
 1578|  24.9k|        WORD32 scaling_mat_size;
 1579|       |
 1580|  24.9k|        SCALING_MAT_SIZE(scaling_mat_size);
  ------------------
  |  |  186|  24.9k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  187|  24.9k|{                                                                            \
  |  |  188|  24.9k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.9k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.9k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  189|  24.9k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.9k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.9k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  190|  24.9k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.9k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.9k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  191|  24.9k|    m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.9k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.9k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  192|  24.9k|}
  ------------------
 1581|       |
 1582|   449k|        for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  327|   449k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1582:20): [True: 424k, False: 24.9k]
  ------------------
 1583|   424k|        {
 1584|   424k|            ps_sps->pi2_scaling_mat  = pi2_scaling_mat;
 1585|   424k|            pi2_scaling_mat += scaling_mat_size;
 1586|   424k|            ps_sps++;
 1587|   424k|        }
 1588|       |
 1589|  1.64M|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  344|  1.64M|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1589:20): [True: 1.62M, False: 24.9k]
  ------------------
 1590|  1.62M|        {
 1591|  1.62M|            ps_pps->pi2_scaling_mat  = pi2_scaling_mat;
 1592|  1.62M|            pi2_scaling_mat += scaling_mat_size;
 1593|  1.62M|            ps_pps++;
 1594|  1.62M|        }
 1595|  24.9k|    }
 1596|       |
 1597|  24.9k|    return (status);
 1598|  24.9k|}
ihevcd_join_threads:
 1601|  27.6k|{
 1602|  27.6k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1602:8): [True: 27.6k, False: 0]
  ------------------
 1603|  27.6k|    {
 1604|  27.6k|        int i;
 1605|       |        /* Wait for threads */
 1606|  27.6k|        ps_codec->i4_break_threads = 1;
 1607|       |
 1608|   249k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   249k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   249k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1608:20): [True: 221k, False: 27.6k]
  ------------------
 1609|   221k|        {
 1610|   221k|            WORD32 ret;
 1611|   221k|            if(ps_codec->ai4_process_thread_created[i])
  ------------------
  |  Branch (1611:16): [True: 27.3k, False: 194k]
  ------------------
 1612|  27.3k|            {
 1613|  27.3k|                ret = ithread_mutex_lock(ps_codec->apv_proc_start_mutex[i]);
 1614|  27.3k|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  27.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 27.3k]
  |  |  ------------------
  ------------------
 1615|       |
 1616|  27.3k|                ps_codec->ai4_process_start[i] = 1;
 1617|  27.3k|                ret = ithread_cond_signal(ps_codec->apv_proc_start_condition[i]);
 1618|  27.3k|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  27.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 27.3k]
  |  |  ------------------
  ------------------
 1619|       |
 1620|  27.3k|                ret = ithread_mutex_unlock(ps_codec->apv_proc_start_mutex[i]);
 1621|  27.3k|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  27.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 27.3k]
  |  |  ------------------
  ------------------
 1622|       |
 1623|  27.3k|                ithread_join(ps_codec->apv_process_thread_handle[i], NULL);
 1624|       |
 1625|  27.3k|                ps_codec->ai4_process_thread_created[i] = 0;
 1626|  27.3k|            }
 1627|   221k|        }
 1628|  27.6k|    }
 1629|  27.6k|    return IV_SUCCESS;
 1630|  27.6k|}
ihevcd_free_static_bufs:
 1651|  24.9k|{
 1652|  24.9k|    codec_t *ps_codec;
 1653|       |
 1654|  24.9k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1655|  24.9k|    void *pv_mem_ctxt;
 1656|       |
 1657|  24.9k|    ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 1658|  24.9k|    pf_aligned_free = ps_codec->pf_aligned_free;
 1659|  24.9k|    pv_mem_ctxt = ps_codec->pv_mem_ctxt;
 1660|       |
 1661|  24.9k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1661:8): [True: 24.9k, False: 0]
  ------------------
 1662|  24.9k|    {
 1663|       |        /* Wait for threads */
 1664|  24.9k|        ihevcd_join_threads(ps_codec);
 1665|       |
 1666|   224k|        for(int i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1666:24): [True: 199k, False: 24.9k]
  ------------------
 1667|   199k|        {
 1668|   199k|            WORD32 ret;
 1669|   199k|            ret = ithread_cond_destroy(ps_codec->apv_proc_start_condition[i]);
 1670|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1671|       |
 1672|   199k|            ret = ithread_cond_destroy(ps_codec->apv_proc_done_condition[i]);
 1673|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1674|       |
 1675|   199k|            ret = ithread_mutex_destroy(ps_codec->apv_proc_start_mutex[i]);
 1676|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1677|       |
 1678|   199k|            ret = ithread_mutex_destroy(ps_codec->apv_proc_done_mutex[i]);
 1679|   199k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   199k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 199k]
  |  |  ------------------
  ------------------
 1680|   199k|        }
 1681|  24.9k|        ALIGNED_FREE(ps_codec, ps_codec->apv_proc_start_mutex[0]);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1682|  24.9k|        ALIGNED_FREE(ps_codec, ps_codec->apv_proc_start_condition[0]);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1683|  24.9k|    }
 1684|       |
 1685|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->apv_process_thread_handle[0]);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1686|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_bitsbuf_static);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1687|       |
 1688|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_disp_buf_mgr);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1689|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_dpb_mgr);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1690|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_pic_buf_mgr);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1691|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_mv_buf_mgr);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1692|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->ps_vps_base);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1693|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->ps_sps_base);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1694|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->ps_pps_base);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1695|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->ps_slice_hdr_base);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1696|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->pi2_scaling_mat);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1697|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_pic_buf_base);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1698|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu1_luma_intra_pred_mode_left);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1699|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_sao_ctxt.pu1_tmp_buf_luma);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1700|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].pi2_inter_pred_tmp_buf1);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1701|  24.9k|    ALIGNED_FREE(ps_codec, ps_codec_obj->pv_codec_handle);
  ------------------
  |  |   96|  24.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.9k, False: 0]
  |  |  ------------------
  ------------------
 1702|       |
 1703|  24.9k|    if(ps_codec_obj)
  ------------------
  |  Branch (1703:8): [True: 24.9k, False: 0]
  ------------------
 1704|  24.9k|    {
 1705|  24.9k|        pf_aligned_free(pv_mem_ctxt, ps_codec_obj);
 1706|  24.9k|    }
 1707|       |
 1708|  24.9k|    return IV_SUCCESS;
 1709|       |
 1710|  24.9k|}
ihevcd_allocate_dynamic_bufs:
 1733|  25.3k|{
 1734|  25.3k|    WORD32 max_tile_cols, max_tile_rows;
 1735|  25.3k|    WORD32 max_ctb_rows, max_ctb_cols;
 1736|  25.3k|    WORD32 max_num_cu_cols;
 1737|  25.3k|    WORD32 max_num_cu_rows;
 1738|  25.3k|    WORD32 max_num_4x4_cols;
 1739|  25.3k|    WORD32 max_ctb_cnt;
 1740|  25.3k|    WORD32 wd;
 1741|  25.3k|    WORD32 ht;
 1742|  25.3k|    WORD32 i;
 1743|  25.3k|    WORD32 max_dpb_size;
 1744|  25.3k|    void *pv_mem_ctxt = ps_codec->pv_mem_ctxt;
 1745|  25.3k|    void *pv_buf;
 1746|  25.3k|    UWORD8 *pu1_buf;
 1747|  25.3k|    WORD32 size;
 1748|  25.3k|    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|  25.3k|    ihevcd_free_dynamic_bufs(ps_codec);
 1753|       |
 1754|  25.3k|    wd = ALIGN64(ps_codec->i4_wd);
  ------------------
  |  |   50|  25.3k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1755|  25.3k|    ht = ALIGN64(ps_codec->i4_ht);
  ------------------
  |  |   50|  25.3k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1756|       |
 1757|  25.3k|    max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  25.3k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  25.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  25.3k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  25.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 1758|  25.3k|    max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  25.3k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  25.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  25.3k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  25.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 1759|  25.3k|    max_ctb_rows  = ht / MIN_CTB_SIZE;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 1760|  25.3k|    max_ctb_cols  = wd / MIN_CTB_SIZE;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 1761|  25.3k|    max_ctb_cnt   = max_ctb_rows * max_ctb_cols;
 1762|  25.3k|    max_num_cu_cols = wd / MIN_CU_SIZE;
  ------------------
  |  |  373|  25.3k|#define MIN_CU_SIZE         8
  ------------------
 1763|  25.3k|    max_num_cu_rows = ht / MIN_CU_SIZE;
  ------------------
  |  |  373|  25.3k|#define MIN_CU_SIZE         8
  ------------------
 1764|  25.3k|    max_num_4x4_cols = wd / 4;
 1765|       |
 1766|       |    /* Allocate tile structures */
 1767|  25.3k|    size = max_tile_cols * max_tile_rows;
 1768|  25.3k|    size *= sizeof(tile_t);
 1769|  25.3k|    size *= MAX_PPS_CNT;
  ------------------
  |  |  344|  25.3k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1770|       |
 1771|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1772|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1773|  25.3k|    memset(pv_buf, 0, size);
 1774|  25.3k|    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|  25.3k|    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|  25.3k|    size  += max_ctb_rows;
 1788|  25.3k|    size *= sizeof(WORD32);
 1789|       |
 1790|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1791|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1792|  25.3k|    memset(pv_buf, 0, size);
 1793|  25.3k|    ps_codec->pi4_entry_ofst = (WORD32 *)pv_buf;
 1794|       |
 1795|       |    /* Allocate parse skip flag buffer */
 1796|       |    /* 1 bit per 8x8 */
 1797|  25.3k|    size = max_num_cu_cols / 8;
 1798|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1799|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1800|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1801|  25.3k|    memset(pv_buf, 0, size);
 1802|  25.3k|    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|  25.3k|    size =  max_num_cu_cols / 4;
 1807|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1808|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1809|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1810|  25.3k|    memset(pv_buf, 0, size);
 1811|  25.3k|    ps_codec->s_parse.pu4_ct_depth_top = (UWORD32 *)pv_buf;
 1812|       |
 1813|       |    /* Allocate intra flag buffer */
 1814|       |    /* 1 bit per 8x8 */
 1815|  25.3k|    size =  max_num_cu_cols * max_num_cu_rows / 8;
 1816|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1817|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1818|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1819|  25.3k|    memset(pv_buf, 0, size);
 1820|  25.3k|    ps_codec->pu1_pic_intra_flag = (UWORD8 *)pv_buf;
 1821|  25.3k|    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|  25.3k|    size =  ((max_num_cu_cols + 8) * (max_num_cu_rows + 8)) / 8;
 1827|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1828|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1829|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1830|  25.3k|    memset(pv_buf, 1, size);
 1831|  25.3k|    {
 1832|  25.3k|        WORD32 loop_filter_strd = (wd + 63) >> 6;
 1833|  25.3k|        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|  25.3k|        ps_codec->pu1_pic_no_loop_filter_flag = (UWORD8 *)pv_buf + loop_filter_strd + 1;
 1836|  25.3k|        ps_codec->s_parse.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1837|  25.3k|        ps_codec->s_parse.s_deblk_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1838|  25.3k|        ps_codec->s_parse.s_sao_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1839|  25.3k|    }
 1840|       |
 1841|       |    /* Initialize pointers in PPS structures */
 1842|  25.3k|    {
 1843|  25.3k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1844|  25.3k|        tile_t *ps_tile =  ps_codec->ps_tile;
 1845|       |
 1846|  1.67M|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  344|  1.67M|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1846:20): [True: 1.64M, False: 25.3k]
  ------------------
 1847|  1.64M|        {
 1848|  1.64M|            ps_pps->ps_tile = ps_tile;
 1849|  1.64M|            ps_tile += (max_tile_cols * max_tile_rows);
 1850|  1.64M|            ps_pps++;
 1851|  1.64M|        }
 1852|       |
 1853|  25.3k|    }
 1854|       |
 1855|       |    /* Allocate memory for job queue */
 1856|       |
 1857|       |    /* One job per row of CTBs */
 1858|  25.3k|    size  = max_ctb_rows;
 1859|       |
 1860|       |    /* One each tile a row of CTBs, num_jobs has to incremented */
 1861|  25.3k|    size  *= max_tile_cols;
 1862|       |
 1863|       |    /* One format convert/frame copy job per row of CTBs for non-shared mode*/
 1864|  25.3k|    size  += max_ctb_rows;
 1865|       |
 1866|  25.3k|    size *= sizeof(proc_job_t);
 1867|       |
 1868|  25.3k|    size += ihevcd_jobq_ctxt_size();
 1869|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1870|       |
 1871|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1872|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1873|  25.3k|    memset(pv_buf, 0, size);
 1874|  25.3k|    ps_codec->pv_proc_jobq_buf = pv_buf;
 1875|  25.3k|    ps_codec->i4_proc_jobq_buf_size = size;
 1876|       |
 1877|  25.3k|    size =  max_ctb_cnt;
 1878|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1879|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1880|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1881|  25.3k|    memset(pv_buf, 0, size);
 1882|  25.3k|    ps_codec->pu1_parse_map = (UWORD8 *)pv_buf;
 1883|       |
 1884|  25.3k|    size =  max_ctb_cnt;
 1885|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1886|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1887|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1888|  25.3k|    memset(pv_buf, 0, size);
 1889|  25.3k|    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|  25.3k|    size =  (max_num_4x4_cols  /* left */ + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4)/* top */ + 1/* top right */) * sizeof(WORD32);
  ------------------
  |  |  121|  25.3k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  25.3k|#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|  25.3k|#define MAX_CTB_SIZE        64
  ------------------
 1894|  25.3k|    size = ALIGN4(size);
  ------------------
  |  |   54|  25.3k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1895|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1896|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1897|  25.3k|    memset(pv_buf, 0, size);
 1898|       |
 1899|   228k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1899:16): [True: 202k, False: 25.3k]
  ------------------
 1900|   202k|    {
 1901|   202k|        UWORD32 *pu4_buf = (UWORD32 *)pv_buf;
 1902|   202k|        ps_codec->as_process[i].pu4_pic_pu_idx_left = pu4_buf + i * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  351|   202k|#define MAX_CTB_SIZE        64
  ------------------
 1903|   202k|        memset(ps_codec->as_process[i].pu4_pic_pu_idx_left, 0, sizeof(UWORD32) * MAX_CTB_SIZE / 4);
  ------------------
  |  |  351|   202k|#define MAX_CTB_SIZE        64
  ------------------
 1904|   202k|        ps_codec->as_process[i].pu4_pic_pu_idx_top = pu4_buf + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  121|   202k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   202k|#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|   202k|#define MAX_CTB_SIZE        64
  ------------------
 1905|   202k|    }
 1906|  25.3k|    memset(ps_codec->as_process[0].pu4_pic_pu_idx_top, 0, sizeof(UWORD32) * (wd / 4 + 1));
 1907|       |
 1908|  25.3k|    {
 1909|  25.3k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
 1910|  25.3k|        WORD32 chroma_pixel_strd = 2;
 1911|  25.3k|        WORD32 h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (1911:32): [True: 0, False: 25.3k]
  ------------------
 1912|  25.3k|        WORD32 v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (1912:32): [True: 20.6k, False: 4.72k]
  ------------------
 1913|       |
 1914|       |        /* To hold SAO left buffer for luma */
 1915|  25.3k|        size  = ps_codec->i4_pixel_size_y * (MAX(ht, wd));
  ------------------
  |  |   42|  25.3k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 13.0k, False: 12.3k]
  |  |  ------------------
  ------------------
 1916|       |
 1917|       |        /* To hold SAO left buffer for chroma */
 1918|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1918:12): [True: 24.9k, False: 383]
  ------------------
 1919|  24.9k|        {
 1920|  24.9k|            size += ps_codec->i4_pixel_size_uv * (MAX(ht, wd)) * (chroma_pixel_strd / v_samp_factor);
  ------------------
  |  |   42|  24.9k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 12.7k, False: 12.2k]
  |  |  ------------------
  ------------------
 1921|  24.9k|        }
 1922|       |
 1923|       |        /* To hold SAO top buffer for luma */
 1924|  25.3k|        size += ps_codec->i4_pixel_size_y * wd;
 1925|       |
 1926|       |        /* To hold SAO top buffer for chroma */
 1927|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1927:12): [True: 24.9k, False: 383]
  ------------------
 1928|  24.9k|        {
 1929|  24.9k|            size += ps_codec->i4_pixel_size_uv * wd * (chroma_pixel_strd / h_samp_factor);
 1930|  24.9k|        }
 1931|       |
 1932|       |        /* To hold SAO top left luma pixel value for last output ctb in a row*/
 1933|  25.3k|        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|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1936:12): [True: 24.9k, False: 383]
  ------------------
 1937|  24.9k|        {
 1938|  24.9k|            size += ps_codec->i4_pixel_size_uv * max_ctb_rows * 2;
 1939|  24.9k|        }
 1940|       |
 1941|       |        /* To hold SAO top left pixel luma for current ctb - column array*/
 1942|  25.3k|        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|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1945:12): [True: 24.9k, False: 383]
  ------------------
 1946|  24.9k|        {
 1947|  24.9k|            size += ps_codec->i4_pixel_size_uv * max_ctb_rows * 2;
 1948|  24.9k|        }
 1949|       |
 1950|       |        /* To hold SAO top right pixel luma pixel value last output ctb in a row*/
 1951|  25.3k|        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|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1954:12): [True: 24.9k, False: 383]
  ------------------
 1955|  24.9k|        {
 1956|  24.9k|            size += ps_codec->i4_pixel_size_uv * max_ctb_cols * 2;
 1957|  24.9k|        }
 1958|       |
 1959|       |        /*To hold SAO botton bottom left pixels for luma*/
 1960|  25.3k|        size += ps_codec->i4_pixel_size_y * max_ctb_rows;
 1961|       |
 1962|       |        /*To hold SAO botton bottom left pixels for chroma*/
 1963|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1963:12): [True: 24.9k, False: 383]
  ------------------
 1964|  24.9k|        {
 1965|  24.9k|            size += ps_codec->i4_pixel_size_uv * max_ctb_rows * 2;
 1966|  24.9k|        }
 1967|       |
 1968|  25.3k|        size = ALIGN64(size);
  ------------------
  |  |   50|  25.3k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1969|       |
 1970|  25.3k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1971|  25.3k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 1972|  25.3k|        memset(pu1_buf, 0, size);
 1973|       |
 1974|   228k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1974:20): [True: 202k, False: 25.3k]
  ------------------
 1975|   202k|        {
 1976|   202k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_luma = (UWORD8 *)pu1_buf;
 1977|   202k|        }
 1978|  25.3k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_luma = (UWORD8 *)pu1_buf;
 1979|  25.3k|        pu1_buf += MAX(ht, wd) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |   42|  25.3k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 13.0k, False: 12.3k]
  |  |  ------------------
  ------------------
 1980|       |
 1981|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1981:12): [True: 24.9k, False: 383]
  ------------------
 1982|  24.9k|        {
 1983|   224k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1983:24): [True: 199k, False: 24.9k]
  ------------------
 1984|   199k|            {
 1985|   199k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf;
 1986|   199k|            }
 1987|  24.9k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf;
 1988|  24.9k|            pu1_buf += MAX(ht, wd) * (chroma_pixel_strd / v_samp_factor) * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |   42|  24.9k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 12.7k, False: 12.2k]
  |  |  ------------------
  ------------------
 1989|  24.9k|        }
 1990|       |
 1991|   228k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1991:20): [True: 202k, False: 25.3k]
  ------------------
 1992|   202k|        {
 1993|   202k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf;
 1994|   202k|        }
 1995|  25.3k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf;
 1996|  25.3k|        pu1_buf += wd * ps_codec->i4_pixel_size_y;
 1997|       |
 1998|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1998:12): [True: 24.9k, False: 383]
  ------------------
 1999|  24.9k|        {
 2000|   224k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2000:24): [True: 199k, False: 24.9k]
  ------------------
 2001|   199k|            {
 2002|   199k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf;
 2003|   199k|            }
 2004|  24.9k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf;
 2005|  24.9k|            pu1_buf += wd * (chroma_pixel_strd / h_samp_factor) * ps_codec->i4_pixel_size_uv;
 2006|  24.9k|        }
 2007|       |
 2008|   228k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2008:20): [True: 202k, False: 25.3k]
  ------------------
 2009|   202k|        {
 2010|   202k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf;
 2011|   202k|        }
 2012|  25.3k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf;
 2013|  25.3k|        pu1_buf += (ht / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2014|       |
 2015|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2015:12): [True: 24.9k, False: 383]
  ------------------
 2016|  24.9k|        {
 2017|   224k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2017:24): [True: 199k, False: 24.9k]
  ------------------
 2018|   199k|            {
 2019|   199k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf;
 2020|   199k|            }
 2021|  24.9k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf;
 2022|  24.9k|            pu1_buf += (ht / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.9k|#define MIN_CTB_SIZE        16
  ------------------
 2023|  24.9k|        }
 2024|       |
 2025|   228k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2025:20): [True: 202k, False: 25.3k]
  ------------------
 2026|   202k|        {
 2027|   202k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_curr_ctb = (UWORD8 *)pu1_buf;
 2028|   202k|        }
 2029|  25.3k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_curr_ctb = (UWORD8 *)pu1_buf;
 2030|  25.3k|        pu1_buf += (ht / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2031|       |
 2032|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2032:12): [True: 24.9k, False: 383]
  ------------------
 2033|  24.9k|        {
 2034|   224k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2034:24): [True: 199k, False: 24.9k]
  ------------------
 2035|   199k|            {
 2036|   199k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf;
 2037|   199k|            }
 2038|  24.9k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf;
 2039|  24.9k|            pu1_buf += (ht / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.9k|#define MIN_CTB_SIZE        16
  ------------------
 2040|  24.9k|        }
 2041|       |
 2042|   228k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2042:20): [True: 202k, False: 25.3k]
  ------------------
 2043|   202k|        {
 2044|   202k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf;
 2045|   202k|        }
 2046|  25.3k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf;
 2047|  25.3k|        pu1_buf += (wd / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2048|       |
 2049|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2049:12): [True: 24.9k, False: 383]
  ------------------
 2050|  24.9k|        {
 2051|   224k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2051:24): [True: 199k, False: 24.9k]
  ------------------
 2052|   199k|            {
 2053|   199k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf;
 2054|   199k|            }
 2055|  24.9k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf;
 2056|  24.9k|            pu1_buf += (wd / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.9k|#define MIN_CTB_SIZE        16
  ------------------
 2057|  24.9k|        }
 2058|       |
 2059|       |        /*Per CTB, Store 1 value for luma , 2 values for chroma*/
 2060|   228k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2060:20): [True: 202k, False: 25.3k]
  ------------------
 2061|   202k|        {
 2062|   202k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf;
 2063|   202k|        }
 2064|  25.3k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf;
 2065|  25.3k|        pu1_buf += (ht / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2066|       |
 2067|  25.3k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2067:12): [True: 24.9k, False: 383]
  ------------------
 2068|  24.9k|        {
 2069|   224k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   224k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   224k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2069:24): [True: 199k, False: 24.9k]
  ------------------
 2070|   199k|            {
 2071|   199k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf;
 2072|   199k|            }
 2073|  24.9k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf;
 2074|  24.9k|            pu1_buf += (ht / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.9k|#define MIN_CTB_SIZE        16
  ------------------
 2075|  24.9k|        }
 2076|  25.3k|    }
 2077|       |
 2078|       |
 2079|      0|    {
 2080|  25.3k|        UWORD8 *pu1_buf = (UWORD8 *)pv_buf;
 2081|  25.3k|        WORD32 vert_bs_size, horz_bs_size;
 2082|  25.3k|        WORD32 qp_const_flag_size;
 2083|  25.3k|        WORD32 qp_size;
 2084|  25.3k|        WORD32 num_8x8;
 2085|       |
 2086|       |        /* Max Number of vertical edges */
 2087|  25.3k|        vert_bs_size = wd / 8 + 2 * MAX_CTB_SIZE / 8;
  ------------------
  |  |  351|  25.3k|#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|  25.3k|        vert_bs_size *= (ht + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  351|  25.3k|#define MAX_CTB_SIZE        64
  ------------------
                      vert_bs_size *= (ht + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  358|  25.3k|#define MIN_TU_SIZE         4
  ------------------
 2091|       |
 2092|       |        /* Number of bytes */
 2093|  25.3k|        vert_bs_size /= 8;
 2094|       |
 2095|       |        /* Two bits per edge */
 2096|  25.3k|        vert_bs_size *= 2;
 2097|       |
 2098|       |        /* Max Number of horizontal edges */
 2099|  25.3k|        horz_bs_size = ht / 8 + MAX_CTB_SIZE / 8;
  ------------------
  |  |  351|  25.3k|#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|  25.3k|        horz_bs_size *= (wd + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  351|  25.3k|#define MAX_CTB_SIZE        64
  ------------------
                      horz_bs_size *= (wd + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  358|  25.3k|#define MIN_TU_SIZE         4
  ------------------
 2103|       |
 2104|       |        /* Number of bytes */
 2105|  25.3k|        horz_bs_size /= 8;
 2106|       |
 2107|       |        /* Two bits per edge */
 2108|  25.3k|        horz_bs_size *= 2;
 2109|       |
 2110|       |        /* Max CTBs in a row */
 2111|  25.3k|        qp_const_flag_size = wd / MIN_CTB_SIZE + 1 /* The last ctb row deblk is done in last ctb + 1 row.*/;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2112|       |
 2113|       |        /* Max CTBs in a column */
 2114|  25.3k|        qp_const_flag_size *= ht / MIN_CTB_SIZE;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2115|       |
 2116|       |        /* Number of bytes */
 2117|  25.3k|        qp_const_flag_size /= 8;
 2118|       |
 2119|       |        /* QP changes at CU level - So store at 8x8 level */
 2120|  25.3k|        num_8x8 = (wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE);
  ------------------
  |  |  373|  25.3k|#define MIN_CU_SIZE         8
  ------------------
                      num_8x8 = (wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE);
  ------------------
  |  |  373|  25.3k|#define MIN_CU_SIZE         8
  ------------------
 2121|  25.3k|        qp_size = num_8x8;
 2122|       |
 2123|       |        /* To hold vertical boundary strength */
 2124|  25.3k|        size += vert_bs_size;
 2125|       |
 2126|       |        /* To hold horizontal boundary strength */
 2127|  25.3k|        size += horz_bs_size;
 2128|       |
 2129|       |        /* To hold QP */
 2130|  25.3k|        size += qp_size;
 2131|       |
 2132|       |        /* To hold QP const in CTB flags */
 2133|  25.3k|        size += qp_const_flag_size;
 2134|       |
 2135|  25.3k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2136|  25.3k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 2137|       |
 2138|  25.3k|        memset(pu1_buf, 0, size);
 2139|       |
 2140|   228k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2140:20): [True: 202k, False: 25.3k]
  ------------------
 2141|   202k|        {
 2142|   202k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2143|   202k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2144|   202k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2145|   202k|            pu1_buf += vert_bs_size;
 2146|       |
 2147|   202k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2148|   202k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2149|   202k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2150|   202k|            pu1_buf += horz_bs_size;
 2151|       |
 2152|   202k|            ps_codec->as_process[i].s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2153|   202k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2154|   202k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2155|   202k|            pu1_buf += qp_size;
 2156|       |
 2157|   202k|            ps_codec->as_process[i].s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2158|   202k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2159|   202k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2160|   202k|            pu1_buf += qp_const_flag_size;
 2161|       |
 2162|   202k|            pu1_buf -= (vert_bs_size + horz_bs_size + qp_size + qp_const_flag_size);
 2163|   202k|        }
 2164|  25.3k|        ps_codec->s_parse.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2165|  25.3k|        pu1_buf += vert_bs_size;
 2166|       |
 2167|  25.3k|        ps_codec->s_parse.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2168|  25.3k|        pu1_buf += horz_bs_size;
 2169|       |
 2170|  25.3k|        ps_codec->s_parse.s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2171|  25.3k|        pu1_buf += qp_size;
 2172|       |
 2173|  25.3k|        ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2174|  25.3k|        pu1_buf += qp_const_flag_size;
 2175|       |
 2176|  25.3k|    }
 2177|       |
 2178|       |    /* Max CTBs in a row */
 2179|  25.3k|    size  = wd / MIN_CTB_SIZE;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2180|       |    /* Max CTBs in a column */
 2181|  25.3k|    size *= (ht / MIN_CTB_SIZE + 2) /* Top row and bottom row extra. This ensures accessing left,top in first row
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2182|  25.3k|                                              and right in last row will not result in invalid access*/;
 2183|       |
 2184|  25.3k|    size *= sizeof(UWORD16);
 2185|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2186|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 2187|  25.3k|    memset(pv_buf, 0, size);
 2188|       |
 2189|  25.3k|    ps_codec->pu1_tile_idx_base = pv_buf;
 2190|   228k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2190:16): [True: 202k, False: 25.3k]
  ------------------
 2191|   202k|    {
 2192|   202k|        ps_codec->as_process[i].pu1_tile_idx = (UWORD16 *)pv_buf + wd / MIN_CTB_SIZE /* Offset 1 row */;
  ------------------
  |  |  352|   202k|#define MIN_CTB_SIZE        16
  ------------------
 2193|   202k|    }
 2194|       |
 2195|  25.3k|    size = sizeof(sao_t);
 2196|       |
 2197|       |    /* MAX number of CTBs in a row */
 2198|  25.3k|    size *= wd / MIN_CTB_SIZE;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2199|       |
 2200|       |    /* MAX number of CTBs in a column */
 2201|  25.3k|    size *= ht / MIN_CTB_SIZE;
  ------------------
  |  |  352|  25.3k|#define MIN_CTB_SIZE        16
  ------------------
 2202|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2203|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 2204|  25.3k|    memset(pv_buf, 0, size);
 2205|       |
 2206|  25.3k|    ps_codec->s_parse.ps_pic_sao = (sao_t *)pv_buf;
 2207|  25.3k|    ps_codec->s_parse.s_sao_ctxt.ps_pic_sao = (sao_t *)pv_buf;
 2208|   228k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2208:16): [True: 202k, False: 25.3k]
  ------------------
 2209|   202k|    {
 2210|   202k|        ps_codec->as_process[i].s_sao_ctxt.ps_pic_sao = ps_codec->s_parse.ps_pic_sao;
 2211|   202k|    }
 2212|       |
 2213|       |    /* Only if (frame size * compression factor) is greater than MIN_BITSBUF_SIZE,
 2214|       |    then allocate dynamic bistream buffer */
 2215|  25.3k|    ps_codec->pu1_bitsbuf_dynamic = NULL;
 2216|  25.3k|    {
 2217|  25.3k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
 2218|       |
 2219|  25.3k|        if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (2219:12): [True: 0, False: 25.3k]
  ------------------
 2220|      0|        {
 2221|      0|            size = wd * ht * 3 * pixel_size;
 2222|      0|        }
 2223|  25.3k|        else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (2223:17): [True: 4.34k, False: 21.0k]
  ------------------
 2224|  4.34k|        {
 2225|  4.34k|            size = wd * ht * 2 * pixel_size;
 2226|  4.34k|        }
 2227|  21.0k|        else
 2228|  21.0k|        {
 2229|  21.0k|            size = wd * ht * pixel_size;
 2230|  21.0k|        }
 2231|       |
 2232|  25.3k|        if(size > MIN_BITSBUF_SIZE)
  ------------------
  |  |  180|  25.3k|#define MIN_BITSBUF_SIZE (1024 * 1024)
  ------------------
  |  Branch (2232:12): [True: 2.83k, False: 22.5k]
  ------------------
 2233|  2.83k|        {
 2234|       |            //Alloc extra for parse optimization
 2235|  2.83k|            pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size + 16);
 2236|  2.83k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  2.83k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.83k]
  |  |  ------------------
  ------------------
 2237|       |
 2238|  2.83k|            memset(pv_buf, 0, size + 16);
 2239|  2.83k|            ps_codec->pu1_bitsbuf_dynamic = pv_buf;
 2240|  2.83k|            ps_codec->u4_bitsbuf_size_dynamic = size;
 2241|  2.83k|        }
 2242|  25.3k|    }
 2243|       |
 2244|  25.3k|    size = ihevcd_get_tu_data_size(ps_codec, wd * ht);
 2245|  25.3k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2246|  25.3k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 2247|  25.3k|    memset(pv_buf, 0, size);
 2248|  25.3k|    ps_codec->pv_tu_data = pv_buf;
 2249|       |
 2250|       |    /* CU info map to store qp and CU type at 8x8 level */
 2251|  25.3k|    if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2251:8): [True: 0, False: 25.3k]
  ------------------
 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|  25.3k|    {
 2267|  25.3k|        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|  25.3k|        max_dpb_size = ps_codec->u4_thumbnail_mode ? 0 :
  ------------------
  |  Branch (2281:24): [True: 0, False: 25.3k]
  ------------------
 2282|  25.3k|                        ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
 2283|       |        /* Size for holding mv_buf_t for each MV Bank
 2284|       |         * One extra MV Bank is needed to hold current pics MV bank.
 2285|       |         */
 2286|  25.3k|        size = (max_dpb_size + 1) * sizeof(mv_buf_t);
 2287|       |
 2288|  25.3k|        size += (max_dpb_size + 1) *
 2289|  25.3k|                        ihevcd_get_pic_mv_bank_size(wd * ht);
 2290|       |
 2291|  25.3k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2292|  25.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 2293|  25.3k|        memset(pv_buf, 0, size);
 2294|       |
 2295|  25.3k|        ps_codec->pv_mv_bank_buf_base = pv_buf;
 2296|  25.3k|        ps_codec->i4_total_mv_bank_size = size;
 2297|       |
 2298|  25.3k|    }
 2299|       |
 2300|       |    /* In case of non-shared mode allocate for reference picture buffers */
 2301|       |    /* In case of shared and 420p output, allocate for chroma samples */
 2302|  25.3k|    if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (2302:8): [True: 25.3k, False: 0]
  ------------------
 2303|  25.3k|    {
 2304|       |        /* Number of buffers is doubled in order to return one frame at a time instead of sending
 2305|       |         * multiple outputs during dpb full case.
 2306|       |         * Also note one extra buffer is allocted to store current picture
 2307|       |         * In case of asynchronous parsing and processing, number of buffers should increase here
 2308|       |         * based on when parsing and processing threads are synchronized
 2309|       |         */
 2310|  25.3k|        size = ihevcd_get_total_pic_buf_size(ps_codec, wd, ht);
 2311|  25.3k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2312|  25.3k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 2313|  25.3k|        memset(pv_buf, 0, size);
 2314|       |
 2315|  25.3k|        ps_codec->i4_total_pic_buf_size = size;
 2316|  25.3k|        ps_codec->pu1_ref_pic_buf_base = (UWORD8 *)pv_buf;
 2317|  25.3k|    }
 2318|       |
 2319|  25.3k|    ps_codec->pv_proc_jobq = ihevcd_jobq_init(ps_codec->pv_proc_jobq_buf, ps_codec->i4_proc_jobq_buf_size);
 2320|  25.3k|    RETURN_IF((ps_codec->pv_proc_jobq == NULL), IV_FAIL);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
 2321|       |
 2322|       |    /* Update the jobq context to all the threads */
 2323|  25.3k|    ps_codec->s_parse.pv_proc_jobq = ps_codec->pv_proc_jobq;
 2324|   228k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   228k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   228k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2324:16): [True: 202k, False: 25.3k]
  ------------------
 2325|   202k|    {
 2326|   202k|        ps_codec->as_process[i].pv_proc_jobq = ps_codec->pv_proc_jobq;
 2327|   202k|        ps_codec->as_process[i].i4_id = i;
 2328|   202k|        ps_codec->as_process[i].ps_codec = ps_codec;
 2329|       |
 2330|       |        /* Set the following to zero assuming it is a single core solution
 2331|       |         * When threads are launched these will be set appropriately
 2332|       |         */
 2333|   202k|        ps_codec->as_process[i].i4_check_parse_status = 0;
 2334|   202k|        ps_codec->as_process[i].i4_check_proc_status = 0;
 2335|   202k|    }
 2336|       |
 2337|  25.3k|    ps_codec->u4_allocate_dynamic_done = 1;
 2338|       |
 2339|  25.3k|    return IV_SUCCESS;
 2340|  25.3k|}
ihevcd_free_dynamic_bufs:
 2362|  78.7k|{
 2363|       |
 2364|  78.7k|    if(ps_codec->pv_proc_jobq)
  ------------------
  |  Branch (2364:8): [True: 25.3k, False: 53.3k]
  ------------------
 2365|  25.3k|    {
 2366|  25.3k|        ihevcd_jobq_deinit(ps_codec->pv_proc_jobq);
 2367|  25.3k|        ps_codec->pv_proc_jobq = NULL;
 2368|  25.3k|    }
 2369|       |
 2370|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->ps_tile);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2371|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pi4_entry_ofst);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2372|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu4_skip_cu_top);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2373|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu4_ct_depth_top);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2374|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_pic_intra_flag);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2375|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_pic_no_loop_filter_flag_base);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2376|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pv_proc_jobq_buf);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2377|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_parse_map);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2378|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_proc_map);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2379|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].pu4_pic_pu_idx_left);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2380|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_sao_ctxt.pu1_sao_src_left_luma);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2381|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_bs_ctxt.pu4_pic_vert_bs);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2382|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_tile_idx_base);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2383|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.ps_pic_sao);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2384|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_bitsbuf_dynamic);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 2.83k, False: 75.8k]
  |  |  ------------------
  ------------------
 2385|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pv_tu_data);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2386|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pv_mv_bank_buf_base);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2387|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_ref_pic_buf_base);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 25.3k, False: 53.3k]
  |  |  ------------------
  ------------------
 2388|  78.7k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_cur_chroma_ref_buf);
  ------------------
  |  |   96|  78.7k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  78.7k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 0, False: 78.7k]
  |  |  ------------------
  ------------------
 2389|  78.7k|    if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2389:8): [True: 0, False: 78.7k]
  ------------------
 2390|      0|    {
 2391|      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]
  |  |  ------------------
  ------------------
 2392|      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]
  |  |  ------------------
  ------------------
 2393|      0|    }
 2394|       |
 2395|  78.7k|    ps_codec->u4_allocate_dynamic_done = 0;
 2396|  78.7k|    return IV_SUCCESS;
 2397|  78.7k|}
ihevcd_create:
 2428|  24.9k|{
 2429|  24.9k|    ihevcd_cxa_create_ip_t *ps_create_ip;
 2430|  24.9k|    ihevcd_cxa_create_op_t *ps_create_op;
 2431|       |
 2432|  24.9k|    WORD32 ret;
 2433|  24.9k|    codec_t *ps_codec;
 2434|  24.9k|    ps_create_ip = (ihevcd_cxa_create_ip_t *)pv_api_ip;
 2435|  24.9k|    ps_create_op = (ihevcd_cxa_create_op_t *)pv_api_op;
 2436|       |
 2437|  24.9k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2438|  24.9k|    ps_codec_obj = NULL;
 2439|  24.9k|    ret = ihevcd_allocate_static_bufs(&ps_codec_obj, pv_api_ip, pv_api_op);
 2440|       |
 2441|       |    /* If allocation of some buffer fails, then free buffers allocated till then */
 2442|  24.9k|    if(IV_FAIL == ret)
  ------------------
  |  Branch (2442:8): [True: 0, False: 24.9k]
  ------------------
 2443|      0|    {
 2444|      0|        if(NULL != ps_codec_obj)
  ------------------
  |  Branch (2444:12): [True: 0, False: 0]
  ------------------
 2445|      0|        {
 2446|      0|            if(ps_codec_obj->pv_codec_handle)
  ------------------
  |  Branch (2446:16): [True: 0, False: 0]
  ------------------
 2447|      0|            {
 2448|      0|                ihevcd_free_static_bufs(ps_codec_obj);
 2449|      0|            }
 2450|      0|            else
 2451|      0|            {
 2452|      0|                void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 2453|      0|                void *pv_mem_ctxt;
 2454|       |
 2455|      0|                pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 2456|      0|                pv_mem_ctxt  = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2457|      0|                pf_aligned_free(pv_mem_ctxt, ps_codec_obj);
 2458|      0|            }
 2459|      0|        }
 2460|      0|        ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
 2461|      0|        ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
 2462|       |
 2463|      0|        return IV_FAIL;
 2464|      0|    }
 2465|  24.9k|    ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 2466|  24.9k|    if (ps_create_ip->u4_enable_yuv_formats == 0) {
  ------------------
  |  Branch (2466:9): [True: 0, False: 24.9k]
  ------------------
 2467|      0|        ps_create_ip->u4_enable_yuv_formats = 1 << CHROMA_FMT_IDC_YUV420;
 2468|      0|    }
 2469|  24.9k|    ps_codec->u4_enable_yuv_formats = ps_create_ip->u4_enable_yuv_formats;
 2470|  24.9k|    ps_codec->u4_enable_hbd = ps_create_ip->u4_enable_hbd;
 2471|  24.9k|    ps_codec->u4_thumbnail_mode = ps_create_ip->u4_thumbnail_mode;
 2472|       |
 2473|  24.9k|    ret = ihevcd_init(ps_codec);
 2474|       |
 2475|  24.9k|    TRACE_INIT(NULL);
 2476|  24.9k|    STATS_INIT();
  ------------------
  |  |  137|  24.9k|#define STATS_INIT()  ;
  ------------------
 2477|       |
 2478|  24.9k|    return ret;
 2479|  24.9k|}
ihevcd_delete:
 2506|  24.9k|{
 2507|  24.9k|    codec_t *ps_dec;
 2508|  24.9k|    ihevcd_cxa_delete_ip_t *ps_ip = (ihevcd_cxa_delete_ip_t *)pv_api_ip;
 2509|  24.9k|    ihevcd_cxa_delete_op_t *ps_op = (ihevcd_cxa_delete_op_t *)pv_api_op;
 2510|       |
 2511|  24.9k|    ps_dec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 2512|  24.9k|    UNUSED(ps_ip);
  ------------------
  |  |   38|  24.9k|#define UNUSED(x) ((void)(x))
  ------------------
 2513|  24.9k|    ps_op->s_ivd_delete_op_t.u4_error_code = 0;
 2514|  24.9k|    ihevcd_free_dynamic_bufs(ps_dec);
 2515|  24.9k|    ihevcd_free_static_bufs(ps_codec_obj);
 2516|  24.9k|    return IV_SUCCESS;
 2517|  24.9k|}
ihevcd_set_params:
 3091|  49.9k|{
 3092|       |
 3093|  49.9k|    codec_t *ps_codec;
 3094|  49.9k|    WORD32 ret = IV_SUCCESS;
 3095|  49.9k|    WORD32 strd;
 3096|  49.9k|    ivd_ctl_set_config_ip_t *s_ctl_dynparams_ip =
 3097|  49.9k|                    (ivd_ctl_set_config_ip_t *)pv_api_ip;
 3098|  49.9k|    ivd_ctl_set_config_op_t *s_ctl_dynparams_op =
 3099|  49.9k|                    (ivd_ctl_set_config_op_t *)pv_api_op;
 3100|       |
 3101|  49.9k|    ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 3102|       |
 3103|  49.9k|    s_ctl_dynparams_op->u4_error_code = 0;
 3104|       |
 3105|  49.9k|    ps_codec->e_pic_skip_mode = s_ctl_dynparams_ip->e_frm_skip_mode;
 3106|       |
 3107|  49.9k|    if(s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_NONE)
  ------------------
  |  Branch (3107:8): [True: 0, False: 49.9k]
  ------------------
 3108|      0|    {
 3109|       |
 3110|      0|        if((s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_P) &&
  ------------------
  |  Branch (3110:12): [True: 0, False: 0]
  ------------------
 3111|      0|           (s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_B) &&
  ------------------
  |  Branch (3111:12): [True: 0, False: 0]
  ------------------
 3112|      0|           (s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_PB))
  ------------------
  |  Branch (3112:12): [True: 0, False: 0]
  ------------------
 3113|      0|        {
 3114|      0|            s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 3115|      0|            ret = IV_FAIL;
 3116|      0|        }
 3117|      0|    }
 3118|       |
 3119|  49.9k|    strd = ps_codec->i4_disp_strd;
 3120|  49.9k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (3120:8): [True: 0, False: 49.9k]
  ------------------
 3121|      0|    {
 3122|      0|        strd = ps_codec->i4_strd;
 3123|      0|    }
 3124|       |
 3125|       |
 3126|  49.9k|    {
 3127|  49.9k|        if((WORD32)s_ctl_dynparams_ip->u4_disp_wd >= ps_codec->i4_disp_wd)
  ------------------
  |  Branch (3127:12): [True: 27.9k, False: 22.0k]
  ------------------
 3128|  27.9k|        {
 3129|  27.9k|            strd = s_ctl_dynparams_ip->u4_disp_wd;
 3130|  27.9k|        }
 3131|  22.0k|        else if(0 == ps_codec->i4_sps_done)
  ------------------
  |  Branch (3131:17): [True: 0, False: 22.0k]
  ------------------
 3132|      0|        {
 3133|      0|            strd = s_ctl_dynparams_ip->u4_disp_wd;
 3134|      0|        }
 3135|  22.0k|        else if(s_ctl_dynparams_ip->u4_disp_wd == 0)
  ------------------
  |  Branch (3135:17): [True: 22.0k, False: 0]
  ------------------
 3136|  22.0k|        {
 3137|  22.0k|            strd = ps_codec->i4_disp_strd;
 3138|  22.0k|        }
 3139|      0|        else
 3140|      0|        {
 3141|      0|            strd = 0;
 3142|      0|            s_ctl_dynparams_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 3143|      0|            s_ctl_dynparams_op->u4_error_code |= IHEVCD_INVALID_DISP_STRD;
 3144|      0|            ret = IV_FAIL;
 3145|      0|        }
 3146|  49.9k|    }
 3147|       |
 3148|       |    // output stride needs to be even for all formats other than 400 and 444
 3149|  49.9k|    if(ps_codec->e_chroma_fmt != IV_GRAY && ps_codec->e_chroma_fmt != IV_YUV_444P)
  ------------------
  |  Branch (3149:8): [True: 39.5k, False: 10.4k]
  |  Branch (3149:45): [True: 39.2k, False: 378]
  ------------------
 3150|  39.2k|    {
 3151|  39.2k|        if(strd & 1)
  ------------------
  |  Branch (3151:12): [True: 28, False: 39.1k]
  ------------------
 3152|     28|        {
 3153|     28|            s_ctl_dynparams_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 3154|     28|            s_ctl_dynparams_op->u4_error_code |= IHEVCD_INVALID_DISP_STRD;
 3155|     28|            ret = IV_FAIL;
 3156|     28|        }
 3157|  39.2k|    }
 3158|       |
 3159|  49.9k|    ps_codec->i4_disp_strd = strd;
 3160|  49.9k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (3160:8): [True: 0, False: 49.9k]
  ------------------
 3161|      0|    {
 3162|      0|        ps_codec->i4_strd = strd;
 3163|      0|    }
 3164|       |
 3165|  49.9k|    if(s_ctl_dynparams_ip->e_vid_dec_mode == IVD_DECODE_FRAME)
  ------------------
  |  Branch (3165:8): [True: 24.9k, False: 24.9k]
  ------------------
 3166|  24.9k|        ps_codec->i4_header_mode = 0;
 3167|  24.9k|    else if(s_ctl_dynparams_ip->e_vid_dec_mode == IVD_DECODE_HEADER)
  ------------------
  |  Branch (3167:13): [True: 24.9k, False: 0]
  ------------------
 3168|  24.9k|        ps_codec->i4_header_mode = 1;
 3169|      0|    else
 3170|      0|    {
 3171|       |
 3172|      0|        s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 3173|      0|        ps_codec->i4_header_mode = 1;
 3174|      0|        ret = IV_FAIL;
 3175|      0|    }
 3176|       |
 3177|  49.9k|    ps_codec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 3178|       |
 3179|  49.9k|    if((s_ctl_dynparams_ip->e_frm_out_mode != IVD_DECODE_FRAME_OUT) &&
  ------------------
  |  Branch (3179:8): [True: 49.9k, False: 0]
  ------------------
 3180|  49.9k|       (s_ctl_dynparams_ip->e_frm_out_mode != IVD_DISPLAY_FRAME_OUT))
  ------------------
  |  Branch (3180:8): [True: 0, False: 49.9k]
  ------------------
 3181|      0|    {
 3182|      0|        s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 3183|      0|        ret = IV_FAIL;
 3184|      0|    }
 3185|  49.9k|    ps_codec->e_frm_out_mode = s_ctl_dynparams_ip->e_frm_out_mode;
 3186|       |
 3187|  49.9k|    if(ps_codec->u4_thumbnail_mode)
  ------------------
  |  Branch (3187:8): [True: 0, False: 49.9k]
  ------------------
 3188|      0|    {
 3189|      0|        ps_codec->e_pic_skip_mode = IVD_SKIP_PB;
 3190|      0|        ps_codec->e_frm_out_mode = IVD_DECODE_FRAME_OUT;
 3191|      0|    }
 3192|       |
 3193|  49.9k|    return ret;
 3194|       |
 3195|  49.9k|}
ihevcd_reset:
 3222|  2.68k|{
 3223|  2.68k|    codec_t *ps_codec;
 3224|  2.68k|    ivd_ctl_reset_op_t *s_ctl_reset_op = (ivd_ctl_reset_op_t *)pv_api_op;
 3225|  2.68k|    UNUSED(pv_api_ip);
  ------------------
  |  |   38|  2.68k|#define UNUSED(x) ((void)(x))
  ------------------
 3226|  2.68k|    ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 3227|       |
 3228|  2.68k|    if(ps_codec != NULL)
  ------------------
  |  Branch (3228:8): [True: 2.68k, False: 0]
  ------------------
 3229|  2.68k|    {
 3230|  2.68k|        DEBUG("\nReset called \n");
  ------------------
  |  |   49|  2.68k|#define DEBUG(...) {}
  ------------------
 3231|  2.68k|        ihevcd_join_threads(ps_codec);
 3232|       |
 3233|  2.68k|        ihevcd_init(ps_codec);
 3234|  2.68k|    }
 3235|      0|    else
 3236|      0|    {
 3237|      0|        DEBUG("\nReset called without Initializing the decoder\n");
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 3238|      0|        s_ctl_reset_op->u4_error_code = IHEVCD_INIT_NOT_DONE;
 3239|      0|    }
 3240|       |
 3241|  2.68k|    return IV_SUCCESS;
 3242|  2.68k|}
ihevcd_set_processor:
 3736|  24.9k|{
 3737|  24.9k|    ihevcd_cxa_ctl_set_processor_ip_t *ps_ip;
 3738|  24.9k|    ihevcd_cxa_ctl_set_processor_op_t *ps_op;
 3739|  24.9k|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3740|       |
 3741|  24.9k|    ps_ip = (ihevcd_cxa_ctl_set_processor_ip_t *)pv_api_ip;
 3742|  24.9k|    ps_op = (ihevcd_cxa_ctl_set_processor_op_t *)pv_api_op;
 3743|       |
 3744|  24.9k|    ps_codec->e_processor_arch = (IV_ARCH_T)ps_ip->u4_arch;
 3745|  24.9k|    ps_codec->e_processor_soc = (IV_SOC_T)ps_ip->u4_soc;
 3746|       |
 3747|  24.9k|    ihevcd_init_function_ptr(ps_codec);
 3748|       |
 3749|  24.9k|    ihevcd_update_function_ptr(ps_codec);
 3750|       |
 3751|  24.9k|    if(ps_codec->e_processor_soc && (ps_codec->e_processor_soc <= SOC_HISI_37X))
  ------------------
  |  Branch (3751:8): [True: 0, False: 24.9k]
  |  Branch (3751:37): [True: 0, False: 0]
  ------------------
 3752|      0|    {
 3753|       |        /* 8th bit indicates if format conversion is to be done ahead */
 3754|      0|        if(ps_codec->e_processor_soc & 0x80)
  ------------------
  |  Branch (3754:12): [True: 0, False: 0]
  ------------------
 3755|      0|            ps_codec->u4_enable_fmt_conv_ahead = 1;
 3756|       |
 3757|       |        /* Lower 7 bit indicate NCTB - if non-zero */
 3758|      0|        ps_codec->e_processor_soc &= 0x7F;
 3759|       |
 3760|      0|        if(ps_codec->e_processor_soc)
  ------------------
  |  Branch (3760:12): [True: 0, False: 0]
  ------------------
 3761|      0|            ps_codec->u4_nctb = ps_codec->e_processor_soc;
 3762|       |
 3763|       |
 3764|      0|    }
 3765|       |
 3766|  24.9k|    if((ps_codec->e_processor_soc == SOC_HISI_37X) && (ps_codec->i4_num_cores == 2))
  ------------------
  |  Branch (3766:8): [True: 0, False: 24.9k]
  |  Branch (3766:55): [True: 0, False: 0]
  ------------------
 3767|      0|    {
 3768|      0|        ps_codec->u4_nctb = 2;
 3769|      0|    }
 3770|       |
 3771|       |
 3772|  24.9k|    ps_op->u4_error_code = 0;
 3773|  24.9k|    return IV_SUCCESS;
 3774|  24.9k|}
ihevcd_set_num_cores:
 3806|  24.9k|{
 3807|  24.9k|    ihevcd_cxa_ctl_set_num_cores_ip_t *ps_ip;
 3808|  24.9k|    ihevcd_cxa_ctl_set_num_cores_op_t *ps_op;
 3809|  24.9k|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3810|       |
 3811|  24.9k|    ps_ip = (ihevcd_cxa_ctl_set_num_cores_ip_t *)pv_api_ip;
 3812|  24.9k|    ps_op = (ihevcd_cxa_ctl_set_num_cores_op_t *)pv_api_op;
 3813|       |
 3814|  24.9k|    ps_codec->i4_num_cores = ps_ip->u4_num_cores;
 3815|  24.9k|    ps_op->u4_error_code = 0;
 3816|  24.9k|    return IV_SUCCESS;
 3817|  24.9k|}
ihevcd_ctl:
 3846|   102k|{
 3847|   102k|    ivd_ctl_set_config_ip_t *ps_ctl_ip;
 3848|   102k|    ivd_ctl_set_config_op_t *ps_ctl_op;
 3849|   102k|    WORD32 ret = 0;
 3850|   102k|    WORD32 subcommand;
 3851|   102k|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3852|       |
 3853|   102k|    ps_ctl_ip = (ivd_ctl_set_config_ip_t *)pv_api_ip;
 3854|   102k|    ps_ctl_op = (ivd_ctl_set_config_op_t *)pv_api_op;
 3855|       |
 3856|   102k|    if(ps_codec->i4_init_done != 1)
  ------------------
  |  Branch (3856:8): [True: 0, False: 102k]
  ------------------
 3857|      0|    {
 3858|      0|        ps_ctl_op->u4_error_code |= 1 << IVD_FATALERROR;
 3859|      0|        ps_ctl_op->u4_error_code |= IHEVCD_INIT_NOT_DONE;
 3860|      0|        return IV_FAIL;
 3861|      0|    }
 3862|   102k|    subcommand = ps_ctl_ip->e_sub_cmd;
 3863|       |
 3864|   102k|    switch(subcommand)
 3865|   102k|    {
 3866|      0|        case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (3866:9): [True: 0, False: 102k]
  ------------------
 3867|      0|            ret = ihevcd_get_status(ps_codec_obj, (void *)pv_api_ip,
 3868|      0|                                    (void *)pv_api_op);
 3869|      0|            break;
 3870|  49.9k|        case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (3870:9): [True: 49.9k, False: 52.6k]
  ------------------
 3871|  49.9k|            ret = ihevcd_set_params(ps_codec_obj, (void *)pv_api_ip,
 3872|  49.9k|                                    (void *)pv_api_op);
 3873|  49.9k|            break;
 3874|  2.68k|        case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (3874:9): [True: 2.68k, False: 99.9k]
  ------------------
 3875|  2.68k|            ret = ihevcd_reset(ps_codec_obj, (void *)pv_api_ip,
 3876|  2.68k|                               (void *)pv_api_op);
 3877|  2.68k|            break;
 3878|      0|        case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (3878:9): [True: 0, False: 102k]
  ------------------
 3879|      0|        {
 3880|      0|            ivd_ctl_set_config_op_t *s_ctl_dynparams_op =
 3881|      0|                            (ivd_ctl_set_config_op_t *)pv_api_op;
 3882|       |
 3883|      0|            ret = ihevcd_set_default_params(ps_codec);
 3884|      0|            if(IV_SUCCESS == ret)
  ------------------
  |  Branch (3884:16): [True: 0, False: 0]
  ------------------
 3885|      0|                s_ctl_dynparams_op->u4_error_code = 0;
 3886|      0|            break;
 3887|      0|        }
 3888|      0|        case IVD_CMD_CTL_FLUSH:
  ------------------
  |  Branch (3888:9): [True: 0, False: 102k]
  ------------------
 3889|      0|            ret = ihevcd_set_flush_mode(ps_codec_obj, (void *)pv_api_ip,
 3890|      0|                                        (void *)pv_api_op);
 3891|      0|            break;
 3892|      0|        case IVD_CMD_CTL_GETBUFINFO:
  ------------------
  |  Branch (3892:9): [True: 0, False: 102k]
  ------------------
 3893|      0|            ret = ihevcd_get_buf_info(ps_codec_obj, (void *)pv_api_ip,
 3894|      0|                                      (void *)pv_api_op);
 3895|      0|            break;
 3896|      0|        case IVD_CMD_CTL_GETVERSION:
  ------------------
  |  Branch (3896:9): [True: 0, False: 102k]
  ------------------
 3897|      0|        {
 3898|      0|            ivd_ctl_getversioninfo_ip_t *ps_ip;
 3899|      0|            ivd_ctl_getversioninfo_op_t *ps_op;
 3900|      0|            IV_API_CALL_STATUS_T ret;
 3901|      0|            ps_ip = (ivd_ctl_getversioninfo_ip_t *)pv_api_ip;
 3902|      0|            ps_op = (ivd_ctl_getversioninfo_op_t *)pv_api_op;
 3903|       |
 3904|      0|            ps_op->u4_error_code = IV_SUCCESS;
 3905|       |
 3906|      0|            if((WORD32)ps_ip->u4_version_buffer_size <= 0)
  ------------------
  |  Branch (3906:16): [True: 0, False: 0]
  ------------------
 3907|      0|            {
 3908|      0|                ps_op->u4_error_code = IHEVCD_CXA_VERS_BUF_INSUFFICIENT;
 3909|      0|                ret = IV_FAIL;
 3910|      0|            }
 3911|      0|            else
 3912|      0|            {
 3913|      0|                ret = ihevcd_get_version((CHAR *)ps_ip->pv_version_buffer,
 3914|      0|                                         ps_ip->u4_version_buffer_size);
 3915|      0|                if(ret != IV_SUCCESS)
  ------------------
  |  Branch (3915:20): [True: 0, False: 0]
  ------------------
 3916|      0|                {
 3917|      0|                    ps_op->u4_error_code = IHEVCD_CXA_VERS_BUF_INSUFFICIENT;
 3918|      0|                    ret = IV_FAIL;
 3919|      0|                }
 3920|      0|            }
 3921|      0|        }
 3922|      0|            break;
 3923|      0|        case IHEVCD_CXA_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (3923:9): [True: 0, False: 102k]
  ------------------
 3924|      0|            ret = ihevcd_set_degrade(ps_codec_obj, (void *)pv_api_ip,
 3925|      0|                            (void *)pv_api_op);
 3926|      0|            break;
 3927|  24.9k|        case IHEVCD_CXA_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (3927:9): [True: 24.9k, False: 77.6k]
  ------------------
 3928|  24.9k|            ret = ihevcd_set_num_cores(ps_codec_obj, (void *)pv_api_ip,
 3929|  24.9k|                                       (void *)pv_api_op);
 3930|  24.9k|            break;
 3931|      0|        case IHEVCD_CXA_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (3931:9): [True: 0, False: 102k]
  ------------------
 3932|      0|            ret = ihevcd_get_frame_dimensions(ps_codec_obj, (void *)pv_api_ip,
 3933|      0|                                              (void *)pv_api_op);
 3934|      0|            break;
 3935|      0|        case IHEVCD_CXA_CMD_CTL_GET_VUI_PARAMS:
  ------------------
  |  Branch (3935:9): [True: 0, False: 102k]
  ------------------
 3936|      0|            ret = ihevcd_get_vui_params(ps_codec_obj, (void *)pv_api_ip,
 3937|      0|                                        (void *)pv_api_op);
 3938|      0|            break;
 3939|      0|        case IHEVCD_CXA_CMD_CTL_GET_SEI_MASTERING_PARAMS:
  ------------------
  |  Branch (3939:9): [True: 0, False: 102k]
  ------------------
 3940|      0|#ifndef DISABLE_SEI
 3941|      0|            ret = ihevcd_get_sei_mastering_params(ps_codec_obj, (void *)pv_api_ip,
 3942|      0|                                        (void *)pv_api_op);
 3943|       |#else
 3944|       |            {
 3945|       |                ihevcd_cxa_ctl_get_sei_mastering_params_op_t *ps_op =
 3946|       |                        (ihevcd_cxa_ctl_get_sei_mastering_params_op_t *)pv_api_op;
 3947|       |                ps_op->u4_error_code = IHEVCD_SEI_MASTERING_PARAMS_NOT_FOUND;
 3948|       |                return IV_FAIL;
 3949|       |            }
 3950|       |#endif
 3951|      0|            break;
 3952|  24.9k|        case IHEVCD_CXA_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (3952:9): [True: 24.9k, False: 77.6k]
  ------------------
 3953|  24.9k|            ret = ihevcd_set_processor(ps_codec_obj, (void *)pv_api_ip,
 3954|  24.9k|                            (void *)pv_api_op);
 3955|  24.9k|            break;
 3956|      0|        default:
  ------------------
  |  Branch (3956:9): [True: 0, False: 102k]
  ------------------
 3957|      0|            DEBUG("\nDo nothing\n");
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 3958|      0|            break;
 3959|   102k|    }
 3960|       |
 3961|   102k|    return ret;
 3962|   102k|}
ihevcd_cxa_api_function:
 3994|   450k|{
 3995|   450k|    WORD32 command;
 3996|   450k|    UWORD32 *pu4_ptr_cmd;
 3997|   450k|    WORD32 ret = 0;
 3998|   450k|    IV_API_CALL_STATUS_T e_status;
 3999|   450k|    e_status = api_check_struct_sanity(ps_handle, pv_api_ip, pv_api_op);
 4000|       |
 4001|   450k|    if(e_status != IV_SUCCESS)
  ------------------
  |  Branch (4001:8): [True: 0, False: 450k]
  ------------------
 4002|      0|    {
 4003|      0|        DEBUG("error code = %d\n", *((UWORD32 *)pv_api_op + 1));
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 4004|      0|        return IV_FAIL;
 4005|      0|    }
 4006|       |
 4007|   450k|    pu4_ptr_cmd = (UWORD32 *)pv_api_ip;
 4008|   450k|    pu4_ptr_cmd++;
 4009|       |
 4010|   450k|    command = *pu4_ptr_cmd;
 4011|       |
 4012|   450k|    switch(command)
 4013|   450k|    {
 4014|  24.9k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (4014:9): [True: 24.9k, False: 425k]
  ------------------
 4015|  24.9k|            ret = ihevcd_create(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4016|  24.9k|            break;
 4017|  24.9k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (4017:9): [True: 24.9k, False: 425k]
  ------------------
 4018|  24.9k|            ret = ihevcd_delete(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4019|  24.9k|            break;
 4020|       |
 4021|   297k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (4021:9): [True: 297k, False: 152k]
  ------------------
 4022|   297k|            ret = ihevcd_decode(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4023|   297k|            break;
 4024|       |
 4025|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (4025:9): [True: 0, False: 450k]
  ------------------
 4026|       |            //ret = ihevcd_get_display_frame(ps_handle,(void *)pv_api_ip,(void *)pv_api_op);
 4027|      0|            break;
 4028|       |
 4029|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (4029:9): [True: 0, False: 450k]
  ------------------
 4030|      0|            ret = ihevcd_set_display_frame(ps_handle, (void *)pv_api_ip,
 4031|      0|                                           (void *)pv_api_op);
 4032|       |
 4033|      0|            break;
 4034|       |
 4035|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (4035:9): [True: 0, False: 450k]
  ------------------
 4036|      0|            ret = ihevcd_rel_display_frame(ps_handle, (void *)pv_api_ip,
 4037|      0|                                           (void *)pv_api_op);
 4038|      0|            break;
 4039|       |
 4040|   102k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (4040:9): [True: 102k, False: 347k]
  ------------------
 4041|   102k|            ret = ihevcd_ctl(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4042|   102k|            break;
 4043|      0|        default:
  ------------------
  |  Branch (4043:9): [True: 0, False: 450k]
  ------------------
 4044|      0|            ret = IV_FAIL;
 4045|      0|            break;
 4046|   450k|    }
 4047|       |
 4048|   450k|    return (IV_API_CALL_STATUS_T)ret;
 4049|   450k|}
ihevcd_api.c:api_check_struct_sanity:
  136|   450k|{
  137|   450k|    IVD_API_COMMAND_TYPE_T e_cmd;
  138|   450k|    UWORD32 *pu4_api_ip;
  139|   450k|    UWORD32 *pu4_api_op;
  140|   450k|    WORD32 i;
  141|       |
  142|   450k|    if(NULL == pv_api_op)
  ------------------
  |  Branch (142:8): [True: 0, False: 450k]
  ------------------
  143|      0|        return (IV_FAIL);
  144|       |
  145|   450k|    if(NULL == pv_api_ip)
  ------------------
  |  Branch (145:8): [True: 0, False: 450k]
  ------------------
  146|      0|        return (IV_FAIL);
  147|       |
  148|   450k|    pu4_api_ip = (UWORD32 *)pv_api_ip;
  149|   450k|    pu4_api_op = (UWORD32 *)pv_api_op;
  150|   450k|    e_cmd = (IVD_API_COMMAND_TYPE_T)*(pu4_api_ip + 1);
  151|       |
  152|   450k|    *(pu4_api_op + 1) = 0;
  153|       |    /* error checks on handle */
  154|   450k|    switch((WORD32)e_cmd)
  155|   450k|    {
  156|  24.9k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (156:9): [True: 24.9k, False: 425k]
  ------------------
  157|  24.9k|            break;
  158|       |
  159|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (159:9): [True: 0, False: 450k]
  ------------------
  160|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (160:9): [True: 0, False: 450k]
  ------------------
  161|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (161:9): [True: 0, False: 450k]
  ------------------
  162|   297k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (162:9): [True: 297k, False: 152k]
  ------------------
  163|   322k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (163:9): [True: 24.9k, False: 425k]
  ------------------
  164|   425k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (164:9): [True: 102k, False: 347k]
  ------------------
  165|   425k|            if(ps_handle == NULL)
  ------------------
  |  Branch (165:16): [True: 0, False: 425k]
  ------------------
  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|   425k|            if(ps_handle->u4_size != sizeof(iv_obj_t))
  ------------------
  |  Branch (172:16): [True: 0, False: 425k]
  ------------------
  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|   425k|            if(ps_handle->pv_codec_handle == NULL)
  ------------------
  |  Branch (180:16): [True: 0, False: 425k]
  ------------------
  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|   425k|            break;
  187|   425k|        default:
  ------------------
  |  Branch (187:9): [True: 0, False: 450k]
  ------------------
  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|   450k|    }
  192|       |
  193|   450k|    switch((WORD32)e_cmd)
  194|   450k|    {
  195|  24.9k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (195:9): [True: 24.9k, False: 425k]
  ------------------
  196|  24.9k|        {
  197|  24.9k|            ihevcd_cxa_create_ip_t *ps_ip = (ihevcd_cxa_create_ip_t *)pv_api_ip;
  198|  24.9k|            ihevcd_cxa_create_op_t *ps_op = (ihevcd_cxa_create_op_t *)pv_api_op;
  199|       |
  200|       |
  201|  24.9k|            ps_op->s_ivd_create_op_t.u4_error_code = 0;
  202|       |
  203|  24.9k|            if((ps_ip->s_ivd_create_ip_t.u4_size > sizeof(ihevcd_cxa_create_ip_t))
  ------------------
  |  Branch (203:16): [True: 0, False: 24.9k]
  ------------------
  204|  24.9k|                            || (ps_ip->s_ivd_create_ip_t.u4_size
  ------------------
  |  Branch (204:32): [True: 0, False: 24.9k]
  ------------------
  205|  24.9k|                                            < 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.9k|            if((ps_op->s_ivd_create_op_t.u4_size != sizeof(ihevcd_cxa_create_op_t))
  ------------------
  |  Branch (215:16): [True: 0, False: 24.9k]
  ------------------
  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.9k|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P)
  ------------------
  |  Branch (228:16): [True: 15.1k, False: 9.80k]
  ------------------
  229|  15.1k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (229:32): [True: 10.3k, False: 4.81k]
  ------------------
  230|  15.1k|                                            != IV_YUV_420SP_UV)
  231|  10.3k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (231:32): [True: 6.29k, False: 4.08k]
  ------------------
  232|  10.3k|                                            != IV_YUV_420SP_VU)
  233|  6.29k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (233:32): [True: 1.09k, False: 5.20k]
  ------------------
  234|  6.29k|                                            != IV_GRAY)
  235|  1.09k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (235:32): [True: 901, False: 189]
  ------------------
  236|  1.09k|                                            != IV_YUV_444P)
  237|    901|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (237:32): [True: 0, False: 901]
  ------------------
  238|    901|                                             != 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.9k|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P)
  ------------------
  |  Branch (249:16): [True: 15.1k, False: 9.80k]
  ------------------
  250|  15.1k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV)
  ------------------
  |  Branch (250:32): [True: 10.3k, False: 4.81k]
  ------------------
  251|  10.3k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU)
  ------------------
  |  Branch (251:32): [True: 6.29k, False: 4.08k]
  ------------------
  252|  6.29k|                            && ps_ip->s_ivd_create_ip_t.u4_share_disp_buf == 1)
  ------------------
  |  Branch (252:32): [True: 0, False: 6.29k]
  ------------------
  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.9k|        }
  262|  24.9k|            break;
  263|       |
  264|  24.9k|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (264:9): [True: 0, False: 450k]
  ------------------
  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: 450k]
  ------------------
  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: 450k]
  ------------------
  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|   297k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (421:9): [True: 297k, False: 152k]
  ------------------
  422|   297k|        {
  423|   297k|            ihevcd_cxa_video_decode_ip_t *ps_ip =
  424|   297k|                            (ihevcd_cxa_video_decode_ip_t *)pv_api_ip;
  425|   297k|            ihevcd_cxa_video_decode_op_t *ps_op =
  426|   297k|                            (ihevcd_cxa_video_decode_op_t *)pv_api_op;
  427|       |
  428|   297k|            DEBUG("The input bytes is: %d",
  ------------------
  |  |   49|   297k|#define DEBUG(...) {}
  ------------------
  429|   297k|                            ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes);
  430|   297k|            ps_op->s_ivd_video_decode_op_t.u4_error_code = 0;
  431|       |
  432|   297k|            if(ps_ip->s_ivd_video_decode_ip_t.u4_size
  ------------------
  |  Branch (432:16): [True: 297k, False: 0]
  ------------------
  433|   297k|                            != sizeof(ihevcd_cxa_video_decode_ip_t)
  434|   297k|                            && ps_ip->s_ivd_video_decode_ip_t.u4_size
  ------------------
  |  Branch (434:32): [True: 0, False: 297k]
  ------------------
  435|   297k|                                            != 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|   297k|            if(ps_op->s_ivd_video_decode_op_t.u4_size
  ------------------
  |  Branch (444:16): [True: 297k, False: 0]
  ------------------
  445|   297k|                            != sizeof(ihevcd_cxa_video_decode_op_t)
  446|   297k|                            && ps_op->s_ivd_video_decode_op_t.u4_size
  ------------------
  |  Branch (446:32): [True: 0, False: 297k]
  ------------------
  447|   297k|                                            != 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|   297k|            if(((codec_t *)(ps_handle->pv_codec_handle))->u1_enable_cu_info
  ------------------
  |  Branch (456:16): [True: 0, False: 297k]
  ------------------
  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|   297k|        }
  467|   297k|            break;
  468|       |
  469|   297k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (469:9): [True: 24.9k, False: 425k]
  ------------------
  470|  24.9k|        {
  471|  24.9k|            ihevcd_cxa_delete_ip_t *ps_ip =
  472|  24.9k|                            (ihevcd_cxa_delete_ip_t *)pv_api_ip;
  473|  24.9k|            ihevcd_cxa_delete_op_t *ps_op =
  474|  24.9k|                            (ihevcd_cxa_delete_op_t *)pv_api_op;
  475|       |
  476|  24.9k|            ps_op->s_ivd_delete_op_t.u4_error_code = 0;
  477|       |
  478|  24.9k|            if(ps_ip->s_ivd_delete_ip_t.u4_size
  ------------------
  |  Branch (478:16): [True: 0, False: 24.9k]
  ------------------
  479|  24.9k|                            != 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.9k|            if(ps_op->s_ivd_delete_op_t.u4_size
  ------------------
  |  Branch (488:16): [True: 0, False: 24.9k]
  ------------------
  489|  24.9k|                            != 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.9k|        }
  499|  24.9k|            break;
  500|       |
  501|   102k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (501:9): [True: 102k, False: 347k]
  ------------------
  502|   102k|        {
  503|   102k|            UWORD32 *pu4_ptr_cmd;
  504|   102k|            UWORD32 sub_command;
  505|       |
  506|   102k|            pu4_ptr_cmd = (UWORD32 *)pv_api_ip;
  507|   102k|            pu4_ptr_cmd += 2;
  508|   102k|            sub_command = *pu4_ptr_cmd;
  509|       |
  510|   102k|            switch(sub_command)
  511|   102k|            {
  512|  49.9k|                case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (512:17): [True: 49.9k, False: 52.6k]
  ------------------
  513|  49.9k|                {
  514|  49.9k|                    ihevcd_cxa_ctl_set_config_ip_t *ps_ip;
  515|  49.9k|                    ihevcd_cxa_ctl_set_config_op_t *ps_op;
  516|  49.9k|                    ps_ip = (ihevcd_cxa_ctl_set_config_ip_t *)pv_api_ip;
  517|  49.9k|                    ps_op = (ihevcd_cxa_ctl_set_config_op_t *)pv_api_op;
  518|       |
  519|  49.9k|                    if(ps_ip->s_ivd_ctl_set_config_ip_t.u4_size
  ------------------
  |  Branch (519:24): [True: 0, False: 49.9k]
  ------------------
  520|  49.9k|                                    != 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|  49.9k|                }
  531|       |                    //no break; is needed here
  532|  49.9k|                case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (532:17): [True: 0, False: 102k]
  ------------------
  533|  49.9k|                {
  534|  49.9k|                    ihevcd_cxa_ctl_set_config_op_t *ps_op;
  535|  49.9k|                    ps_op = (ihevcd_cxa_ctl_set_config_op_t *)pv_api_op;
  536|  49.9k|                    if(ps_op->s_ivd_ctl_set_config_op_t.u4_size
  ------------------
  |  Branch (536:24): [True: 0, False: 49.9k]
  ------------------
  537|  49.9k|                                    != 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|  49.9k|                }
  546|  49.9k|                    break;
  547|       |
  548|  49.9k|                case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (548:17): [True: 0, False: 102k]
  ------------------
  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: 102k]
  ------------------
  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: 102k]
  ------------------
  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: 102k]
  ------------------
  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.68k|                case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (660:17): [True: 2.68k, False: 99.9k]
  ------------------
  661|  2.68k|                {
  662|  2.68k|                    ihevcd_cxa_ctl_reset_ip_t *ps_ip;
  663|  2.68k|                    ihevcd_cxa_ctl_reset_op_t *ps_op;
  664|  2.68k|                    ps_ip = (ihevcd_cxa_ctl_reset_ip_t *)pv_api_ip;
  665|  2.68k|                    ps_op = (ihevcd_cxa_ctl_reset_op_t *)pv_api_op;
  666|  2.68k|                    if(ps_ip->s_ivd_ctl_reset_ip_t.u4_size
  ------------------
  |  Branch (666:24): [True: 0, False: 2.68k]
  ------------------
  667|  2.68k|                                    != 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.68k|                    if(ps_op->s_ivd_ctl_reset_op_t.u4_size
  ------------------
  |  Branch (675:24): [True: 0, False: 2.68k]
  ------------------
  676|  2.68k|                                    != 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.68k|                }
  685|  2.68k|                    break;
  686|  2.68k|                case IHEVCD_CXA_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (686:17): [True: 0, False: 102k]
  ------------------
  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: 102k]
  ------------------
  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: 102k]
  ------------------
  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: 102k]
  ------------------
  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.9k|                case IHEVCD_CXA_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (816:17): [True: 24.9k, False: 77.6k]
  ------------------
  817|  24.9k|                {
  818|  24.9k|                    ihevcd_cxa_ctl_set_num_cores_ip_t *ps_ip;
  819|  24.9k|                    ihevcd_cxa_ctl_set_num_cores_op_t *ps_op;
  820|       |
  821|  24.9k|                    ps_ip = (ihevcd_cxa_ctl_set_num_cores_ip_t *)pv_api_ip;
  822|  24.9k|                    ps_op = (ihevcd_cxa_ctl_set_num_cores_op_t *)pv_api_op;
  823|       |
  824|  24.9k|                    if(ps_ip->u4_size
  ------------------
  |  Branch (824:24): [True: 0, False: 24.9k]
  ------------------
  825|  24.9k|                                    != 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.9k|                    if(ps_op->u4_size
  ------------------
  |  Branch (833:24): [True: 0, False: 24.9k]
  ------------------
  834|  24.9k|                                    != 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.9k|                    if((ps_ip->u4_num_cores < 1) || (ps_ip->u4_num_cores > MAX_NUM_CORES))
  ------------------
  |  |  116|  24.9k|#define MAX_NUM_CORES       8
  ------------------
  |  Branch (842:24): [True: 0, False: 24.9k]
  |  Branch (842:53): [True: 0, False: 24.9k]
  ------------------
  843|      0|                    {
  844|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  845|      0|                        return IV_FAIL;
  846|      0|                    }
  847|  24.9k|                    break;
  848|  24.9k|                }
  849|  24.9k|                case IHEVCD_CXA_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (849:17): [True: 24.9k, False: 77.6k]
  ------------------
  850|  24.9k|                {
  851|  24.9k|                    ihevcd_cxa_ctl_set_processor_ip_t *ps_ip;
  852|  24.9k|                    ihevcd_cxa_ctl_set_processor_op_t *ps_op;
  853|       |
  854|  24.9k|                    ps_ip = (ihevcd_cxa_ctl_set_processor_ip_t *)pv_api_ip;
  855|  24.9k|                    ps_op = (ihevcd_cxa_ctl_set_processor_op_t *)pv_api_op;
  856|       |
  857|  24.9k|                    if(ps_ip->u4_size
  ------------------
  |  Branch (857:24): [True: 0, False: 24.9k]
  ------------------
  858|  24.9k|                                    != 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.9k|                    if(ps_op->u4_size
  ------------------
  |  Branch (866:24): [True: 0, False: 24.9k]
  ------------------
  867|  24.9k|                                    != 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.9k|                    break;
  876|  24.9k|                }
  877|  24.9k|                default:
  ------------------
  |  Branch (877:17): [True: 0, False: 102k]
  ------------------
  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|   102k|            }
  882|   102k|        }
  883|   102k|            break;
  884|   102k|        default:
  ------------------
  |  Branch (884:9): [True: 0, False: 450k]
  ------------------
  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|   450k|    }
  889|       |
  890|   450k|    return IV_SUCCESS;
  891|   450k|}

ihevcd_bits_init:
  108|   567k|{
  109|   567k|    UWORD32 u4_cur_word;
  110|   567k|    UWORD32 u4_nxt_word;
  111|   567k|    UWORD32 u4_temp;
  112|   567k|    UWORD32 *pu4_buf;
  113|       |
  114|   567k|    pu4_buf     = (UWORD32 *)pu1_buf;
  115|   567k|    u4_temp = *pu4_buf++;
  116|   567k|    u4_cur_word = ITT_BIG_ENDIAN(u4_temp);
  ------------------
  |  |   63|   567k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |   64|   567k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |   65|   567k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |   66|   567k|                            ((UWORD32)x >> 24);
  ------------------
  117|   567k|    u4_temp = *pu4_buf++;
  118|   567k|    u4_nxt_word = ITT_BIG_ENDIAN(u4_temp);
  ------------------
  |  |   63|   567k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |   64|   567k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |   65|   567k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |   66|   567k|                            ((UWORD32)x >> 24);
  ------------------
  119|       |
  120|   567k|    ps_bitstrm->u4_bit_ofst     = 0;
  121|   567k|    ps_bitstrm->pu1_buf_base    = pu1_buf;
  122|   567k|    ps_bitstrm->pu4_buf         = pu4_buf;
  123|   567k|    ps_bitstrm->u4_cur_word     = u4_cur_word;
  124|   567k|    ps_bitstrm->u4_nxt_word     = u4_nxt_word;
  125|       |
  126|   567k|    ps_bitstrm->pu1_buf_max     = pu1_buf + u4_numbytes + 8;
  127|       |
  128|   567k|    return;
  129|   567k|}
ihevcd_bits_flush:
  156|  39.5k|{
  157|       |
  158|  39.5k|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|  39.5k|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  39.5k|{                                                           \
  |  |  129|  39.5k|    UWORD32 temp;                                           \
  |  |  130|  39.5k|                                                            \
  |  |  131|  39.5k|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  39.5k|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  79.1k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 9.85k, False: 29.6k]
  |  |  ------------------
  |  |  133|  39.5k|    {                                                       \
  |  |  134|  9.85k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|  9.85k|        /* Getting the next word */                         \
  |  |  136|  9.85k|        temp = *(m_pu4_buf++);                              \
  |  |  137|  9.85k|                                                            \
  |  |  138|  9.85k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|  9.85k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|  9.85k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|  9.85k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|  9.85k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  9.85k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  9.85k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  9.85k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|  9.85k|    }                                                       \
  |  |  142|  39.5k|}
  ------------------
  159|  39.5k|               ps_bitstrm->u4_bit_ofst,
  160|  39.5k|               ps_bitstrm->u4_cur_word,
  161|  39.5k|               ps_bitstrm->u4_nxt_word,
  162|  39.5k|               u4_numbits);
  163|       |
  164|  39.5k|    return;
  165|  39.5k|}
ihevcd_bits_flush_to_byte_boundary:
  188|   107k|{
  189|   107k|    UWORD32 u4_numbits;
  190|   107k|    u4_numbits = (ps_bitstrm->u4_bit_ofst) & 7;
  191|       |
  192|   107k|    u4_numbits = 8 - u4_numbits;
  193|       |
  194|   107k|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|   107k|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|   107k|{                                                           \
  |  |  129|   107k|    UWORD32 temp;                                           \
  |  |  130|   107k|                                                            \
  |  |  131|   107k|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|   107k|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|   215k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 36.3k, False: 71.6k]
  |  |  ------------------
  |  |  133|   107k|    {                                                       \
  |  |  134|  36.3k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|  36.3k|        /* Getting the next word */                         \
  |  |  136|  36.3k|        temp = *(m_pu4_buf++);                              \
  |  |  137|  36.3k|                                                            \
  |  |  138|  36.3k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|  36.3k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|  36.3k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|  36.3k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|  36.3k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  36.3k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  36.3k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  36.3k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|  36.3k|    }                                                       \
  |  |  142|   107k|}
  ------------------
  195|   107k|               ps_bitstrm->u4_bit_ofst,
  196|   107k|               ps_bitstrm->u4_cur_word,
  197|   107k|               ps_bitstrm->u4_nxt_word,
  198|   107k|               u4_numbits);
  199|       |
  200|   107k|    return;
  201|   107k|}
ihevcd_bits_seek:
  228|  11.8k|{
  229|  11.8k|    UWORD32 val;
  230|  11.8k|    ASSERT(numbits >= -32);
  ------------------
  |  |   55|  11.8k|#define ASSERT(x) {}
  ------------------
  231|  11.8k|    ASSERT(numbits <= 32);
  ------------------
  |  |   55|  11.8k|#define ASSERT(x) {}
  ------------------
  232|       |    /* Check if Seeking backwards*/
  233|  11.8k|    if(numbits < 0)
  ------------------
  |  Branch (233:8): [True: 11.3k, False: 476]
  ------------------
  234|  11.3k|    {
  235|  11.3k|        UWORD32 abs_numbits = -numbits;
  236|  11.3k|        if(ps_bitstrm->u4_bit_ofst >= abs_numbits)
  ------------------
  |  Branch (236:12): [True: 5.10k, False: 6.21k]
  ------------------
  237|  5.10k|        {
  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|  5.10k|            ps_bitstrm->u4_bit_ofst -= abs_numbits;
  242|  5.10k|            return;
  243|  5.10k|        }
  244|  6.21k|        else
  245|  6.21k|        {
  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|  6.21k|            ps_bitstrm->u4_bit_ofst += 32;
  251|  6.21k|            ps_bitstrm->u4_bit_ofst -= abs_numbits;
  252|  6.21k|            ps_bitstrm->pu4_buf--;
  253|       |
  254|  6.21k|            val = *(ps_bitstrm->pu4_buf - 2);
  255|  6.21k|            ps_bitstrm->u4_nxt_word = ps_bitstrm->u4_cur_word;
  256|  6.21k|            ps_bitstrm->u4_cur_word = ITT_BIG_ENDIAN(val);
  ------------------
  |  |   63|  6.21k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |   64|  6.21k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |   65|  6.21k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |   66|  6.21k|                            ((UWORD32)x >> 24);
  ------------------
  257|  6.21k|            return;
  258|  6.21k|        }
  259|  11.3k|    }
  260|    476|    else
  261|    476|    {
  262|       |        /* Not supported/tested currently */
  263|    476|        ASSERT(1);
  ------------------
  |  |   55|    476|#define ASSERT(x) {}
  ------------------
  264|    476|        BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|    476|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|    476|{                                                           \
  |  |  129|    476|    UWORD32 temp;                                           \
  |  |  130|    476|                                                            \
  |  |  131|    476|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|    476|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|    952|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 0, False: 476]
  |  |  ------------------
  |  |  133|    476|    {                                                       \
  |  |  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|    476|}
  ------------------
  265|    476|                   ps_bitstrm->u4_bit_ofst,
  266|    476|                   ps_bitstrm->u4_cur_word,
  267|    476|                   ps_bitstrm->u4_nxt_word,
  268|    476|                   numbits);
  269|       |
  270|       |
  271|    476|    }
  272|    476|    return;
  273|  11.8k|}
ihevcd_bits_nxt:
  299|  1.49M|{
  300|  1.49M|    UWORD32 u4_bits_read;
  301|       |
  302|  1.49M|    BITS_NXT(u4_bits_read,
  ------------------
  |  |   91|  1.49M|                 m_u4_cur_word, m_u4_nxt_word, m_cnt)       \
  |  |   92|  1.49M|{                                                           \
  |  |   93|  1.49M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)  >>        \
  |  |   94|  1.49M|                              (WORD_SIZE - m_cnt);          \
  |  |  ------------------
  |  |  |  |   42|  1.49M|#define WORD_SIZE         32
  |  |  ------------------
  |  |   95|  1.49M|                                                            \
  |  |   96|  1.49M|    if(m_u4_bit_ofst > (WORD_SIZE - m_cnt))                 \
  |  |  ------------------
  |  |  |  |   42|  1.49M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (96:8): [True: 1.48k, False: 1.49M]
  |  |  ------------------
  |  |   97|  1.49M|    {                                                       \
  |  |   98|  1.48k|        m_u4_bits |= SHR(m_u4_nxt_word,                     \
  |  |  ------------------
  |  |  |  |   57|  1.48k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 1.48k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   99|  1.48k|                   (WORD_SIZE + WORD_SIZE - m_cnt           \
  |  |  100|  1.48k|                          - m_u4_bit_ofst));                \
  |  |  101|  1.48k|    }                                                       \
  |  |  102|  1.49M|}
  ------------------
  303|  1.49M|             ps_bitstrm->pu4_buf,
  304|  1.49M|             ps_bitstrm->u4_bit_ofst,
  305|  1.49M|             ps_bitstrm->u4_cur_word,
  306|  1.49M|             ps_bitstrm->u4_nxt_word,
  307|  1.49M|             u4_numbits);
  308|  1.49M|    return u4_bits_read;
  309|  1.49M|}
ihevcd_bits_get:
  371|  21.2M|{
  372|  21.2M|    UWORD32 u4_bits_read;
  373|       |
  374|  21.2M|    BITS_GET(u4_bits_read,
  ------------------
  |  |  150|  21.2M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  21.2M|{                                                               \
  |  |  152|  21.2M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  21.2M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  21.2M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  21.2M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  21.2M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  42.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 192k, False: 21.0M]
  |  |  ------------------
  |  |  156|  21.2M|    {                                                           \
  |  |  157|   192k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   192k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 192k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   192k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   192k|    }                                                           \
  |  |  160|  21.2M|                                                                \
  |  |  161|  21.2M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  42.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 1.14M, False: 20.1M]
  |  |  ------------------
  |  |  162|  21.2M|    {                                                           \
  |  |  163|  1.14M|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  1.14M|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  1.14M|        /* Getting the next word */                             \
  |  |  166|  1.14M|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  1.14M|                                                                \
  |  |  168|  1.14M|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  1.14M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  1.14M|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  1.14M|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  1.14M|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  1.14M|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  1.14M|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  1.14M|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  1.14M|    }                                                           \
  |  |  172|  21.2M|}
  ------------------
  375|  21.2M|             ps_bitstrm->pu4_buf,
  376|  21.2M|             ps_bitstrm->u4_bit_ofst,
  377|  21.2M|             ps_bitstrm->u4_cur_word,
  378|  21.2M|             ps_bitstrm->u4_nxt_word,
  379|  21.2M|             u4_numbits);
  380|  21.2M|    return u4_bits_read;
  381|       |
  382|  21.2M|}
ihevcd_bits_num_bits_remaining:
  406|  1.50M|{
  407|  1.50M|    UWORD32 u4_bits_consumed;
  408|  1.50M|    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|  1.50M|    u4_bits_consumed = (UWORD32)(((UWORD8 *)ps_bitstrm->pu4_buf -
  413|  1.50M|                                  (UWORD8 *)ps_bitstrm->pu1_buf_base - 8) <<
  414|  1.50M|                                 3) + ps_bitstrm->u4_bit_ofst;
  415|       |
  416|  1.50M|    u4_size_in_bits = (UWORD32)(ps_bitstrm->pu1_buf_max -
  417|  1.50M|                    ps_bitstrm->pu1_buf_base) - 8;
  418|  1.50M|    u4_size_in_bits <<= 3;
  419|  1.50M|    if(u4_size_in_bits > u4_bits_consumed)
  ------------------
  |  Branch (419:8): [True: 1.49M, False: 15.8k]
  ------------------
  420|  1.49M|    {
  421|  1.49M|        return (u4_size_in_bits - u4_bits_consumed);
  422|  1.49M|    }
  423|  15.8k|    else
  424|  15.8k|    {
  425|  15.8k|        return 0;
  426|  15.8k|    }
  427|  1.50M|}
ihevcd_uev:
  484|  2.78M|{
  485|  2.78M|    UWORD32 u4_bits_read;
  486|  2.78M|    UWORD32 u4_clz;
  487|       |
  488|       |
  489|       |    /***************************************************************/
  490|       |    /* Find leading zeros in next 32 bits                          */
  491|       |    /***************************************************************/
  492|  2.78M|    BITS_NXT32(u4_bits_read,
  ------------------
  |  |  112|  2.78M|                 m_u4_cur_word, m_u4_nxt_word)                      \
  |  |  113|  2.78M|{                                                                   \
  |  |  114|  2.78M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst);                   \
  |  |  115|  2.78M|                                                                    \
  |  |  116|  2.78M|    m_u4_bits |= SHR(m_u4_nxt_word, (WORD_SIZE - m_u4_bit_ofst));   \
  |  |  ------------------
  |  |  |  |   57|  2.78M|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 2.71M, False: 71.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  2.78M|}
  ------------------
  493|  2.78M|               ps_bitstrm->pu4_buf,
  494|  2.78M|               ps_bitstrm->u4_bit_ofst,
  495|  2.78M|               ps_bitstrm->u4_cur_word,
  496|  2.78M|               ps_bitstrm->u4_nxt_word);
  497|       |
  498|       |
  499|  2.78M|    u4_clz = CLZ(u4_bits_read);
  500|       |
  501|  2.78M|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|  2.78M|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  2.78M|{                                                           \
  |  |  129|  2.78M|    UWORD32 temp;                                           \
  |  |  130|  2.78M|                                                            \
  |  |  131|  2.78M|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  2.78M|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  5.57M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 291k, False: 2.49M]
  |  |  ------------------
  |  |  133|  2.78M|    {                                                       \
  |  |  134|   291k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|   291k|        /* Getting the next word */                         \
  |  |  136|   291k|        temp = *(m_pu4_buf++);                              \
  |  |  137|   291k|                                                            \
  |  |  138|   291k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|   291k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|   291k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|   291k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|   291k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   291k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   291k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   291k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|   291k|    }                                                       \
  |  |  142|  2.78M|}
  ------------------
  502|  2.78M|               ps_bitstrm->u4_bit_ofst,
  503|  2.78M|               ps_bitstrm->u4_cur_word,
  504|  2.78M|               ps_bitstrm->u4_nxt_word,
  505|  2.78M|               (u4_clz + 1));
  506|       |
  507|  2.78M|    u4_bits_read = 0;
  508|  2.78M|    if(u4_clz)
  ------------------
  |  Branch (508:8): [True: 1.25M, False: 1.53M]
  ------------------
  509|  1.25M|    {
  510|  1.25M|        BITS_GET(u4_bits_read,
  ------------------
  |  |  150|  1.25M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  1.25M|{                                                               \
  |  |  152|  1.25M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  1.25M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  1.25M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  1.25M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  1.25M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  2.50M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 85.4k, False: 1.16M]
  |  |  ------------------
  |  |  156|  1.25M|    {                                                           \
  |  |  157|  85.4k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  85.4k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 85.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  85.4k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  85.4k|    }                                                           \
  |  |  160|  1.25M|                                                                \
  |  |  161|  1.25M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  2.50M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 146k, False: 1.10M]
  |  |  ------------------
  |  |  162|  1.25M|    {                                                           \
  |  |  163|   146k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   146k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   146k|        /* Getting the next word */                             \
  |  |  166|   146k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   146k|                                                                \
  |  |  168|   146k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   146k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   146k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   146k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   146k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   146k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   146k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   146k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   146k|    }                                                           \
  |  |  172|  1.25M|}
  ------------------
  511|  1.25M|                 ps_bitstrm->pu4_buf,
  512|  1.25M|                 ps_bitstrm->u4_bit_ofst,
  513|  1.25M|                 ps_bitstrm->u4_cur_word,
  514|  1.25M|                 ps_bitstrm->u4_nxt_word,
  515|  1.25M|                 u4_clz);
  516|  1.25M|    }
  517|  2.78M|    return ((1 << u4_clz) + u4_bits_read - 1);
  518|       |
  519|  2.78M|}
ihevcd_sev:
  543|  1.48M|{
  544|  1.48M|    UWORD32 u4_bits_read;
  545|  1.48M|    UWORD32 u4_clz;
  546|  1.48M|    UWORD32 u4_abs_val;
  547|       |
  548|       |
  549|       |    /***************************************************************/
  550|       |    /* Find leading zeros in next 32 bits                          */
  551|       |    /***************************************************************/
  552|  1.48M|    BITS_NXT32(u4_bits_read,
  ------------------
  |  |  112|  1.48M|                 m_u4_cur_word, m_u4_nxt_word)                      \
  |  |  113|  1.48M|{                                                                   \
  |  |  114|  1.48M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst);                   \
  |  |  115|  1.48M|                                                                    \
  |  |  116|  1.48M|    m_u4_bits |= SHR(m_u4_nxt_word, (WORD_SIZE - m_u4_bit_ofst));   \
  |  |  ------------------
  |  |  |  |   57|  1.48M|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 1.44M, False: 42.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  1.48M|}
  ------------------
  553|  1.48M|               ps_bitstrm->pu4_buf,
  554|  1.48M|               ps_bitstrm->u4_bit_ofst,
  555|  1.48M|               ps_bitstrm->u4_cur_word,
  556|  1.48M|               ps_bitstrm->u4_nxt_word);
  557|       |
  558|       |
  559|  1.48M|    u4_clz = CLZ(u4_bits_read);
  560|       |
  561|  1.48M|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|  1.48M|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  1.48M|{                                                           \
  |  |  129|  1.48M|    UWORD32 temp;                                           \
  |  |  130|  1.48M|                                                            \
  |  |  131|  1.48M|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  1.48M|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  2.97M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 102k, False: 1.38M]
  |  |  ------------------
  |  |  133|  1.48M|    {                                                       \
  |  |  134|   102k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|   102k|        /* Getting the next word */                         \
  |  |  136|   102k|        temp = *(m_pu4_buf++);                              \
  |  |  137|   102k|                                                            \
  |  |  138|   102k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|   102k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|   102k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|   102k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|   102k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   102k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   102k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   102k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|   102k|    }                                                       \
  |  |  142|  1.48M|}
  ------------------
  562|  1.48M|               ps_bitstrm->u4_bit_ofst,
  563|  1.48M|               ps_bitstrm->u4_cur_word,
  564|  1.48M|               ps_bitstrm->u4_nxt_word,
  565|  1.48M|               (u4_clz + 1));
  566|       |
  567|  1.48M|    u4_bits_read = 0;
  568|  1.48M|    if(u4_clz)
  ------------------
  |  Branch (568:8): [True: 286k, False: 1.19M]
  ------------------
  569|   286k|    {
  570|   286k|        BITS_GET(u4_bits_read,
  ------------------
  |  |  150|   286k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   286k|{                                                               \
  |  |  152|   286k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   286k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   286k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   286k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   286k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|   573k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 27.4k, False: 259k]
  |  |  ------------------
  |  |  156|   286k|    {                                                           \
  |  |  157|  27.4k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  27.4k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 27.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  27.4k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  27.4k|    }                                                           \
  |  |  160|   286k|                                                                \
  |  |  161|   286k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|   573k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 34.7k, False: 251k]
  |  |  ------------------
  |  |  162|   286k|    {                                                           \
  |  |  163|  34.7k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  34.7k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  34.7k|        /* Getting the next word */                             \
  |  |  166|  34.7k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  34.7k|                                                                \
  |  |  168|  34.7k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  34.7k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  34.7k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  34.7k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  34.7k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  34.7k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  34.7k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  34.7k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  34.7k|    }                                                           \
  |  |  172|   286k|}
  ------------------
  571|   286k|                 ps_bitstrm->pu4_buf,
  572|   286k|                 ps_bitstrm->u4_bit_ofst,
  573|   286k|                 ps_bitstrm->u4_cur_word,
  574|   286k|                 ps_bitstrm->u4_nxt_word,
  575|   286k|                 u4_clz);
  576|   286k|    }
  577|  1.48M|    u4_abs_val = ((1 << u4_clz) + u4_bits_read) >> 1;
  578|  1.48M|    if(u4_bits_read & 0x1)
  ------------------
  |  Branch (578:8): [True: 121k, False: 1.36M]
  ------------------
  579|   121k|        return (-(WORD32)u4_abs_val);
  580|  1.36M|    else
  581|  1.36M|        return (u4_abs_val);
  582|  1.48M|}

ihevcd_pu_boundary_strength:
   87|  53.9M|{
   88|  53.9M|    WORD32 i4_bs;
   89|  53.9M|    UWORD32 l0_ref_pic_buf_id, l1_ref_pic_buf_id;
   90|  53.9M|    UWORD32 ngbr_l0_ref_pic_buf_id, ngbr_l1_ref_pic_buf_id;
   91|       |
   92|  53.9M|    WORD16 i2_mv_x0, i2_mv_y0, i2_mv_x1, i2_mv_y1;
   93|  53.9M|    WORD16 i2_ngbr_mv_x0, i2_ngbr_mv_y0, i2_ngbr_mv_x1, i2_ngbr_mv_y1;
   94|       |
   95|  53.9M|    WORD32 num_mv, ngbr_num_mv;
   96|       |
   97|  53.9M|    num_mv = (PRED_BI == ps_pu->b2_pred_mode) ? 2 : 1;
  ------------------
  |  Branch (97:14): [True: 42.0M, False: 11.9M]
  ------------------
   98|  53.9M|    ngbr_num_mv = (PRED_BI == ps_ngbr_pu->b2_pred_mode) ? 2 : 1;
  ------------------
  |  Branch (98:19): [True: 42.0M, False: 11.8M]
  ------------------
   99|       |
  100|  53.9M|    l0_ref_pic_buf_id = ps_pu->mv.i1_l0_ref_pic_buf_id;
  101|  53.9M|    l1_ref_pic_buf_id = ps_pu->mv.i1_l1_ref_pic_buf_id;
  102|  53.9M|    ngbr_l0_ref_pic_buf_id = ps_ngbr_pu->mv.i1_l0_ref_pic_buf_id;
  103|  53.9M|    ngbr_l1_ref_pic_buf_id = ps_ngbr_pu->mv.i1_l1_ref_pic_buf_id;
  104|       |
  105|       |
  106|  53.9M|    i2_mv_x0 = ps_pu->mv.s_l0_mv.i2_mvx;
  107|  53.9M|    i2_mv_y0 = ps_pu->mv.s_l0_mv.i2_mvy;
  108|  53.9M|    i2_mv_x1 = ps_pu->mv.s_l1_mv.i2_mvx;
  109|  53.9M|    i2_mv_y1 = ps_pu->mv.s_l1_mv.i2_mvy;
  110|       |
  111|  53.9M|    i2_ngbr_mv_x0 = ps_ngbr_pu->mv.s_l0_mv.i2_mvx;
  112|  53.9M|    i2_ngbr_mv_y0 = ps_ngbr_pu->mv.s_l0_mv.i2_mvy;
  113|  53.9M|    i2_ngbr_mv_x1 = ps_ngbr_pu->mv.s_l1_mv.i2_mvx;
  114|  53.9M|    i2_ngbr_mv_y1 = ps_ngbr_pu->mv.s_l1_mv.i2_mvy;
  115|       |
  116|       |
  117|       |    /* If two motion vectors are used */
  118|  53.9M|    if((2 == num_mv) &&
  ------------------
  |  Branch (118:8): [True: 42.0M, False: 11.8M]
  ------------------
  119|  42.0M|            (2 == ngbr_num_mv))
  ------------------
  |  Branch (119:13): [True: 41.4M, False: 599k]
  ------------------
  120|  41.4M|    {
  121|  41.4M|        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: 41.3M, False: 107k]
  |  Branch (121:60): [True: 41.3M, False: 23.7k]
  ------------------
  122|   144k|                (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: 102k, False: 41.3k]
  |  Branch (122:65): [True: 71.3k, False: 31.5k]
  ------------------
  123|  41.3M|        {
  124|  41.3M|            if(l0_ref_pic_buf_id != l1_ref_pic_buf_id) /* Different L0 and L1 */
  ------------------
  |  Branch (124:16): [True: 1.90M, False: 39.4M]
  ------------------
  125|  1.90M|            {
  126|  1.90M|                if(l0_ref_pic_buf_id == ngbr_l0_ref_pic_buf_id)
  ------------------
  |  Branch (126:20): [True: 1.83M, False: 64.5k]
  ------------------
  127|  1.83M|                {
  128|  1.83M|                    i4_bs = (ABS(i2_mv_x0 - i2_ngbr_mv_x0) < 4) &&
  ------------------
  |  |   45|  1.83M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 64.3k, False: 1.77M]
  |  |  ------------------
  ------------------
  |  Branch (128:29): [True: 1.77M, False: 65.5k]
  ------------------
  129|  1.77M|                            (ABS(i2_mv_y0 - i2_ngbr_mv_y0) < 4) &&
  ------------------
  |  |   45|  1.77M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 56.0k, False: 1.71M]
  |  |  ------------------
  ------------------
  |  Branch (129:29): [True: 1.70M, False: 63.5k]
  ------------------
  130|  1.70M|                            (ABS(i2_mv_x1 - i2_ngbr_mv_x1) < 4) &&
  ------------------
  |  |   45|  1.70M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 20.9k, False: 1.68M]
  |  |  ------------------
  ------------------
  |  Branch (130:29): [True: 1.69M, False: 9.09k]
  ------------------
  131|  1.69M|                            (ABS(i2_mv_y1 - i2_ngbr_mv_y1) < 4) ? 0 : 1;
  ------------------
  |  |   45|  1.69M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 17.2k, False: 1.68M]
  |  |  ------------------
  ------------------
  |  Branch (131:29): [True: 1.69M, False: 6.78k]
  ------------------
  132|  1.83M|                }
  133|  64.5k|                else
  134|  64.5k|                {
  135|  64.5k|                    i4_bs = (ABS(i2_mv_x0 - i2_ngbr_mv_x1) < 4) &&
  ------------------
  |  |   45|  64.5k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.9k, False: 52.6k]
  |  |  ------------------
  ------------------
  |  Branch (135:29): [True: 54.3k, False: 10.2k]
  ------------------
  136|  54.3k|                            (ABS(i2_mv_y0 - i2_ngbr_mv_y1) < 4) &&
  ------------------
  |  |   45|  54.3k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 15.4k, False: 38.9k]
  |  |  ------------------
  ------------------
  |  Branch (136:29): [True: 24.2k, False: 30.1k]
  ------------------
  137|  24.2k|                            (ABS(i2_mv_x1 - i2_ngbr_mv_x0) < 4) &&
  ------------------
  |  |   45|  24.2k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 5.95k, False: 18.2k]
  |  |  ------------------
  ------------------
  |  Branch (137:29): [True: 20.4k, False: 3.79k]
  ------------------
  138|  46.0k|                            (ABS(i2_mv_y1 - i2_ngbr_mv_y0) < 4) ? 0 : 1;
  ------------------
  |  |   45|  20.4k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.34k, False: 16.0k]
  |  |  ------------------
  ------------------
  |  Branch (138:29): [True: 18.6k, False: 1.81k]
  ------------------
  139|  64.5k|                }
  140|  1.90M|            }
  141|  39.4M|            else /* Same L0 and L1 */
  142|  39.4M|            {
  143|  39.4M|                i4_bs = ((ABS(i2_mv_x0 - i2_ngbr_mv_x0) >= 4) ||
  ------------------
  |  |   45|  39.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 182k, False: 39.3M]
  |  |  ------------------
  ------------------
  |  Branch (143:26): [True: 95.5k, False: 39.3M]
  ------------------
  144|  39.3M|                         (ABS(i2_mv_y0 - i2_ngbr_mv_y0) >= 4) ||
  ------------------
  |  |   45|  39.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 178k, False: 39.2M]
  |  |  ------------------
  ------------------
  |  Branch (144:26): [True: 157k, False: 39.2M]
  ------------------
  145|  39.2M|                         (ABS(i2_mv_x1 - i2_ngbr_mv_x1) >= 4) ||
  ------------------
  |  |   45|  39.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 77.9k, False: 39.1M]
  |  |  ------------------
  ------------------
  |  Branch (145:26): [True: 18.7k, False: 39.2M]
  ------------------
  146|  39.2M|                         (ABS(i2_mv_y1 - i2_ngbr_mv_y1) >= 4)) &&
  ------------------
  |  |   45|  39.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 72.2k, False: 39.1M]
  |  |  ------------------
  ------------------
  |  Branch (146:26): [True: 37.5k, False: 39.1M]
  ------------------
  147|   342k|                                ((ABS(i2_mv_x0 - i2_ngbr_mv_x1) >= 4) ||
  ------------------
  |  |   45|   342k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 120k, False: 221k]
  |  |  ------------------
  ------------------
  |  Branch (147:34): [True: 100k, False: 241k]
  ------------------
  148|   241k|                                 (ABS(i2_mv_y0 - i2_ngbr_mv_y1) >= 4) ||
  ------------------
  |  |   45|   241k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 89.2k, False: 152k]
  |  |  ------------------
  ------------------
  |  Branch (148:34): [True: 175k, False: 66.0k]
  ------------------
  149|  66.0k|                                 (ABS(i2_mv_x1 - i2_ngbr_mv_x0) >= 4) ||
  ------------------
  |  |   45|  66.0k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 27.9k, False: 38.0k]
  |  |  ------------------
  ------------------
  |  Branch (149:34): [True: 27.6k, False: 38.3k]
  ------------------
  150|  39.1M|                                 (ABS(i2_mv_y1 - i2_ngbr_mv_y0) >= 4)) ? 1 : 0;
  ------------------
  |  |   45|  38.3k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 22.3k, False: 16.0k]
  |  |  ------------------
  ------------------
  |  Branch (150:34): [True: 36.3k, False: 2.01k]
  ------------------
  151|  39.4M|            }
  152|  41.3M|        }
  153|  66.8k|        else /* If the reference pictures used are different */
  154|  66.8k|        {
  155|  66.8k|            i4_bs = 1;
  156|  66.8k|        }
  157|  41.4M|    }
  158|       |
  159|       |    /* If one motion vector is used in both PUs */
  160|  12.4M|    else if((1 == num_mv) &&
  ------------------
  |  Branch (160:13): [True: 11.9M, False: 490k]
  ------------------
  161|  11.9M|            (1 == ngbr_num_mv))
  ------------------
  |  Branch (161:13): [True: 11.3M, False: 638k]
  ------------------
  162|  11.3M|    {
  163|  11.3M|        WORD16 i2_mv_x, i2_mv_y;
  164|  11.3M|        WORD16 i2_ngbr_mv_x, i2_ngbr_mv_y;
  165|  11.3M|        UWORD32 ref_pic_buf_id, ngbr_ref_pic_buf_id;
  166|       |
  167|  11.3M|        if(PRED_L0 == ps_pu->b2_pred_mode)
  ------------------
  |  Branch (167:12): [True: 9.23M, False: 2.09M]
  ------------------
  168|  9.23M|        {
  169|  9.23M|            i2_mv_x = i2_mv_x0;
  170|  9.23M|            i2_mv_y = i2_mv_y0;
  171|  9.23M|            ref_pic_buf_id = l0_ref_pic_buf_id;
  172|  9.23M|        }
  173|  2.09M|        else
  174|  2.09M|        {
  175|  2.09M|            i2_mv_x = i2_mv_x1;
  176|  2.09M|            i2_mv_y = i2_mv_y1;
  177|  2.09M|            ref_pic_buf_id = l1_ref_pic_buf_id;
  178|  2.09M|        }
  179|       |
  180|  11.3M|        if(PRED_L0 == ps_ngbr_pu->b2_pred_mode)
  ------------------
  |  Branch (180:12): [True: 9.23M, False: 2.09M]
  ------------------
  181|  9.23M|        {
  182|  9.23M|            i2_ngbr_mv_x = i2_ngbr_mv_x0;
  183|  9.23M|            i2_ngbr_mv_y = i2_ngbr_mv_y0;
  184|  9.23M|            ngbr_ref_pic_buf_id = ngbr_l0_ref_pic_buf_id;
  185|  9.23M|        }
  186|  2.09M|        else
  187|  2.09M|        {
  188|  2.09M|            i2_ngbr_mv_x = i2_ngbr_mv_x1;
  189|  2.09M|            i2_ngbr_mv_y = i2_ngbr_mv_y1;
  190|  2.09M|            ngbr_ref_pic_buf_id = ngbr_l1_ref_pic_buf_id;
  191|  2.09M|        }
  192|       |
  193|  11.3M|        i4_bs = (ref_pic_buf_id == ngbr_ref_pic_buf_id) &&
  ------------------
  |  Branch (193:17): [True: 11.1M, False: 204k]
  ------------------
  194|  11.1M|                (ABS(i2_mv_x - i2_ngbr_mv_x) < 4)  &&
  ------------------
  |  |   45|  11.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 338k, False: 10.7M]
  |  |  ------------------
  ------------------
  |  Branch (194:17): [True: 10.9M, False: 197k]
  ------------------
  195|  10.9M|                (ABS(i2_mv_y - i2_ngbr_mv_y) < 4) ? 0 : 1;
  ------------------
  |  |   45|  10.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 257k, False: 10.6M]
  |  |  ------------------
  ------------------
  |  Branch (195:17): [True: 10.8M, False: 112k]
  ------------------
  196|  11.3M|    }
  197|       |
  198|       |    /* If the no. of motion vectors is not the same */
  199|  1.12M|    else
  200|  1.12M|    {
  201|  1.12M|        i4_bs = 1;
  202|  1.12M|    }
  203|       |
  204|       |
  205|  53.9M|    return i4_bs;
  206|  53.9M|}
ihevcd_ctb_boundary_strength_islice:
  210|  5.44M|{
  211|  5.44M|    pps_t *ps_pps;
  212|  5.44M|    sps_t *ps_sps;
  213|  5.44M|    tu_t *ps_tu;
  214|  5.44M|    UWORD32 *pu4_vert_bs;
  215|  5.44M|    UWORD32 *pu4_horz_bs;
  216|  5.44M|    WORD32 bs_strd;
  217|  5.44M|    WORD32 vert_bs0_tmp;
  218|  5.44M|    WORD32 horz_bs0_tmp;
  219|  5.44M|    WORD8 *pi1_qp;
  220|  5.44M|    WORD32 qp_strd;
  221|  5.44M|    UWORD32 u4_qp_const_in_ctb;
  222|  5.44M|    WORD32 ctb_indx;
  223|  5.44M|    WORD32 i4_tu_cnt;
  224|  5.44M|    WORD32 log2_ctb_size;
  225|  5.44M|    WORD32 ctb_size;
  226|       |
  227|  5.44M|    WORD8 i1_loop_filter_across_tiles_enabled_flag;
  228|  5.44M|    WORD8 i1_loop_filter_across_slices_enabled_flag;
  229|       |
  230|  5.44M|    WORD32 i;
  231|       |
  232|  5.44M|    PROFILE_DISABLE_BOUNDARY_STRENGTH();
  ------------------
  |  |   84|  5.44M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  233|       |
  234|  5.44M|    ps_pps = ps_bs_ctxt->ps_pps;
  235|  5.44M|    ps_sps = ps_bs_ctxt->ps_sps;
  236|  5.44M|    i1_loop_filter_across_tiles_enabled_flag = ps_pps->i1_loop_filter_across_tiles_enabled_flag;
  237|  5.44M|    i1_loop_filter_across_slices_enabled_flag = ps_bs_ctxt->ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag;
  238|  5.44M|    i4_tu_cnt = ps_bs_ctxt->i4_ctb_tu_cnt;
  239|       |
  240|  5.44M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  241|  5.44M|    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.44M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  246|       |
  247|  5.44M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_vert_bs +
  248|  5.44M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  249|  5.44M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  250|  5.44M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_horz_bs +
  251|  5.44M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  252|  5.44M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  253|       |
  254|       |    /* ctb_size/8 elements per CTB */
  255|  5.44M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  256|  5.44M|    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.44M|    ctb_indx = ps_bs_ctxt->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_bs_ctxt->i4_ctb_y;
  259|  5.44M|    u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[ctb_indx >> 3] & (1 << (ctb_indx & 7));
  260|       |
  261|  5.44M|    vert_bs0_tmp = pu4_vert_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  262|  5.44M|    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.44M|    memset(pu4_vert_bs, 0, (1 << (2 * log2_ctb_size - 7)) + ((ctb_size >> 5) << 1));
  273|  5.44M|    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.44M|    if(0 != ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (276:8): [True: 5.19M, False: 243k]
  ------------------
  277|  5.19M|    {
  278|  5.19M|        pu4_vert_bs[0] |= vert_bs0_tmp;
  279|  5.19M|    }
  280|       |
  281|       |    /* pu4_horz_bs[0] has information about the top CTB which is not required when ctb_y = 0 */
  282|  5.44M|    if(0 != ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (282:8): [True: 5.20M, False: 235k]
  ------------------
  283|  5.20M|    {
  284|  5.20M|        pu4_horz_bs[0] |= horz_bs0_tmp;
  285|  5.20M|    }
  286|       |
  287|  5.44M|    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.44M|    if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (290:8): [True: 5.41M, False: 23.8k]
  ------------------
  291|  5.41M|        pi1_qp[0] = ps_tu->b7_qp;
  292|       |
  293|   122M|    for(i = 0; i < i4_tu_cnt; i++)
  ------------------
  |  Branch (293:16): [True: 117M, False: 5.44M]
  ------------------
  294|   117M|    {
  295|   117M|        WORD32 start_pos_x;
  296|   117M|        WORD32 start_pos_y;
  297|   117M|        WORD32 tu_size;
  298|       |
  299|       |
  300|   117M|        UWORD32 u4_bs;
  301|   117M|        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|   117M|        start_pos_x = ps_tu->b4_pos_x;
  305|   117M|        start_pos_y = ps_tu->b4_pos_y;
  306|       |
  307|   117M|        tu_size = 1 << (ps_tu->b3_size + 2);
  308|   117M|        tu_size >>= 2; /* TU size divided by 4 */
  309|       |
  310|   117M|        u4_bs = DUP_LSB_10(tu_size);
  ------------------
  |  |   78|   117M|#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|   117M|        if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (313:12): [True: 115M, False: 1.60M]
  ------------------
  314|   115M|        {
  315|   115M|            WORD32 shift;
  316|   115M|            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|   115M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (321:16): [True: 20.8M, False: 94.7M]
  ------------------
  322|  20.8M|                shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  323|   115M|            pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  324|   115M|        }
  325|       |        /* Only if the current edge falls on 8 pixel grid set BS */
  326|   117M|        if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (326:12): [True: 115M, False: 1.60M]
  ------------------
  327|   115M|        {
  328|   115M|            WORD32 shift;
  329|   115M|            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|   115M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (334:16): [True: 20.8M, False: 94.7M]
  ------------------
  335|  20.8M|                shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  336|   115M|            pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  337|   115M|        }
  338|       |
  339|       |        /* Populating the QP array */
  340|   117M|        if(0 == u4_qp_const_in_ctb)
  ------------------
  |  Branch (340:12): [True: 2.07M, False: 115M]
  ------------------
  341|  2.07M|        {
  342|  2.07M|            if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (342:16): [True: 1.39M, False: 687k]
  |  Branch (342:42): [True: 1.04M, False: 343k]
  ------------------
  343|  1.04M|            {
  344|  1.04M|                WORD32 row, col;
  345|  2.55M|                for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (345:40): [True: 1.51M, False: 1.04M]
  ------------------
  346|  1.51M|                {
  347|  4.38M|                    for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (347:44): [True: 2.87M, False: 1.51M]
  ------------------
  348|  2.87M|                    {
  349|  2.87M|                        pi1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
  350|  2.87M|                    }
  351|  1.51M|                }
  352|  1.04M|            }
  353|  2.07M|        }
  354|       |
  355|   117M|    }
  356|  5.44M|    {
  357|       |        /*Determine if the slice is dependent, and is its left neighbor belongs to the same slice, in a different tile*/
  358|  5.44M|        UWORD32 ctb_addr;
  359|  5.44M|        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.44M|        if(!ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (361:12): [True: 3.31M, False: 2.12M]
  ------------------
  362|  3.31M|        {
  363|  3.31M|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x) ||
  ------------------
  |  Branch (363:17): [True: 3.31M, False: 1.07k]
  |  Branch (363:66): [True: 218k, False: 3.09M]
  ------------------
  364|  3.09M|                            (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.82M, False: 265k]
  |  Branch (364:80): [True: 9.27k, False: 2.82M]
  |  Branch (364:115): [True: 2.01k, False: 7.25k]
  ------------------
  365|  3.09M|                            (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (365:29): [True: 18.4E, False: 3.09M]
  ------------------
  366|   220k|            {
  367|   220k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (367:35): [True: 100k, False: 120k]
  ------------------
  368|   220k|            }
  369|  3.31M|        }
  370|  2.12M|        else
  371|  2.12M|        {
  372|       |            //If across-tiles is disabled
  373|  2.12M|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x))
  ------------------
  |  Branch (373:17): [True: 1.09M, False: 1.03M]
  |  Branch (373:66): [True: 129k, False: 961k]
  ------------------
  374|   129k|            {
  375|   129k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (375:35): [True: 14.3k, False: 114k]
  ------------------
  376|   129k|            }
  377|  1.99M|            else
  378|  1.99M|            {
  379|  1.99M|                ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  380|  1.99M|                slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  381|  1.99M|                if(ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (381:20): [True: 1.99M, False: 9.34k]
  ------------------
  382|  1.99M|                {
  383|  1.99M|                    ctb_addr = (ps_bs_ctxt->i4_ctb_x - 1) + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  384|  1.99M|                    left_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  385|  1.99M|                }
  386|       |                /*If the 1st slice in a new tile is a dependent slice*/
  387|  1.99M|                if(!((ps_bs_ctxt->ps_slice_hdr->i1_dependent_slice_flag == 1) && (slice_idx == left_slice_idx)))
  ------------------
  |  Branch (387:22): [True: 84.1k, False: 1.91M]
  |  Branch (387:82): [True: 83.0k, False: 1.03k]
  ------------------
  388|  1.91M|                {
  389|       |                    /* Removed reduntant checks */
  390|  1.91M|                    if((0 == i1_loop_filter_across_slices_enabled_flag && (
  ------------------
  |  Branch (390:25): [True: 1.05M, False: 862k]
  ------------------
  391|  1.05M|                                    ((slice_idx != left_slice_idx) && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (391:38): [True: 5.22k, False: 1.05M]
  |  Branch (391:71): [True: 1.90k, False: 3.31k]
  ------------------
  392|  1.05M|                                    ((0 == ps_bs_ctxt->i4_ctb_tile_x) && (slice_idx != left_slice_idx)))) ||
  ------------------
  |  Branch (392:38): [True: 16.8k, False: 1.03M]
  |  Branch (392:74): [True: 3.31k, False: 13.5k]
  ------------------
  393|  1.91M|                                    (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (393:37): [True: 7.57k, False: 1.90M]
  ------------------
  394|  12.9k|                    {
  395|  12.9k|                        pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (395:43): [True: 3.44k, False: 9.52k]
  ------------------
  396|  12.9k|                    }
  397|  1.91M|                }
  398|  1.99M|            }
  399|  2.12M|        }
  400|       |
  401|  5.44M|        ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  402|  5.44M|        slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  403|  5.44M|        if(ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (403:12): [True: 5.16M, False: 275k]
  ------------------
  404|  5.16M|        {
  405|  5.16M|            ctb_addr = (ps_bs_ctxt->i4_ctb_x) + ((ps_bs_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  406|  5.16M|            top_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  407|  5.16M|        }
  408|       |
  409|       |        /* If top neighbor is not available, then set BS for entire first row to zero */
  410|       |        /* Removed reduntant checks */
  411|  5.44M|        if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_y)
  ------------------
  |  Branch (411:13): [True: 4.39M, False: 1.04M]
  |  Branch (411:62): [True: 297k, False: 4.10M]
  ------------------
  412|  5.14M|                        || (0 == i1_loop_filter_across_slices_enabled_flag && ((slice_idx != top_slice_idx)))
  ------------------
  |  Branch (412:29): [True: 3.89M, False: 1.25M]
  |  Branch (412:79): [True: 7.75k, False: 3.88M]
  ------------------
  413|  5.13M|                        || (0 == ps_bs_ctxt->i4_ctb_y))
  ------------------
  |  Branch (413:28): [True: 2.80k, False: 5.12M]
  ------------------
  414|   308k|        {
  415|   308k|            pu4_horz_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (415:31): [True: 231k, False: 76.7k]
  ------------------
  416|   308k|        }
  417|  5.44M|    }
  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.44M|    {
  424|  5.44M|        WORD32 num_rows_remaining = (ps_sps->i2_pic_height_in_luma_samples - (ps_bs_ctxt->i4_ctb_y << log2_ctb_size)) >> 3;
  425|  5.44M|        WORD32 num_cols_remaining = (ps_sps->i2_pic_width_in_luma_samples - (ps_bs_ctxt->i4_ctb_x << log2_ctb_size)) >> 3;
  426|  5.44M|        if(num_rows_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (426:12): [True: 375k, False: 5.06M]
  ------------------
  427|   375k|        {
  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|   375k|            WORD32 offset;
  433|   375k|            offset = (num_rows_remaining >> (6 - log2_ctb_size)) << 2;
  434|   375k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (434:16): [True: 73.4k, False: 302k]
  ------------------
  435|  73.4k|                offset += (num_rows_remaining & 1) << (log2_ctb_size - 4);
  436|       |
  437|   375k|            memset(((UWORD8 *)pu4_horz_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  438|   375k|        }
  439|       |
  440|  5.44M|        if(num_cols_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (440:12): [True: 177k, False: 5.26M]
  ------------------
  441|   177k|        {
  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|   177k|            WORD32 offset;
  448|   177k|            offset = (num_cols_remaining >> (6 - log2_ctb_size)) << 2;
  449|   177k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (449:16): [True: 108k, False: 68.6k]
  ------------------
  450|   108k|                offset += (num_cols_remaining & 1) << (log2_ctb_size - 4);
  451|       |
  452|   177k|            memset(((UWORD8 *)pu4_vert_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  453|   177k|        }
  454|  5.44M|    }
  455|       |
  456|  5.44M|    return 0;
  457|  5.44M|}
ihevcd_ctb_boundary_strength_pbslice:
  459|  1.65M|{
  460|  1.65M|    sps_t *ps_sps;
  461|  1.65M|    pps_t *ps_pps;
  462|  1.65M|    WORD32 cur_ctb_idx, next_ctb_idx = 0;
  463|  1.65M|    WORD32 i4_tu_cnt;
  464|  1.65M|    WORD32 i4_pu_cnt;
  465|  1.65M|    tu_t *ps_tu;
  466|       |
  467|  1.65M|    UWORD32 *pu4_vert_bs;
  468|  1.65M|    UWORD32 *pu4_horz_bs;
  469|  1.65M|    WORD32 bs_strd;
  470|  1.65M|    WORD32 vert_bs0_tmp;
  471|  1.65M|    WORD32 horz_bs0_tmp;
  472|  1.65M|    WORD8 *pi1_qp;
  473|  1.65M|    WORD32 qp_strd;
  474|  1.65M|    UWORD32 u4_qp_const_in_ctb;
  475|  1.65M|    WORD32 ctb_indx;
  476|  1.65M|    WORD32 log2_ctb_size;
  477|  1.65M|    WORD32 ctb_size;
  478|       |
  479|  1.65M|    WORD32 i;
  480|  1.65M|    WORD8 i1_loop_filter_across_tiles_enabled_flag;
  481|  1.65M|    WORD8 i1_loop_filter_across_slices_enabled_flag;
  482|       |
  483|  1.65M|    PROFILE_DISABLE_BOUNDARY_STRENGTH();
  ------------------
  |  |   84|  1.65M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  484|       |
  485|  1.65M|    ps_sps = ps_bs_ctxt->ps_sps;
  486|  1.65M|    ps_pps = ps_bs_ctxt->ps_pps;
  487|       |
  488|  1.65M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  489|  1.65M|    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.65M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  494|       |
  495|  1.65M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_vert_bs +
  496|  1.65M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  497|  1.65M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  498|  1.65M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_horz_bs +
  499|  1.65M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  500|  1.65M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  501|       |
  502|  1.65M|    vert_bs0_tmp = pu4_vert_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  503|  1.65M|    horz_bs0_tmp = pu4_horz_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  504|       |
  505|  1.65M|    ps_tu = ps_bs_ctxt->ps_tu;
  506|       |
  507|       |    /* ctb_size/8 elements per CTB */
  508|  1.65M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  509|  1.65M|    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.65M|    ctb_indx = ps_bs_ctxt->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_bs_ctxt->i4_ctb_y;
  512|  1.65M|    u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[ctb_indx >> 3] & (1 << (ctb_indx & 7));
  513|       |
  514|  1.65M|    i1_loop_filter_across_tiles_enabled_flag = ps_pps->i1_loop_filter_across_tiles_enabled_flag;
  515|  1.65M|    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.65M|    memset(pu4_vert_bs, 0, (1 << (2 * log2_ctb_size - 7)) + (ctb_size >> 4));
  526|  1.65M|    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.65M|    if(0 != ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (529:8): [True: 1.47M, False: 178k]
  ------------------
  530|  1.47M|    {
  531|  1.47M|        pu4_vert_bs[0] |= vert_bs0_tmp;
  532|  1.47M|    }
  533|       |
  534|       |    /* pu4_horz_bs[0] has information about the top CTB which is not required when ctb_y = 0 */
  535|  1.65M|    if(0 != ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (535:8): [True: 1.54M, False: 113k]
  ------------------
  536|  1.54M|    {
  537|  1.54M|        pu4_horz_bs[0] |= horz_bs0_tmp;
  538|  1.54M|    }
  539|       |    /* pu4_horz_bs[bs_strd / 4] corresponds to pu4_horz_bs[0] of the bottom CTB */
  540|  1.65M|    *(UWORD32 *)((UWORD8 *)pu4_horz_bs + bs_strd) = 0;
  541|       |
  542|  1.65M|    cur_ctb_idx = ps_bs_ctxt->i4_ctb_x
  543|  1.65M|                    + ps_bs_ctxt->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  544|  1.65M|    next_ctb_idx = ps_bs_ctxt->i4_next_tu_ctb_cnt;
  545|  1.65M|    if(1 == ps_bs_ctxt->ps_codec->i4_num_cores)
  ------------------
  |  Branch (545:8): [True: 237k, False: 1.41M]
  ------------------
  546|   237k|    {
  547|   237k|        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|   237k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   237k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   237k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   237k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   237k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   237k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|   237k|    }
  549|  1.41M|    else
  550|  1.41M|    {
  551|  1.41M|        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.41M|    }
  553|       |
  554|  1.65M|    ps_tu = ps_bs_ctxt->ps_tu;
  555|  1.65M|    if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (555:8): [True: 1.60M, False: 51.8k]
  ------------------
  556|  1.60M|        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|  32.5M|    for(i = 0; i < i4_tu_cnt; i++)
  ------------------
  |  Branch (559:16): [True: 30.9M, False: 1.65M]
  ------------------
  560|  30.9M|    {
  561|  30.9M|        WORD32 start_pos_x;
  562|  30.9M|        WORD32 start_pos_y;
  563|  30.9M|        WORD32 end_pos_x;
  564|  30.9M|        WORD32 end_pos_y;
  565|  30.9M|        WORD32 tu_size;
  566|  30.9M|        UWORD32 u4_bs;
  567|  30.9M|        WORD32 intra_flag;
  568|  30.9M|        UWORD8 *pu1_pic_intra_flag;
  569|       |
  570|  30.9M|        ps_tu = ps_bs_ctxt->ps_tu + i;
  571|       |
  572|  30.9M|        start_pos_x = ps_tu->b4_pos_x;
  573|  30.9M|        start_pos_y = ps_tu->b4_pos_y;
  574|       |
  575|  30.9M|        tu_size = 1 << (ps_tu->b3_size + 2);
  576|  30.9M|        tu_size >>= 2;
  577|       |
  578|  30.9M|        end_pos_x = start_pos_x + tu_size;
  579|  30.9M|        end_pos_y = start_pos_y + tu_size;
  580|       |
  581|  30.9M|        {
  582|  30.9M|            WORD32 tu_abs_x = (ps_bs_ctxt->i4_ctb_x << log2_ctb_size) + (start_pos_x << 2);
  583|  30.9M|            WORD32 tu_abs_y = (ps_bs_ctxt->i4_ctb_y << log2_ctb_size) + (start_pos_y << 2);
  584|       |
  585|  30.9M|            WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  586|       |
  587|  30.9M|            pu1_pic_intra_flag = ps_bs_ctxt->ps_codec->pu1_pic_intra_flag;
  588|  30.9M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
  589|  30.9M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
  590|       |
  591|  30.9M|            intra_flag = *pu1_pic_intra_flag;
  592|  30.9M|            intra_flag &= (1 << ((tu_abs_x >> 3) % 8));
  593|  30.9M|        }
  594|  30.9M|        if(intra_flag)
  ------------------
  |  Branch (594:12): [True: 310k, False: 30.6M]
  ------------------
  595|   310k|        {
  596|   310k|            u4_bs = DUP_LSB_10(tu_size);
  ------------------
  |  |   78|   310k|#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|   310k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (599:16): [True: 229k, False: 81.3k]
  ------------------
  600|   229k|            {
  601|   229k|                WORD32 shift;
  602|   229k|                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|   229k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (607:20): [True: 25.8k, False: 203k]
  ------------------
  608|  25.8k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  609|   229k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  610|   229k|            }
  611|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  612|   310k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (612:16): [True: 229k, False: 81.3k]
  ------------------
  613|   229k|            {
  614|   229k|                WORD32 shift;
  615|   229k|                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|   229k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (620:20): [True: 25.8k, False: 203k]
  ------------------
  621|  25.8k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  622|   229k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  623|   229k|            }
  624|   310k|        }
  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|  30.9M|        if(ps_tu->b1_y_cbf)
  ------------------
  |  Branch (628:12): [True: 496k, False: 30.4M]
  ------------------
  629|   496k|        {
  630|   496k|            u4_bs = DUP_LSB_01(tu_size);
  ------------------
  |  |   75|   496k|#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|   496k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (633:16): [True: 388k, False: 107k]
  ------------------
  634|   388k|            {
  635|   388k|                WORD32 shift;
  636|   388k|                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|   388k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (641:20): [True: 32.2k, False: 356k]
  ------------------
  642|  32.2k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  643|   388k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  644|   388k|            }
  645|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  646|   496k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (646:16): [True: 388k, False: 108k]
  ------------------
  647|   388k|            {
  648|   388k|                WORD32 shift;
  649|   388k|                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|   388k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (654:20): [True: 32.2k, False: 356k]
  ------------------
  655|  32.2k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  656|   388k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  657|   388k|            }
  658|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  659|   496k|            if(0 == (end_pos_x & 1))
  ------------------
  |  Branch (659:16): [True: 387k, False: 109k]
  ------------------
  660|   387k|            {
  661|   387k|                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: 102k, False: 284k]
  |  Branch (661:58): [True: 3.87k, False: 98.5k]
  ------------------
  662|   383k|                {
  663|   383k|                    WORD32 shift;
  664|   383k|                    shift = start_pos_y * 2;
  665|   383k|                    shift += (((end_pos_x >> 1) & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1));
  ------------------
  |  |  351|   383k|#define MAX_CTB_SIZE        64
  ------------------
  666|   383k|                    pu4_vert_bs[end_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  667|   383k|                }
  668|   387k|            }
  669|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  670|   496k|            if(0 == (end_pos_y & 1))
  ------------------
  |  Branch (670:16): [True: 387k, False: 108k]
  ------------------
  671|   387k|            {
  672|       |                /* If end_pos_y corresponds to the bottom of the CTB, write to pu4_horz_bs[0] of the bottom CTB */
  673|   387k|                if(ctb_size / 8 == (end_pos_y >> 1))
  ------------------
  |  Branch (673:20): [True: 102k, False: 284k]
  ------------------
  674|   102k|                {
  675|   102k|                    *(UWORD32 *)((UWORD8 *)pu4_horz_bs + bs_strd) |= (u4_bs << (start_pos_x * 2));
  676|   102k|                }
  677|   284k|                else
  678|   284k|                {
  679|   284k|                    WORD32 shift;
  680|   284k|                    shift = start_pos_x * 2;
  681|   284k|                    shift += (((end_pos_y >> 1) & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1));
  ------------------
  |  |  351|   284k|#define MAX_CTB_SIZE        64
  ------------------
  682|   284k|                    pu4_horz_bs[end_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  683|   284k|                }
  684|   387k|            }
  685|   496k|        }
  686|       |
  687|  30.9M|        if(0 == u4_qp_const_in_ctb)
  ------------------
  |  Branch (687:12): [True: 581k, False: 30.3M]
  ------------------
  688|   581k|        {
  689|   581k|            if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (689:16): [True: 476k, False: 105k]
  |  Branch (689:42): [True: 423k, False: 52.6k]
  ------------------
  690|   423k|            {
  691|   423k|                WORD32 row, col;
  692|  1.24M|                for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (692:40): [True: 825k, False: 423k]
  ------------------
  693|   825k|                {
  694|  3.11M|                    for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (694:44): [True: 2.29M, False: 825k]
  ------------------
  695|  2.29M|                    {
  696|  2.29M|                        pi1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
  697|  2.29M|                    }
  698|   825k|                }
  699|   423k|            }
  700|   581k|        }
  701|  30.9M|    }
  702|       |
  703|       |    /* For all PUs in the CTB,
  704|       |    For left and top edges, compute BS */
  705|       |
  706|  1.65M|    cur_ctb_idx = ps_bs_ctxt->i4_ctb_x
  707|  1.65M|                    + ps_bs_ctxt->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  708|       |
  709|  1.65M|    {
  710|  1.65M|        WORD32 next_ctb_idx;
  711|  1.65M|        next_ctb_idx = ps_bs_ctxt->i4_next_pu_ctb_cnt;
  712|  1.65M|        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.65M|    }
  714|       |
  715|  29.0M|    for(i = 0; i < i4_pu_cnt; i++)
  ------------------
  |  Branch (715:16): [True: 27.3M, False: 1.65M]
  ------------------
  716|  27.3M|    {
  717|  27.3M|        WORD32 start_pos_x;
  718|  27.3M|        WORD32 start_pos_y;
  719|  27.3M|        WORD32 end_pos_x;
  720|  27.3M|        WORD32 end_pos_y;
  721|  27.3M|        WORD32 pu_wd, pu_ht;
  722|  27.3M|        UWORD32 u4_bs;
  723|  27.3M|        pu_t *ps_pu = ps_bs_ctxt->ps_pu + i;
  724|  27.3M|        pu_t *ps_ngbr_pu;
  725|  27.3M|        UWORD32 u4_ngbr_pu_indx;
  726|       |
  727|  27.3M|        start_pos_x = ps_pu->b4_pos_x;
  728|  27.3M|        start_pos_y = ps_pu->b4_pos_y;
  729|       |
  730|  27.3M|        pu_wd = (ps_pu->b4_wd + 1);
  731|  27.3M|        pu_ht = (ps_pu->b4_ht + 1);
  732|       |
  733|  27.3M|        end_pos_x = start_pos_x + pu_wd;
  734|  27.3M|        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|  27.3M|        if(ps_pu->b1_intra_flag)
  ------------------
  |  Branch (738:12): [True: 102k, False: 27.2M]
  ------------------
  739|   102k|        {
  740|   102k|            u4_bs = DUP_LSB_10(pu_ht);
  ------------------
  |  |   78|   102k|#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|   102k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (743:16): [True: 102k, False: 18.4E]
  ------------------
  744|   102k|            {
  745|   102k|                WORD32 shift;
  746|   102k|                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|   102k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (751:20): [True: 7.22k, False: 94.9k]
  ------------------
  752|  7.22k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  753|   102k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  754|   102k|            }
  755|       |
  756|   102k|            u4_bs = DUP_LSB_10(pu_wd);
  ------------------
  |  |   78|   102k|#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|   102k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (759:16): [True: 102k, False: 18.4E]
  ------------------
  760|   102k|            {
  761|   102k|                WORD32 shift;
  762|   102k|                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|   102k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (767:20): [True: 7.22k, False: 94.9k]
  ------------------
  768|  7.22k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  769|   102k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  770|   102k|            }
  771|   102k|        }
  772|       |
  773|  27.2M|        else
  774|  27.2M|        {
  775|       |            /* Vertical edge */
  776|       |            /* Process only if the edge is not a frame edge */
  777|  27.2M|            if(0 != ps_bs_ctxt->i4_ctb_x + start_pos_x)
  ------------------
  |  Branch (777:16): [True: 26.8M, False: 491k]
  ------------------
  778|  26.8M|            {
  779|  26.8M|                do
  780|  27.0M|                {
  781|  27.0M|                    WORD32 pu_ngbr_ht;
  782|  27.0M|                    WORD32 min_pu_ht;
  783|  27.0M|                    WORD32 ngbr_end_pos_y;
  784|  27.0M|                    UWORD32 ngbr_pu_idx_strd;
  785|  27.0M|                    ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  27.0M|#define MAX_CTB_SIZE        64
  ------------------
                                  ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  27.0M|#define MIN_PU_SIZE         4
  ------------------
  786|  27.0M|                    u4_ngbr_pu_indx = ps_bs_ctxt->pu4_pic_pu_idx_map[(start_pos_y + 1) * ngbr_pu_idx_strd + (start_pos_x)];
  787|  27.0M|                    ps_ngbr_pu = ps_bs_ctxt->ps_pic_pu + u4_ngbr_pu_indx;
  788|       |
  789|  27.0M|                    pu_ngbr_ht = ps_ngbr_pu->b4_ht + 1;
  790|  27.0M|                    ngbr_end_pos_y = ps_ngbr_pu->b4_pos_y + pu_ngbr_ht;
  791|       |
  792|  27.0M|                    min_pu_ht = MIN(ngbr_end_pos_y, end_pos_y) - start_pos_y;
  ------------------
  |  |   43|  27.0M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 225k, False: 26.8M]
  |  |  ------------------
  ------------------
  793|       |
  794|  27.0M|                    if(ps_ngbr_pu->b1_intra_flag)
  ------------------
  |  Branch (794:24): [True: 47.9k, False: 26.9M]
  ------------------
  795|  47.9k|                    {
  796|  47.9k|                        u4_bs = DUP_LSB_10(min_pu_ht);
  ------------------
  |  |   78|  47.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|  47.9k|                        if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (799:28): [True: 47.9k, False: 0]
  ------------------
  800|  47.9k|                        {
  801|  47.9k|                            WORD32 shift;
  802|  47.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|  47.9k|                            if(6 != log2_ctb_size)
  ------------------
  |  Branch (807:32): [True: 5.18k, False: 42.8k]
  ------------------
  808|  5.18k|                                shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  809|  47.9k|                            pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  810|  47.9k|                        }
  811|  47.9k|                    }
  812|  26.9M|                    else
  813|  26.9M|                    {
  814|  26.9M|                        u4_bs = ihevcd_pu_boundary_strength(ps_pu, ps_ngbr_pu);
  815|  26.9M|                        if(u4_bs)
  ------------------
  |  Branch (815:28): [True: 1.19M, False: 25.7M]
  ------------------
  816|  1.19M|                        {
  817|  1.19M|                            u4_bs = DUP_LSB_01(min_pu_ht);
  ------------------
  |  |   75|  1.19M|#define DUP_LSB_01(x) ((UWORD32)0x55555555 >> (32 - ((x) * 2)))
  ------------------
  818|  1.19M|                            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (818:32): [True: 1.12M, False: 67.7k]
  ------------------
  819|  1.12M|                            {
  820|  1.12M|                                WORD32 shift;
  821|  1.12M|                                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.12M|                                if(6 != log2_ctb_size)
  ------------------
  |  Branch (826:36): [True: 466k, False: 659k]
  ------------------
  827|   466k|                                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  828|  1.12M|                                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  829|  1.12M|                            }
  830|  1.19M|                        }
  831|  26.9M|                    }
  832|       |
  833|  27.0M|                    pu_ht -= min_pu_ht;
  834|  27.0M|                    start_pos_y += min_pu_ht;
  835|  27.0M|                }while(pu_ht > 0);
  ------------------
  |  Branch (835:24): [True: 225k, False: 26.8M]
  ------------------
  836|       |
  837|       |                /* Reinitialising since the values are updated in the previous loop */
  838|  26.8M|                pu_ht = ps_pu->b4_ht + 1;
  839|  26.8M|                start_pos_y = ps_pu->b4_pos_y;
  840|  26.8M|            }
  841|       |
  842|       |            /* Horizontal edge */
  843|       |            /* Process only if the edge is not a frame edge */
  844|  27.2M|            if(0 != ps_bs_ctxt->i4_ctb_y + start_pos_y)
  ------------------
  |  Branch (844:16): [True: 26.9M, False: 321k]
  ------------------
  845|  26.9M|            {
  846|  26.9M|                do
  847|  27.3M|                {
  848|  27.3M|                    WORD32 pu_ngbr_wd;
  849|  27.3M|                    WORD32 min_pu_wd;
  850|  27.3M|                    WORD32 ngbr_end_pos_x;
  851|  27.3M|                    UWORD32 ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  27.3M|#define MAX_CTB_SIZE        64
  ------------------
                                  UWORD32 ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  27.3M|#define MIN_PU_SIZE         4
  ------------------
  852|  27.3M|                    u4_ngbr_pu_indx = ps_bs_ctxt->pu4_pic_pu_idx_map[(start_pos_y)*ngbr_pu_idx_strd + (start_pos_x + 1)];
  853|  27.3M|                    ps_ngbr_pu = ps_bs_ctxt->ps_pic_pu + u4_ngbr_pu_indx;
  854|       |
  855|  27.3M|                    pu_ngbr_wd = ps_ngbr_pu->b4_wd + 1;
  856|  27.3M|                    ngbr_end_pos_x = ps_ngbr_pu->b4_pos_x + pu_ngbr_wd;
  857|       |
  858|  27.3M|                    min_pu_wd = MIN(ngbr_end_pos_x, end_pos_x) - start_pos_x;
  ------------------
  |  |   43|  27.3M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 343k, False: 26.9M]
  |  |  ------------------
  ------------------
  859|       |
  860|  27.3M|                    if(ps_ngbr_pu->b1_intra_flag)
  ------------------
  |  Branch (860:24): [True: 51.3k, False: 27.2M]
  ------------------
  861|  51.3k|                    {
  862|  51.3k|                        u4_bs = DUP_LSB_10(min_pu_wd);
  ------------------
  |  |   78|  51.3k|#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|  51.3k|                        if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (865:28): [True: 51.3k, False: 0]
  ------------------
  866|  51.3k|                        {
  867|  51.3k|                            WORD32 shift;
  868|  51.3k|                            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|  51.3k|                            if(6 != log2_ctb_size)
  ------------------
  |  Branch (873:32): [True: 6.51k, False: 44.7k]
  ------------------
  874|  6.51k|                                shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  875|  51.3k|                            pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  876|  51.3k|                        }
  877|  51.3k|                    }
  878|  27.2M|                    else
  879|  27.2M|                    {
  880|  27.2M|                        u4_bs = ihevcd_pu_boundary_strength(ps_pu, ps_ngbr_pu);
  881|  27.2M|                        if(u4_bs)
  ------------------
  |  Branch (881:28): [True: 1.21M, False: 26.0M]
  ------------------
  882|  1.21M|                        {
  883|  1.21M|                            u4_bs = DUP_LSB_01(min_pu_wd);
  ------------------
  |  |   75|  1.21M|#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.21M|                            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (886:32): [True: 1.16M, False: 49.2k]
  ------------------
  887|  1.16M|                            {
  888|  1.16M|                                WORD32 shift;
  889|  1.16M|                                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.16M|                                if(6 != log2_ctb_size)
  ------------------
  |  Branch (894:36): [True: 267k, False: 894k]
  ------------------
  895|   267k|                                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  896|  1.16M|                                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  897|  1.16M|                            }
  898|  1.21M|                        }
  899|  27.2M|                    }
  900|       |
  901|  27.3M|                    pu_wd -= min_pu_wd;
  902|  27.3M|                    start_pos_x += min_pu_wd;
  903|  27.3M|                }while(pu_wd > 0);
  ------------------
  |  Branch (903:24): [True: 343k, False: 26.9M]
  ------------------
  904|       |
  905|       |                /* Reinitialising since the values are updated in the previous loop */
  906|  26.9M|                pu_wd = ps_pu->b4_wd + 1;
  907|  26.9M|                start_pos_x = ps_pu->b4_pos_x;
  908|  26.9M|            }
  909|  27.2M|        }
  910|  27.3M|    }
  911|       |
  912|  1.65M|    {
  913|       |        /* If left neighbor is not available, then set BS for entire first column to zero */
  914|  1.65M|        UWORD32 ctb_addr;
  915|  1.65M|        WORD32 slice_idx, left_slice_idx = -1, top_slice_idx = -1;
  916|       |
  917|  1.65M|        if(!ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (917:12): [True: 1.07M, False: 583k]
  ------------------
  918|  1.07M|        {
  919|  1.07M|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x) ||
  ------------------
  |  Branch (919:17): [True: 1.07M, False: 55]
  |  Branch (919:66): [True: 145k, False: 925k]
  ------------------
  920|   930k|                            (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: 581k, False: 348k]
  |  Branch (920:80): [True: 2.86k, False: 578k]
  |  Branch (920:115): [True: 241, False: 2.62k]
  ------------------
  921|   929k|                            (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (921:29): [True: 18.4E, False: 929k]
  ------------------
  922|   145k|            {
  923|   145k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (923:35): [True: 19.5k, False: 125k]
  ------------------
  924|   145k|            }
  925|  1.07M|        }
  926|   583k|        else
  927|   583k|        {
  928|   583k|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x))
  ------------------
  |  Branch (928:17): [True: 210k, False: 373k]
  |  Branch (928:66): [True: 35.4k, False: 175k]
  ------------------
  929|  35.4k|            {
  930|  35.4k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (930:35): [True: 10.0k, False: 25.4k]
  ------------------
  931|  35.4k|            }
  932|   548k|            else
  933|   548k|            {
  934|       |
  935|   548k|                ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  936|   548k|                slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  937|       |
  938|   548k|                if(ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (938:20): [True: 511k, False: 37.1k]
  ------------------
  939|   511k|                {
  940|   511k|                    ctb_addr = (ps_bs_ctxt->i4_ctb_x - 1) + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  941|   511k|                    left_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  942|   511k|                }
  943|       |
  944|   548k|                if(!((ps_bs_ctxt->ps_slice_hdr->i1_dependent_slice_flag == 1) && (slice_idx == left_slice_idx)))
  ------------------
  |  Branch (944:22): [True: 103k, False: 445k]
  |  Branch (944:82): [True: 100k, False: 2.72k]
  ------------------
  945|   420k|                {
  946|       |                    /* Removed reduntant checks */
  947|   420k|                    if((0 == i1_loop_filter_across_slices_enabled_flag && (
  ------------------
  |  Branch (947:25): [True: 269k, False: 151k]
  ------------------
  948|   269k|                                    (0 == ps_bs_ctxt->i4_ctb_slice_x && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (948:38): [True: 10.3k, False: 259k]
  |  Branch (948:73): [True: 1.30k, False: 9.09k]
  ------------------
  949|   410k|                                    ((0 == ps_bs_ctxt->i4_ctb_tile_x) && (slice_idx != left_slice_idx)))) || (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (949:38): [True: 14.7k, False: 253k]
  |  Branch (949:74): [True: 9.22k, False: 5.53k]
  |  Branch (949:110): [True: 2.77k, False: 407k]
  ------------------
  950|  13.3k|                    {
  951|  13.3k|                        pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (951:43): [True: 2.33k, False: 11.0k]
  ------------------
  952|  13.3k|                    }
  953|   420k|                }
  954|   548k|            }
  955|   583k|        }
  956|       |
  957|  1.65M|        ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  958|  1.65M|        slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  959|  1.65M|        if(ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (959:12): [True: 1.51M, False: 134k]
  ------------------
  960|  1.51M|        {
  961|  1.51M|            ctb_addr = (ps_bs_ctxt->i4_ctb_x) + ((ps_bs_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  962|  1.51M|            top_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  963|  1.51M|        }
  964|       |        /* If top neighbor is not available, then set BS for entire first row to zero */
  965|       |        /* Removed reduntant checks */
  966|  1.65M|        if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_y)
  ------------------
  |  Branch (966:13): [True: 1.28M, False: 372k]
  |  Branch (966:62): [True: 137k, False: 1.14M]
  ------------------
  967|  1.49M|                        || (0 == i1_loop_filter_across_slices_enabled_flag && ((slice_idx != top_slice_idx)))
  ------------------
  |  Branch (967:29): [True: 974k, False: 517k]
  |  Branch (967:79): [True: 22.6k, False: 951k]
  ------------------
  968|  1.46M|                        || (0 == ps_bs_ctxt->i4_ctb_y))
  ------------------
  |  Branch (968:28): [True: 217, False: 1.46M]
  ------------------
  969|   161k|        {
  970|   161k|            pu4_horz_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (970:31): [True: 72.2k, False: 89.5k]
  ------------------
  971|   161k|        }
  972|  1.65M|    }
  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.65M|    {
  978|  1.65M|        WORD32 num_rows_remaining = (ps_sps->i2_pic_height_in_luma_samples - (ps_bs_ctxt->i4_ctb_y << log2_ctb_size)) >> 3;
  979|  1.65M|        WORD32 num_cols_remaining = (ps_sps->i2_pic_width_in_luma_samples - (ps_bs_ctxt->i4_ctb_x << log2_ctb_size)) >> 3;
  980|  1.65M|        if(num_rows_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (980:12): [True: 72.2k, False: 1.58M]
  ------------------
  981|  72.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|  72.2k|            WORD32 offset;
  987|  72.2k|            offset = (num_rows_remaining >> (6 - log2_ctb_size)) << 2;
  988|  72.2k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (988:16): [True: 28.5k, False: 43.7k]
  ------------------
  989|  28.5k|                offset += (num_rows_remaining & 1) << (log2_ctb_size - 4);
  990|       |
  991|  72.2k|            memset(((UWORD8 *)pu4_horz_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  992|  72.2k|        }
  993|       |
  994|  1.65M|        if(num_cols_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (994:12): [True: 138k, False: 1.51M]
  ------------------
  995|   138k|        {
  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|   138k|            WORD32 offset;
 1002|   138k|            offset = (num_cols_remaining >> (6 - log2_ctb_size)) << 2;
 1003|   138k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (1003:16): [True: 120k, False: 17.5k]
  ------------------
 1004|   120k|                offset += (num_cols_remaining & 1) << (log2_ctb_size - 4);
 1005|       |
 1006|   138k|            memset(((UWORD8 *)pu4_vert_bs) + offset, 0, 1 << (log2_ctb_size - 4));
 1007|   138k|        }
 1008|  1.65M|    }
 1009|  1.65M|    return 0;
 1010|  1.65M|}

ihevcd_cabac_init:
  142|  81.4k|{
  143|       |    /* Sanity checks */
  144|  81.4k|    ASSERT(ps_cabac != NULL);
  ------------------
  |  |   55|  81.4k|#define ASSERT(x) {}
  ------------------
  145|  81.4k|    ASSERT(ps_bitstrm != NULL);
  ------------------
  |  |   55|  81.4k|#define ASSERT(x) {}
  ------------------
  146|  81.4k|    ASSERT((qp >= 0) && (qp < 52));
  ------------------
  |  |   55|  81.4k|#define ASSERT(x) {}
  ------------------
  147|  81.4k|    ASSERT((cabac_init_idc >= 0) && (cabac_init_idc < 3));
  ------------------
  |  |   55|  81.4k|#define ASSERT(x) {}
  ------------------
  148|  81.4k|    UNUSED(qp);
  ------------------
  |  |   38|  81.4k|#define UNUSED(x) ((void)(x))
  ------------------
  149|  81.4k|    UNUSED(cabac_init_idc);
  ------------------
  |  |   38|  81.4k|#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|  81.4k|#if FULLRANGE
  155|  81.4k|    ps_cabac->u4_range = (UWORD32)510 << RANGE_SHIFT;
  ------------------
  |  |   41|  81.4k|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  81.4k|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  156|  81.4k|    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  81.4k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  81.4k|{                                                               \
  |  |  152|  81.4k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  81.4k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  81.4k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  81.4k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  81.4k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|   162k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 53.9k, False: 27.4k]
  |  |  ------------------
  |  |  156|  81.4k|    {                                                           \
  |  |  157|  53.9k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  53.9k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 53.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  53.9k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  53.9k|    }                                                           \
  |  |  160|  81.4k|                                                                \
  |  |  161|  81.4k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|   162k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 53.9k, False: 27.4k]
  |  |  ------------------
  |  |  162|  81.4k|    {                                                           \
  |  |  163|  53.9k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  53.9k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  53.9k|        /* Getting the next word */                             \
  |  |  166|  53.9k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  53.9k|                                                                \
  |  |  168|  53.9k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  53.9k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  53.9k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  53.9k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  53.9k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  53.9k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  53.9k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  53.9k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  53.9k|    }                                                           \
  |  |  172|  81.4k|}
  ------------------
  157|  81.4k|                    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|  81.4k|    memcpy(ps_cabac->au1_ctxt_models,
  168|  81.4k|           pu1_init_ctxt,
  169|  81.4k|           IHEVC_CAB_CTXT_END);
  170|       |
  171|  81.4k|#ifdef ENABLE_MAIN_REXT_PROFILE
  172|       |    /* golomb rice statistics */
  173|  81.4k|    if(pi4_rice_stat_coeff)
  ------------------
  |  Branch (173:8): [True: 2.11k, False: 79.3k]
  ------------------
  174|  2.11k|    {
  175|  2.11k|        memcpy(ps_cabac->ai4_rice_stat_coeff, pi4_rice_stat_coeff,
  176|  2.11k|               sizeof(ps_cabac->ai4_rice_stat_coeff));
  177|  2.11k|    }
  178|  81.4k|#endif
  179|       |
  180|  81.4k|    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|  81.4k|    if(ps_cabac->u4_ofst >= ps_cabac->u4_range)
  ------------------
  |  Branch (185:8): [True: 1.60k, False: 79.8k]
  ------------------
  186|  1.60k|    {
  187|  1.60k|        return ((IHEVCD_ERROR_T)IHEVCD_FAIL);
  188|  1.60k|    }
  189|       |
  190|  79.8k|    return ((IHEVCD_ERROR_T)IHEVCD_SUCCESS);
  191|  81.4k|}
ihevcd_cabac_reset:
  195|  8.25k|{
  196|       |    /* Sanity checks */
  197|  8.25k|    ASSERT(ps_cabac != NULL);
  ------------------
  |  |   55|  8.25k|#define ASSERT(x) {}
  ------------------
  198|  8.25k|    ASSERT(ps_bitstrm != NULL);
  ------------------
  |  |   55|  8.25k|#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|  8.25k|#if FULLRANGE
  205|  8.25k|    ps_cabac->u4_range = (UWORD32)510 << RANGE_SHIFT;
  ------------------
  |  |   41|  8.25k|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  8.25k|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  206|  8.25k|    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  8.25k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  8.25k|{                                                               \
  |  |  152|  8.25k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  8.25k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  8.25k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  8.25k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  8.25k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  16.5k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 5.16k, False: 3.08k]
  |  |  ------------------
  |  |  156|  8.25k|    {                                                           \
  |  |  157|  5.16k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  5.16k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 5.16k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  5.16k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  5.16k|    }                                                           \
  |  |  160|  8.25k|                                                                \
  |  |  161|  8.25k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  16.5k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 5.16k, False: 3.08k]
  |  |  ------------------
  |  |  162|  8.25k|    {                                                           \
  |  |  163|  5.16k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  5.16k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  5.16k|        /* Getting the next word */                             \
  |  |  166|  5.16k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  5.16k|                                                                \
  |  |  168|  5.16k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  5.16k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  5.16k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  5.16k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  5.16k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  5.16k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  5.16k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  5.16k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  5.16k|    }                                                           \
  |  |  172|  8.25k|}
  ------------------
  207|  8.25k|                    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|  8.25k|    return ((IHEVCD_ERROR_T)IHEVCD_SUCCESS);
  217|  8.25k|}
ihevcd_cabac_decode_bin:
  249|  57.1M|{
  250|  57.1M|    UWORD32 u4_range = ps_cabac->u4_range;
  251|  57.1M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  252|  57.1M|    UWORD32 u4_rlps;
  253|  57.1M|    UWORD32 u4_bin;
  254|  57.1M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];
  255|  57.1M|    WORD32 state_mps = *pu1_ctxt_model;
  256|  57.1M|#if FULLRANGE
  257|  57.1M|    WORD32 clz;
  258|  57.1M|#endif
  259|  57.1M|    UWORD32 u4_qnt_range;
  260|       |
  261|       |    /* Sanity checks */
  262|  57.1M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  57.1M|#define ASSERT(x) {}
  ------------------
  263|  57.1M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));
  ------------------
  |  |   55|  57.1M|#define ASSERT(x) {}
  ------------------
  264|  57.1M|    ASSERT(state_mps < 128);
  ------------------
  |  |   55|  57.1M|#define ASSERT(x) {}
  ------------------
  265|  57.1M|#if FULLRANGE
  266|  57.1M|    clz = CLZ(u4_range);
  267|  57.1M|    clz -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  57.1M|#define RANGE_NUMBITS 31
  ------------------
  268|  57.1M|    u4_qnt_range = u4_range << clz;
  269|  57.1M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;
  ------------------
  |  |   41|  57.1M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  57.1M|#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|  57.1M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];
  275|  57.1M|#if FULLRANGE
  276|  57.1M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);
  ------------------
  |  |   41|  57.1M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  57.1M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  277|  57.1M|#endif
  278|  57.1M|    u4_range -= u4_rlps;
  279|       |
  280|  57.1M|    u4_bin = state_mps & 1;
  281|       |
  282|  57.1M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (282:8): [True: 8.61M, False: 48.5M]
  ------------------
  283|  8.61M|    {
  284|  8.61M|        u4_bin = 1 - u4_bin;
  285|  8.61M|        u4_ofst -= u4_range;
  286|  8.61M|        u4_range = u4_rlps;
  287|  8.61M|    }
  288|       |
  289|  57.1M|    *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|  57.1M|    if(u4_range < (1 << 8))
  ------------------
  |  Branch (294:8): [True: 908k, False: 56.2M]
  ------------------
  295|   908k|    {
  296|   908k|        UWORD32 u4_bits;
  297|   908k|        WORD32 numbits;
  298|   908k|        numbits = CLZ(u4_range);
  299|   908k|        numbits -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|   908k|#define RANGE_NUMBITS 31
  ------------------
  300|       |#if !FULLRANGE
  301|       |        numbits -= RANGE_SHIFT;
  302|       |#endif
  303|   908k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|   908k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   908k|{                                                               \
  |  |  152|   908k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   908k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   908k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   908k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   908k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  1.81M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 633k, False: 275k]
  |  |  ------------------
  |  |  156|   908k|    {                                                           \
  |  |  157|   633k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   633k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 633k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   633k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   633k|    }                                                           \
  |  |  160|   908k|                                                                \
  |  |  161|   908k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  1.81M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 666k, False: 241k]
  |  |  ------------------
  |  |  162|   908k|    {                                                           \
  |  |  163|   666k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   666k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   666k|        /* Getting the next word */                             \
  |  |  166|   666k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   666k|                                                                \
  |  |  168|   666k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   666k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   666k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   666k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   666k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   666k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   666k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   666k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   666k|    }                                                           \
  |  |  172|   908k|}
  ------------------
  304|   908k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);
  305|       |
  306|   908k|        u4_ofst <<= numbits;
  307|   908k|        u4_ofst |= u4_bits;
  308|   908k|        u4_range <<= numbits;
  309|       |
  310|   908k|    }
  311|       |    /* Update the cabac context */
  312|  57.1M|    ps_cabac->u4_range = u4_range;
  313|  57.1M|    ps_cabac->u4_ofst = u4_ofst;
  314|  57.1M|    DEBUG_RANGE_OFST("bin", ps_cabac->u4_range, ps_cabac->u4_ofst);
  315|       |
  316|  57.1M|    return (u4_bin);
  317|       |
  318|       |
  319|  57.1M|}
ihevcd_cabac_decode_bypass_bin:
  341|  1.77M|{
  342|       |
  343|  1.77M|    UWORD32 u4_bin;
  344|  1.77M|    UWORD32 u4_range = ps_cabac->u4_range;
  345|  1.77M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  346|  1.77M|    UWORD32 u4_bits;
  347|       |
  348|       |    /* Sanity checks */
  349|  1.77M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  1.77M|#define ASSERT(x) {}
  ------------------
  350|       |
  351|  1.77M|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  182|  1.77M|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  183|  1.77M|{                                                               \
  |  |  184|  1.77M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  185|  1.77M|                             >> (WORD_SIZE_MINUS1);             \
  |  |  ------------------
  |  |  |  |   51|  1.77M|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.77M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|  1.77M|    m_u4_bit_ofst++;                                            \
  |  |  187|  1.77M|                                                                \
  |  |  188|  1.77M|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  ------------------
  |  |  |  |   42|  3.54M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (188:8): [True: 66.9k, False: 1.70M]
  |  |  ------------------
  |  |  189|  1.77M|    {                                                           \
  |  |  190|  66.9k|        UWORD32 pu4_word_tmp;                                   \
  |  |  191|  66.9k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  192|  66.9k|        /* Getting the next word */                             \
  |  |  193|  66.9k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  194|  66.9k|                                                                \
  |  |  195|  66.9k|        m_u4_bit_ofst = 0;                                      \
  |  |  196|  66.9k|        /* Swapping little endian to big endian conversion*/    \
  |  |  197|  66.9k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  66.9k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  66.9k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  66.9k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  66.9k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  198|  66.9k|    }                                                           \
  |  |  199|  1.77M|}
  ------------------
  352|  1.77M|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);
  353|       |
  354|  1.77M|    u4_ofst <<= 1;
  355|  1.77M|    u4_ofst |= u4_bits;
  356|       |
  357|  1.77M|    u4_bin = 0;
  358|  1.77M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (358:8): [True: 791k, False: 981k]
  ------------------
  359|   791k|    {
  360|   791k|        u4_bin = 1;
  361|   791k|        u4_ofst -= u4_range;
  362|   791k|    }
  363|       |
  364|       |    /* Update the cabac context */
  365|  1.77M|    ps_cabac->u4_ofst = u4_ofst;
  366|  1.77M|    DEBUG_RANGE_OFST("bypass end", ps_cabac->u4_range, ps_cabac->u4_ofst);
  367|  1.77M|    return (u4_bin);
  368|  1.77M|}
ihevcd_cabac_decode_terminate:
  391|  1.17M|{
  392|  1.17M|    UWORD32 u4_range = ps_cabac->u4_range;
  393|  1.17M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  394|  1.17M|    UWORD32 u4_bin;
  395|  1.17M|#if FULLRANGE
  396|  1.17M|    WORD32 clz;
  397|  1.17M|#endif
  398|       |    /* Sanity checks */
  399|  1.17M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  1.17M|#define ASSERT(x) {}
  ------------------
  400|  1.17M|#if FULLRANGE
  401|  1.17M|    clz = CLZ(u4_range);
  402|  1.17M|    clz -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  1.17M|#define RANGE_NUMBITS 31
  ------------------
  403|  1.17M|    u4_range -= 2 << (RANGE_SHIFT - clz);
  ------------------
  |  |   41|  1.17M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  1.17M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  404|       |#else
  405|       |    u4_range -= 2;
  406|       |#endif
  407|       |
  408|  1.17M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (408:8): [True: 11.8k, False: 1.16M]
  ------------------
  409|  11.8k|    {
  410|  11.8k|        u4_bin = 1;
  411|       |
  412|  11.8k|#if FULLRANGE
  413|       |        /* In case of FULLRANGE extra bits read earlier need to pushed back to the bitstream */
  414|  11.8k|        {
  415|  11.8k|            WORD32 clz;
  416|  11.8k|            WORD32 numbits;
  417|  11.8k|            clz = CLZ(ps_cabac->u4_range);
  418|       |
  419|  11.8k|            numbits = (32 - clz);
  420|  11.8k|            numbits -= 9;
  421|       |
  422|  11.8k|            ihevcd_bits_seek(ps_bitstrm, -numbits);
  423|  11.8k|        }
  424|  11.8k|#endif
  425|       |
  426|  11.8k|    }
  427|  1.16M|    else
  428|  1.16M|    {
  429|  1.16M|        u4_bin = 0;
  430|  1.16M|    }
  431|  1.17M|    if(0 == u4_bin)
  ------------------
  |  Branch (431:8): [True: 1.16M, False: 11.8k]
  ------------------
  432|  1.16M|    {
  433|  1.16M|        UWORD32 u4_bits;
  434|  1.16M|        WORD32 numbits;
  435|  1.16M|        numbits = CLZ(u4_range);
  436|  1.16M|        numbits -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  1.16M|#define RANGE_NUMBITS 31
  ------------------
  437|       |#if !FULLRANGE
  438|       |        numbits -= RANGE_SHIFT;
  439|       |#endif
  440|       |        /* Renormalize if required */
  441|  1.16M|        if(numbits)
  ------------------
  |  Branch (441:12): [True: 951k, False: 213k]
  ------------------
  442|   951k|        {
  443|   951k|            BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|   951k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   951k|{                                                               \
  |  |  152|   951k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   951k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   951k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   951k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   951k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  1.90M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 232k, False: 719k]
  |  |  ------------------
  |  |  156|   951k|    {                                                           \
  |  |  157|   232k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   232k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 232k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   232k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   232k|    }                                                           \
  |  |  160|   951k|                                                                \
  |  |  161|   951k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  1.90M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 263k, False: 687k]
  |  |  ------------------
  |  |  162|   951k|    {                                                           \
  |  |  163|   263k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   263k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   263k|        /* Getting the next word */                             \
  |  |  166|   263k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   263k|                                                                \
  |  |  168|   263k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   263k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   263k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   263k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   263k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   263k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   263k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   263k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   263k|    }                                                           \
  |  |  172|   951k|}
  ------------------
  444|   951k|                     ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);
  445|       |
  446|   951k|            u4_ofst <<= numbits;
  447|   951k|            u4_ofst |= u4_bits;
  448|   951k|            u4_range <<= numbits;
  449|   951k|        }
  450|  1.16M|    }
  451|       |    /* bits to be inserted in the bitstream */
  452|  1.17M|    ps_cabac->u4_range = u4_range;
  453|  1.17M|    ps_cabac->u4_ofst = u4_ofst;
  454|  1.17M|    DEBUG_RANGE_OFST("term", ps_cabac->u4_range, ps_cabac->u4_ofst);
  455|       |
  456|  1.17M|    return (u4_bin);
  457|  1.17M|}
ihevcd_cabac_decode_bypass_bins:
  486|  6.26M|{
  487|  6.26M|    UWORD32 u4_bins;
  488|       |
  489|       |
  490|  6.26M|    UWORD32 u4_range = ps_cabac->u4_range;
  491|  6.26M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  492|  6.26M|    UWORD32 u4_bits;
  493|  6.26M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  6.26M|#define ASSERT(x) {}
  ------------------
  494|  6.26M|    ASSERT(numbins > 0);
  ------------------
  |  |   55|  6.26M|#define ASSERT(x) {}
  ------------------
  495|       |
  496|       |    /* Sanity checks */
  497|  6.26M|    ASSERT(numbins < 17);
  ------------------
  |  |   55|  6.26M|#define ASSERT(x) {}
  ------------------
  498|       |
  499|  6.26M|    u4_bins = 0;
  500|       |
  501|  6.26M|    BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  6.26M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  6.26M|{                                                               \
  |  |  152|  6.26M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  6.26M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  6.26M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  6.26M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  6.26M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  12.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 438k, False: 5.82M]
  |  |  ------------------
  |  |  156|  6.26M|    {                                                           \
  |  |  157|   438k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   438k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 438k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   438k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   438k|    }                                                           \
  |  |  160|  6.26M|                                                                \
  |  |  161|  6.26M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  12.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 626k, False: 5.63M]
  |  |  ------------------
  |  |  162|  6.26M|    {                                                           \
  |  |  163|   626k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   626k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   626k|        /* Getting the next word */                             \
  |  |  166|   626k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   626k|                                                                \
  |  |  168|   626k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   626k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   626k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   626k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   626k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   626k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   626k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   626k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   626k|    }                                                           \
  |  |  172|  6.26M|}
  ------------------
  502|  6.26M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins);
  503|       |
  504|  6.26M|    do
  505|  19.9M|    {
  506|  19.9M|        UWORD32 u4_bit;
  507|  19.9M|        numbins--;
  508|  19.9M|        u4_bit = (u4_bits >> numbins) & 1;
  509|  19.9M|        u4_ofst <<= 1;
  510|  19.9M|        u4_ofst |= u4_bit;
  511|       |
  512|  19.9M|        u4_bins <<= 1;
  513|  19.9M|        if(u4_ofst >= u4_range)
  ------------------
  |  Branch (513:12): [True: 6.20M, False: 13.7M]
  ------------------
  514|  6.20M|        {
  515|  6.20M|            u4_bins += 1;
  516|  6.20M|            u4_ofst -= u4_range;
  517|  6.20M|        }
  518|  19.9M|    }while(numbins);
  ------------------
  |  Branch (518:12): [True: 13.7M, False: 6.26M]
  ------------------
  519|       |
  520|       |    /* Update the cabac context */
  521|  6.26M|    ps_cabac->u4_ofst = u4_ofst;
  522|  6.26M|    DEBUG_RANGE_OFST("bypass", ps_cabac->u4_range, ps_cabac->u4_ofst);
  523|  6.26M|    return (u4_bins);
  524|  6.26M|}
ihevcd_cabac_decode_bins_tunary:
  571|  21.4M|{
  572|  21.4M|    UWORD32 u4_sym;
  573|  21.4M|    WORD32 bin;
  574|       |
  575|       |    /* Sanity checks */
  576|  21.4M|    ASSERT(c_max > 0);
  ------------------
  |  |   55|  21.4M|#define ASSERT(x) {}
  ------------------
  577|  21.4M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));
  ------------------
  |  |   55|  21.4M|#define ASSERT(x) {}
  ------------------
  578|  21.4M|    ASSERT((ctxt_index + (c_max >> ctxt_shift)) < IHEVC_CAB_CTXT_END);
  ------------------
  |  |   55|  21.4M|#define ASSERT(x) {}
  ------------------
  579|       |
  580|  21.4M|    u4_sym = 0;
  581|  21.4M|    do
  582|  47.4M|    {
  583|  47.4M|        WORD32 bin_index;
  584|  47.4M|        bin_index = ctxt_index + MIN((u4_sym >> ctxt_shift), (UWORD32)ctxt_inc_max);
  ------------------
  |  |   43|  47.4M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 46.8M, False: 570k]
  |  |  ------------------
  ------------------
  585|  47.4M|        IHEVCD_CABAC_DECODE_BIN(bin, ps_cabac, ps_bitstrm,  bin_index);
  ------------------
  |  |   59|  47.4M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  47.4M|{                                                                               \
  |  |   61|  47.4M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  47.4M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  47.4M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  47.4M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  47.4M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  47.4M|    WORD32 clz;                                                                 \
  |  |   67|  47.4M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  47.4M|                                                                                \
  |  |   69|  47.4M|    /* Sanity checks */                                                         \
  |  |   70|  47.4M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  47.4M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  47.4M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  47.4M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  47.4M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  47.4M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  47.4M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  47.4M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  47.4M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  47.4M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  47.4M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  47.4M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  47.4M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  47.4M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  47.4M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  47.4M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  47.4M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  47.4M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  47.4M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  47.4M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  47.4M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  47.4M|                                                                                \
  |  |   83|  47.4M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  47.4M|                                                                                \
  |  |   85|  47.4M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 6.06M, False: 41.3M]
  |  |  ------------------
  |  |   86|  47.4M|    {                                                                           \
  |  |   87|  6.06M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  6.06M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  6.06M|        u4_range = u4_rlps;                                                     \
  |  |   90|  6.06M|    }                                                                           \
  |  |   91|  47.4M|                                                                                \
  |  |   92|  47.4M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  47.4M|                                                                                \
  |  |   94|  47.4M|    /*****************************************************************/         \
  |  |   95|  47.4M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  47.4M|    /*****************************************************************/         \
  |  |   97|  47.4M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 759k, False: 46.6M]
  |  |  ------------------
  |  |   98|  47.4M|    {                                                                           \
  |  |   99|   759k|        UWORD32 u4_bits;                                                        \
  |  |  100|   759k|        WORD32 numbits;                                                         \
  |  |  101|   759k|        numbits = CLZ(u4_range);                                                \
  |  |  102|   759k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|   759k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|   759k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   759k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   759k|{                                                               \
  |  |  |  |  152|   759k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   759k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   759k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   759k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   759k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.51M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 526k, False: 233k]
  |  |  |  |  ------------------
  |  |  |  |  156|   759k|    {                                                           \
  |  |  |  |  157|   526k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   526k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 526k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   526k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   526k|    }                                                           \
  |  |  |  |  160|   759k|                                                                \
  |  |  |  |  161|   759k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.51M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 550k, False: 209k]
  |  |  |  |  ------------------
  |  |  |  |  162|   759k|    {                                                           \
  |  |  |  |  163|   550k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   550k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   550k|        /* Getting the next word */                             \
  |  |  |  |  166|   550k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   550k|                                                                \
  |  |  |  |  168|   550k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   550k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   550k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   550k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   550k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   550k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   550k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   550k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   550k|    }                                                           \
  |  |  |  |  172|   759k|}
  |  |  ------------------
  |  |  104|   759k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|   759k|                                                                                \
  |  |  106|   759k|        u4_ofst <<= numbits;                                                    \
  |  |  107|   759k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|   759k|        u4_range <<= numbits;                                                   \
  |  |  109|   759k|                                                                                \
  |  |  110|   759k|    }                                                                           \
  |  |  111|  47.4M|    /* Update the cabac context */                                              \
  |  |  112|  47.4M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  47.4M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  47.4M|                                                                                \
  |  |  115|  47.4M|}
  ------------------
  586|  47.4M|        u4_sym++;
  587|  47.4M|    }while(((WORD32)u4_sym < c_max) && bin);
  ------------------
  |  Branch (587:12): [True: 42.0M, False: 5.41M]
  |  Branch (587:40): [True: 26.0M, False: 16.0M]
  ------------------
  588|       |
  589|  21.4M|    u4_sym = u4_sym - 1 + bin;
  590|       |
  591|  21.4M|    return (u4_sym);
  592|  21.4M|}
ihevcd_cabac_decode_bypass_bins_tunary:
  621|  6.28M|{
  622|       |
  623|  6.28M|    UWORD32 u4_sym;
  624|  6.28M|    WORD32 bin;
  625|  6.28M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  626|  6.28M|    UWORD32 u4_range = ps_cabac->u4_range;
  627|  6.28M|    UWORD32 u4_bits;
  628|       |    /* Sanity checks */
  629|  6.28M|    ASSERT(c_max > 0);
  ------------------
  |  |   55|  6.28M|#define ASSERT(x) {}
  ------------------
  630|  6.28M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  6.28M|#define ASSERT(x) {}
  ------------------
  631|  6.28M|    u4_sym = 0;
  632|  6.28M|    BITS_NXT(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |   91|  6.28M|                 m_u4_cur_word, m_u4_nxt_word, m_cnt)       \
  |  |   92|  6.28M|{                                                           \
  |  |   93|  6.28M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)  >>        \
  |  |   94|  6.28M|                              (WORD_SIZE - m_cnt);          \
  |  |  ------------------
  |  |  |  |   42|  6.28M|#define WORD_SIZE         32
  |  |  ------------------
  |  |   95|  6.28M|                                                            \
  |  |   96|  6.28M|    if(m_u4_bit_ofst > (WORD_SIZE - m_cnt))                 \
  |  |  ------------------
  |  |  |  |   42|  6.28M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (96:8): [True: 1.68M, False: 4.60M]
  |  |  ------------------
  |  |   97|  6.28M|    {                                                       \
  |  |   98|  1.68M|        m_u4_bits |= SHR(m_u4_nxt_word,                     \
  |  |  ------------------
  |  |  |  |   57|  1.68M|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 1.68M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   99|  1.68M|                   (WORD_SIZE + WORD_SIZE - m_cnt           \
  |  |  100|  1.68M|                          - m_u4_bit_ofst));                \
  |  |  101|  1.68M|    }                                                       \
  |  |  102|  6.28M|}
  ------------------
  633|  6.28M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, (UWORD32)c_max);
  634|  6.28M|    u4_bits <<= (32 - c_max);
  635|  6.28M|    do
  636|  9.84M|    {
  637|  9.84M|        u4_ofst <<= 1;
  638|  9.84M|        u4_ofst |= (u4_bits >> 31);
  639|  9.84M|        u4_bits <<= 1;
  640|       |
  641|  9.84M|        bin = 0;
  642|  9.84M|        if(u4_ofst >= u4_range)
  ------------------
  |  Branch (642:12): [True: 4.24M, False: 5.59M]
  ------------------
  643|  4.24M|        {
  644|  4.24M|            bin = 1;
  645|  4.24M|            u4_ofst -= u4_range;
  646|  4.24M|        }
  647|  9.84M|        u4_sym++;
  648|  9.84M|    }while(((WORD32)u4_sym < c_max) && bin);
  ------------------
  |  Branch (648:12): [True: 8.46M, False: 1.37M]
  |  Branch (648:40): [True: 3.55M, False: 4.91M]
  ------------------
  649|  6.28M|    BITS_FLUSH(ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  127|  6.28M|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  6.28M|{                                                           \
  |  |  129|  6.28M|    UWORD32 temp;                                           \
  |  |  130|  6.28M|                                                            \
  |  |  131|  6.28M|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  6.28M|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  12.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 299k, False: 5.98M]
  |  |  ------------------
  |  |  133|  6.28M|    {                                                       \
  |  |  134|   299k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|   299k|        /* Getting the next word */                         \
  |  |  136|   299k|        temp = *(m_pu4_buf++);                              \
  |  |  137|   299k|                                                            \
  |  |  138|   299k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|   299k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|   299k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|   299k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|   299k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   299k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   299k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   299k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|   299k|    }                                                       \
  |  |  142|  6.28M|}
  ------------------
  650|  6.28M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, u4_sym);
  651|       |
  652|  6.28M|    u4_sym = u4_sym - 1 + bin;
  653|       |    /* Update the cabac context */
  654|  6.28M|    ps_cabac->u4_ofst = u4_ofst;
  655|       |
  656|  6.28M|    return (u4_sym);
  657|  6.28M|}
ihevcd_cabac_decode_bypass_bins_egk:
  684|   345k|{
  685|       |
  686|   345k|    UWORD32 u4_sym;
  687|   345k|    WORD32 numones;
  688|   345k|    WORD32 bin;
  689|       |
  690|       |    /* Sanity checks */
  691|   345k|    ASSERT((k >= 0));
  ------------------
  |  |   55|   345k|#define ASSERT(x) {}
  ------------------
  692|       |
  693|   345k|    numones = k;
  694|   345k|    bin = 1;
  695|   345k|    u4_sym = 0;
  696|   965k|    while(bin && (numones <= 16))
  ------------------
  |  Branch (696:11): [True: 620k, False: 345k]
  |  Branch (696:18): [True: 620k, False: 147]
  ------------------
  697|   620k|    {
  698|   620k|        IHEVCD_CABAC_DECODE_BYPASS_BIN(bin, ps_cabac, ps_bitstrm);
  ------------------
  |  |  122|   620k|#define IHEVCD_CABAC_DECODE_BYPASS_BIN(u4_bin, ps_cabac, ps_bitstrm)            \
  |  |  123|   620k|{                                                                               \
  |  |  124|   620k|                                                                                \
  |  |  125|   620k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  126|   620k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  127|   620k|    UWORD32 u4_bits;                                                            \
  |  |  128|   620k|                                                                                \
  |  |  129|   620k|    /* Sanity checks */                                                         \
  |  |  130|   620k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   620k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  131|   620k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   620k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  132|   620k|                                                                                \
  |  |  133|   620k|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,              \
  |  |  ------------------
  |  |  |  |  182|   620k|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  |  |  183|   620k|{                                                               \
  |  |  |  |  184|   620k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  185|   620k|                             >> (WORD_SIZE_MINUS1);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|   620k|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|   620k|#define WORD_SIZE         32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  186|   620k|    m_u4_bit_ofst++;                                            \
  |  |  |  |  187|   620k|                                                                \
  |  |  |  |  188|   620k|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.24M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (188:8): [True: 18.9k, False: 601k]
  |  |  |  |  ------------------
  |  |  |  |  189|   620k|    {                                                           \
  |  |  |  |  190|  18.9k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  191|  18.9k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  192|  18.9k|        /* Getting the next word */                             \
  |  |  |  |  193|  18.9k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  |  |  194|  18.9k|                                                                \
  |  |  |  |  195|  18.9k|        m_u4_bit_ofst = 0;                                      \
  |  |  |  |  196|  18.9k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  197|  18.9k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  18.9k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  18.9k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  18.9k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  18.9k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  198|  18.9k|    }                                                           \
  |  |  |  |  199|   620k|}
  |  |  ------------------
  |  |  134|   620k|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);                  \
  |  |  135|   620k|                                                                                \
  |  |  136|   620k|    u4_ofst <<= 1;                                                              \
  |  |  137|   620k|    u4_ofst |= u4_bits;                                                         \
  |  |  138|   620k|                                                                                \
  |  |  139|   620k|    u4_bin = 0;                                                                 \
  |  |  140|   620k|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 274k, False: 345k]
  |  |  ------------------
  |  |  141|   620k|    {                                                                           \
  |  |  142|   274k|        u4_bin = 1;                                                             \
  |  |  143|   274k|        u4_ofst -= u4_range;                                                    \
  |  |  144|   274k|    }                                                                           \
  |  |  145|   620k|                                                                                \
  |  |  146|   620k|    /* Update the cabac context */                                              \
  |  |  147|   620k|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  148|   620k|}
  ------------------
  699|   620k|        u4_sym += bin << numones++;
  700|   620k|    }
  701|       |
  702|   345k|    numones -= 1;
  703|       |
  704|   345k|    if(numones)
  ------------------
  |  Branch (704:8): [True: 275k, False: 70.0k]
  ------------------
  705|   275k|    {
  706|   275k|        UWORD32 u4_suffix;
  707|       |
  708|   275k|        IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, numones);
  ------------------
  |  |  156|   275k|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|   275k|{                                                                               \
  |  |  158|   275k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|   275k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|   275k|    UWORD32 u4_bits;                                                            \
  |  |  161|   275k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   275k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|   275k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   275k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|   275k|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|   275k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|   275k|    {                                                                           \
  |  |  165|   275k|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|   275k|        /* Sanity checks */                                                     \
  |  |  167|   275k|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|   275k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|   275k|                                                                                \
  |  |  169|   275k|        u4_bins = 0;                                                            \
  |  |  170|   275k|                                                                                \
  |  |  171|   275k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   275k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   275k|{                                                               \
  |  |  |  |  152|   275k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   275k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   275k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   275k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   275k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   550k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 8.20k, False: 267k]
  |  |  |  |  ------------------
  |  |  |  |  156|   275k|    {                                                           \
  |  |  |  |  157|  8.20k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  8.20k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 8.20k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  8.20k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  8.20k|    }                                                           \
  |  |  |  |  160|   275k|                                                                \
  |  |  |  |  161|   275k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   550k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 16.1k, False: 259k]
  |  |  |  |  ------------------
  |  |  |  |  162|   275k|    {                                                           \
  |  |  |  |  163|  16.1k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  16.1k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  16.1k|        /* Getting the next word */                             \
  |  |  |  |  166|  16.1k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  16.1k|                                                                \
  |  |  |  |  168|  16.1k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  16.1k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  16.1k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  16.1k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  16.1k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  16.1k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  16.1k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  16.1k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  16.1k|    }                                                           \
  |  |  |  |  172|   275k|}
  |  |  ------------------
  |  |  172|   275k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|   275k|        do                                                                      \
  |  |  174|   543k|        {                                                                       \
  |  |  175|   543k|            UWORD32 u4_bit;                                                     \
  |  |  176|   543k|            numbins_tmp--;                                                      \
  |  |  177|   543k|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|   543k|            u4_ofst <<= 1;                                                      \
  |  |  179|   543k|            u4_ofst |= u4_bit;                                                  \
  |  |  180|   543k|                                                                                \
  |  |  181|   543k|            u4_bins <<= 1;                                                      \
  |  |  182|   543k|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 267k, False: 275k]
  |  |  ------------------
  |  |  183|   543k|            {                                                                   \
  |  |  184|   267k|                u4_bins += 1;                                                   \
  |  |  185|   267k|                u4_ofst -= u4_range;                                            \
  |  |  186|   267k|            }                                                                   \
  |  |  187|   543k|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 268k, False: 275k]
  |  |  ------------------
  |  |  188|   275k|                                                                                \
  |  |  189|   275k|        /* Update the cabac context */                                          \
  |  |  190|   275k|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|   275k|    }                                                                           \
  |  |  192|   275k|}
  ------------------
  709|   275k|        u4_sym += u4_suffix;
  710|   275k|    }
  711|   345k|    return (u4_sym);
  712|   345k|}

ihevcd_deblk_ctb:
  100|  23.7M|{
  101|  23.7M|    WORD32 ctb_size;
  102|  23.7M|    WORD32 log2_ctb_size;
  103|  23.7M|    UWORD32 u4_bs;
  104|  23.7M|    WORD32 bs_tz; /*Leading zeros in boundary strength*/
  105|  23.7M|    WORD32 qp_p, qp_q;
  106|       |
  107|  23.7M|    WORD32 filter_p, filter_q;
  108|       |
  109|  23.7M|    UWORD8 *pu1_src;
  110|  23.7M|    WORD32 qp_strd;
  111|  23.7M|    UWORD32 *pu4_vert_bs, *pu4_horz_bs;
  112|  23.7M|    UWORD32 *pu4_ctb_vert_bs, *pu4_ctb_horz_bs;
  113|  23.7M|    WORD32 bs_strd;
  114|  23.7M|    WORD32 src_strd, chroma_strd;
  115|  23.7M|    WORD8 *pi1_qp;
  116|  23.7M|    UWORD16 *pu2_ctb_no_loop_filter_flag;
  117|  23.7M|    UWORD16 au2_ctb_no_loop_filter_flag[9];
  118|  23.7M|    WORD32 pixel_size_y, pixel_size_uv;
  119|  23.7M|    UWORD8 u1_bit_depth_luma, u1_bit_depth_chroma;
  120|       |
  121|  23.7M|    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|  23.7M|    UWORD32 u4_qp_const_in_ctb[4] = { 0, 0, 0, 0 };
  126|  23.7M|    WORD32 ctb_indx;
  127|  23.7M|    WORD32  chroma_yuv420sp_vu = ps_deblk->is_chroma_yuv420sp_vu;
  128|  23.7M|    sps_t *ps_sps;
  129|  23.7M|    pps_t *ps_pps;
  130|  23.7M|    codec_t *ps_codec;
  131|  23.7M|    slice_header_t *ps_slice_hdr;
  132|       |
  133|  23.7M|    ihevc_deblk_chroma_horz_ft *pf_deblk_chroma_horz;
  134|  23.7M|    ihevc_deblk_chroma_vert_ft *pf_deblk_chroma_vert;
  135|  23.7M|    ihevc_hbd_deblk_chroma_horz_ft *pf_hbd_deblk_chroma_horz;
  136|  23.7M|    ihevc_hbd_deblk_chroma_vert_ft *pf_hbd_deblk_chroma_vert;
  137|       |
  138|  23.7M|    PROFILE_DISABLE_DEBLK();
  ------------------
  |  |   57|  23.7M|#define PROFILE_DISABLE_DEBLK() ;
  ------------------
  139|       |
  140|  23.7M|    ps_sps = ps_deblk->ps_sps;
  141|  23.7M|    ps_pps = ps_deblk->ps_pps;
  142|  23.7M|    ps_codec = ps_deblk->ps_codec;
  143|  23.7M|    ps_slice_hdr = ps_deblk->ps_slice_hdr;
  144|       |
  145|  23.7M|    WORD32 is_yuv422 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 ? 1 : 0;
  ------------------
  |  Branch (145:24): [True: 1.37M, False: 22.4M]
  ------------------
  146|  23.7M|    WORD32 is_yuv444 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 1 : 0;
  ------------------
  |  Branch (146:24): [True: 0, False: 23.7M]
  ------------------
  147|  23.7M|    WORD32 h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (147:28): [True: 0, False: 23.7M]
  ------------------
  148|  23.7M|    WORD32 v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (148:28): [True: 22.3M, False: 1.44M]
  ------------------
  149|  23.7M|    WORD32 chroma_pixel_strd = 2;
  150|       |
  151|  23.7M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  152|  23.7M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  153|  23.7M|    pixel_size_y     = ps_codec->i4_pixel_size_y;
  154|  23.7M|    pixel_size_uv    = ps_codec->i4_pixel_size_uv;
  155|  23.7M|    u1_bit_depth_luma   = (UWORD8)ps_codec->i4_bit_depth_luma;
  156|  23.7M|    u1_bit_depth_chroma = (UWORD8)ps_codec->i4_bit_depth_chroma;
  157|       |
  158|       |
  159|  23.7M|    if(is_yuv422)
  ------------------
  |  Branch (159:8): [True: 1.37M, False: 22.4M]
  ------------------
  160|  1.37M|    {
  161|  1.37M|        pf_deblk_chroma_horz = ps_codec->s_func_selector.ihevc_deblk_422chroma_horz_fptr;
  162|  1.37M|        pf_deblk_chroma_vert = ps_codec->s_func_selector.ihevc_deblk_422chroma_vert_fptr;
  163|  1.37M|    }
  164|  22.4M|    else
  165|  22.4M|    {
  166|  22.4M|        pf_deblk_chroma_horz = ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr;
  167|  22.4M|        pf_deblk_chroma_vert = ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr;
  168|  22.4M|    }
  169|       |
  170|  23.7M|    pf_hbd_deblk_chroma_horz = ps_codec->s_func_selector.ihevc_hbd_deblk_chroma_horz_fptr;
  171|  23.7M|    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|  23.7M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  176|       |
  177|  23.7M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_deblk->s_bs_ctxt.pu4_pic_vert_bs +
  178|  23.7M|                    (ps_deblk->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  179|  23.7M|                    ps_deblk->i4_ctb_y * bs_strd);
  180|  23.7M|    pu4_ctb_vert_bs = pu4_vert_bs;
  181|       |
  182|  23.7M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_deblk->s_bs_ctxt.pu4_pic_horz_bs +
  183|  23.7M|                    (ps_deblk->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  184|  23.7M|                    ps_deblk->i4_ctb_y * bs_strd);
  185|  23.7M|    pu4_ctb_horz_bs = pu4_horz_bs;
  186|       |
  187|  23.7M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  188|  23.7M|    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|  23.7M|    pu2_ctb_no_loop_filter_flag = ps_deblk->au2_ctb_no_loop_filter_flag;
  191|       |
  192|  23.7M|    ctb_indx = ps_deblk->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_deblk->i4_ctb_y;
  193|  23.7M|    if(i4_is_last_ctb_y)
  ------------------
  |  Branch (193:8): [True: 99.4k, False: 23.6M]
  ------------------
  194|  99.4k|    {
  195|  99.4k|        pu4_vert_bs = (UWORD32 *)((UWORD8 *)pu4_vert_bs + bs_strd);
  196|  99.4k|        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|  99.4k|        memset(pu4_vert_bs, 0, 1 << (2 * log2_ctb_size - 7));
  202|       |
  203|  99.4k|        pi1_qp += (qp_strd << (log2_ctb_size - 3));
  204|  99.4k|        pu2_ctb_no_loop_filter_flag += (ctb_size >> 3);
  205|  99.4k|        ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  206|  99.4k|    }
  207|       |
  208|  23.7M|    if(i4_is_last_ctb_x)
  ------------------
  |  Branch (208:8): [True: 228k, False: 23.5M]
  ------------------
  209|   228k|    {
  210|   228k|        pu4_horz_bs = (UWORD32 *)((UWORD8 *)pu4_horz_bs + (1 << (2 * log2_ctb_size - 7)));
  211|   228k|        pu4_ctb_horz_bs = pu4_horz_bs;
  212|   228k|        memset(pu4_horz_bs, 0, 1 << (2 * log2_ctb_size - 7));
  213|       |
  214|   228k|        pi1_qp += (ctb_size >> 3);
  215|       |
  216|  1.76M|        for(row = 0; row < (ctb_size >> 3) + 1; row++)
  ------------------
  |  Branch (216:22): [True: 1.53M, False: 228k]
  ------------------
  217|  1.53M|            au2_ctb_no_loop_filter_flag[row] = ps_deblk->au2_ctb_no_loop_filter_flag[row] >> (ctb_size >> 3);
  218|   228k|        pu2_ctb_no_loop_filter_flag = au2_ctb_no_loop_filter_flag;
  219|   228k|        ctb_indx += 1;
  220|   228k|    }
  221|       |
  222|  23.7M|    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|  23.7M|    if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (224:8): [True: 22.7M, False: 1.07M]
  |  Branch (224:30): [True: 84.6k, False: 989k]
  ------------------
  225|  22.7M|    {
  226|  22.7M|        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|  22.7M|    }
  228|       |
  229|  23.7M|    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: 22.7M, False: 1.07M]
  |  Branch (229:31): [True: 84.6k, False: 989k]
  |  Branch (229:53): [True: 21.8M, False: 918k]
  |  Branch (229:75): [True: 6.95k, False: 911k]
  ------------------
  230|  21.8M|    {
  231|  21.8M|        u4_qp_const_in_ctb[0] =
  232|  21.8M|                        ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx - ps_sps->i2_pic_wd_in_ctb - 1) >> 3] &
  233|  21.8M|                        (1 << ((ctb_indx - ps_sps->i2_pic_wd_in_ctb - 1) & 7));
  234|  21.8M|    }
  235|       |
  236|       |
  237|       |
  238|  23.7M|    if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (238:8): [True: 22.8M, False: 993k]
  |  Branch (238:30): [True: 8.66k, False: 984k]
  ------------------
  239|  22.7M|    {
  240|  22.7M|        u4_qp_const_in_ctb[1] =
  241|  22.7M|                        ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx - ps_sps->i2_pic_wd_in_ctb) >> 3] &
  242|  22.7M|                        (1 << ((ctb_indx - ps_sps->i2_pic_wd_in_ctb) & 7));
  243|  22.7M|    }
  244|       |
  245|  23.7M|    src_strd = ps_codec->i4_strd;
  246|  23.7M|    chroma_strd = src_strd * chroma_pixel_strd / h_samp_factor;
  247|       |
  248|       |    /* Luma Vertical Edge */
  249|       |
  250|  23.7M|    if(0 == i4_is_last_ctb_x)
  ------------------
  |  Branch (250:8): [True: 23.5M, False: 279k]
  ------------------
  251|  23.5M|    {
  252|       |        /* Top CTB's slice header */
  253|  23.5M|        slice_header_t *ps_slice_hdr_top;
  254|  23.5M|        {
  255|  23.5M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  256|  23.5M|            if(i4_is_last_ctb_y)
  ------------------
  |  Branch (256:16): [True: 99.4k, False: 23.4M]
  ------------------
  257|  99.4k|                cur_ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  258|  23.5M|            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|  23.5M|        }
  260|       |
  261|  23.5M|        pu1_src = ps_deblk->pu1_cur_pic_luma +
  262|  23.5M|            ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_codec->i4_strd) << (log2_ctb_size)) * pixel_size_y;
  263|  23.5M|        pu1_src += i4_is_last_ctb_y ? ((ps_codec->i4_strd << log2_ctb_size) * pixel_size_y) : 0;
  ------------------
  |  Branch (263:20): [True: 99.4k, False: 23.4M]
  ------------------
  264|       |
  265|       |        /** Deblocking is done on a shifted CTB -
  266|       |         *  Vertical edge processing is done by shifting the CTB up by four pixels */
  267|  23.5M|        pu1_src -= 4 * src_strd * pixel_size_y;
  268|       |
  269|   106M|        for(col = 0; col < ctb_size / 8; col++)
  ------------------
  |  Branch (269:22): [True: 82.9M, False: 23.5M]
  ------------------
  270|  82.9M|        {
  271|  82.9M|            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|  82.9M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (278:16): [True: 48.8M, False: 34.0M]
  ------------------
  279|  48.8M|                shift = (col & 1) << (log2_ctb_size - 1);
  280|       |
  281|       |            /* BS for the column - Last row is excluded and the top row is included*/
  282|  82.9M|            u4_bs = (pu4_vert_bs[0] >> shift) << 2;
  283|       |
  284|  82.9M|            if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (284:16): [True: 77.2M, False: 5.64M]
  |  Branch (284:38): [True: 22.8k, False: 5.62M]
  ------------------
  285|  77.4M|            {
  286|       |                /* Picking the last BS of the previous CTB corresponding to the same column */
  287|  77.4M|                UWORD32 *pu4_vert_bs_top = (UWORD32 *)((UWORD8 *)pu4_vert_bs - bs_strd);
  288|  77.4M|                UWORD32 u4_top_bs = (*pu4_vert_bs_top) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  289|  77.4M|                u4_bs |= u4_top_bs & 3;
  290|  77.4M|            }
  291|       |
  292|   319M|            for(row = 0; row < ctb_size / 4;)
  ------------------
  |  Branch (292:26): [True: 237M, False: 82.9M]
  ------------------
  293|   237M|            {
  294|   237M|                WORD8 i1_beta_offset_div2 = ps_slice_hdr->i1_beta_offset_div2;
  295|   237M|                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|   237M|                bs_tz = CTZ(u4_bs) >> 1;
  299|   237M|                if(0 != bs_tz)
  ------------------
  |  Branch (299:20): [True: 93.5M, False: 143M]
  ------------------
  300|  93.5M|                {
  301|  93.5M|                    u4_bs = u4_bs >> (bs_tz << 1);
  302|  93.5M|                    if((row + bs_tz) >= (ctb_size / 4))
  ------------------
  |  Branch (302:24): [True: 67.9M, False: 25.5M]
  ------------------
  303|  67.9M|                        pu1_src += 4 * (ctb_size / 4 - row) * src_strd * pixel_size_y;
  304|  25.5M|                    else
  305|  25.5M|                        pu1_src += 4 * bs_tz  * src_strd * pixel_size_y;
  306|       |
  307|  93.5M|                    row += bs_tz;
  308|  93.5M|                    continue;
  309|  93.5M|                }
  310|       |
  311|   143M|                if(0 == row)
  ------------------
  |  Branch (311:20): [True: 14.9M, False: 128M]
  ------------------
  312|  14.9M|                {
  313|  14.9M|                    i1_beta_offset_div2 = ps_slice_hdr_top->i1_beta_offset_div2;
  314|  14.9M|                    i1_tc_offset_div2 = ps_slice_hdr_top->i1_tc_offset_div2;
  315|       |
  316|  14.9M|                    if(0 == col)
  ------------------
  |  Branch (316:24): [True: 4.07M, False: 10.9M]
  ------------------
  317|  4.07M|                    {
  318|  4.07M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (318:32): [True: 4.00M, False: 66.4k]
  ------------------
  319|  4.00M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  320|  4.07M|                                        pi1_qp[-qp_strd - 1];
  321|  4.07M|                    }
  322|  10.9M|                    else
  323|  10.9M|                    {
  324|  10.9M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (324:32): [True: 10.9M, False: 18.4E]
  ------------------
  325|  10.9M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  326|  18.4E|                                        pi1_qp[col - 1 - qp_strd];
  327|  10.9M|                    }
  328|       |
  329|  14.9M|                    qp_q = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (329:28): [True: 14.7M, False: 237k]
  ------------------
  330|  14.7M|                                    pi1_qp[-ctb_size / 8 * qp_strd] :
  331|  14.9M|                                    pi1_qp[col - qp_strd];
  332|  14.9M|                }
  333|   128M|                else
  334|   128M|                {
  335|   128M|                    if(0 == col)
  ------------------
  |  Branch (335:24): [True: 31.7M, False: 96.8M]
  ------------------
  336|  31.7M|                    {
  337|  31.7M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (337:32): [True: 30.8M, False: 918k]
  ------------------
  338|  30.8M|                                        pi1_qp[-ctb_size / 8] :
  339|  31.7M|                                        pi1_qp[((row - 1) >> 1) * qp_strd - 1];
  340|  31.7M|                    }
  341|  96.8M|                    else
  342|  96.8M|                    {
  343|  96.8M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (343:32): [True: 109M, False: 18.4E]
  ------------------
  344|   109M|                                        pi1_qp[0] :
  345|  18.4E|                                        pi1_qp[((row - 1) >> 1) * qp_strd + col - 1];
  346|  96.8M|                    }
  347|       |
  348|   128M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (348:28): [True: 132M, False: 18.4E]
  ------------------
  349|   132M|                                    pi1_qp[0] :
  350|  18.4E|                                    pi1_qp[((row - 1) >> 1) * qp_strd + col];
  351|   128M|                }
  352|       |
  353|   143M|                filter_p = (pu2_ctb_no_loop_filter_flag[(row + 1) >> 1] >> col) & 1;
  354|   143M|                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|   143M|                filter_p = !filter_p;
  357|   143M|                filter_q = !filter_q;
  358|       |
  359|   143M|                if(filter_p || filter_q)
  ------------------
  |  Branch (359:20): [True: 141M, False: 1.82M]
  |  Branch (359:32): [True: 506k, False: 1.31M]
  ------------------
  360|   145M|                {
  361|   145M|                    DUMP_DEBLK_LUMA_VERT(pu1_src, src_strd,
  362|   145M|                                         u4_bs & 3, qp_p, qp_q,
  363|   145M|                                         ps_slice_hdr->i1_beta_offset_div2,
  364|   145M|                                         ps_slice_hdr->i1_tc_offset_div2,
  365|   145M|                                         filter_p, filter_q);
  366|   145M|                    if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   145M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (366:24): [True: 86.8M, False: 58.3M]
  ------------------
  367|  86.8M|                    {
  368|  86.8M|                        ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr(pu1_src, src_strd,
  369|  86.8M|                                                                             u4_bs & 3, qp_p, qp_q,
  370|  86.8M|                                                                             i1_beta_offset_div2,
  371|  86.8M|                                                                             i1_tc_offset_div2,
  372|  86.8M|                                                                             filter_p, filter_q);
  373|  86.8M|                    }
  374|  58.3M|                    else
  375|  58.3M|                    {
  376|  58.3M|                        ps_codec->s_func_selector.ihevc_hbd_deblk_luma_vert_fptr((UWORD16 *)pu1_src,
  377|  58.3M|                                                                                 src_strd,
  378|  58.3M|                                                                                 u4_bs & 3, qp_p, qp_q,
  379|  58.3M|                                                                                 i1_beta_offset_div2,
  380|  58.3M|                                                                                 i1_tc_offset_div2,
  381|  58.3M|                                                                                 filter_p, filter_q,
  382|  58.3M|                                                                                 u1_bit_depth_luma);
  383|  58.3M|                    }
  384|   145M|                }
  385|       |
  386|   143M|                pu1_src += 4 * src_strd * pixel_size_y;
  387|   143M|                u4_bs = u4_bs >> 2;
  388|   143M|                row++;
  389|   143M|            }
  390|       |
  391|  82.9M|            if((64 == ctb_size) ||
  ------------------
  |  Branch (391:16): [True: 34.4M, False: 48.5M]
  ------------------
  392|  48.5M|                            ((32 == ctb_size) && (col & 1)))
  ------------------
  |  Branch (392:30): [True: 22.1M, False: 26.3M]
  |  Branch (392:50): [True: 11.1M, False: 11.0M]
  ------------------
  393|  45.0M|            {
  394|  45.0M|                pu4_vert_bs++;
  395|  45.0M|            }
  396|  82.9M|            pu1_src -= ((src_strd << log2_ctb_size) * pixel_size_y);
  397|  82.9M|            pu1_src += 8 * pixel_size_y;
  398|  82.9M|        }
  399|  23.5M|        pu4_vert_bs = pu4_ctb_vert_bs;
  400|  23.5M|    }
  401|       |
  402|       |
  403|       |    /* Luma Horizontal Edge */
  404|       |
  405|  23.7M|    if(0 == i4_is_last_ctb_y)
  ------------------
  |  Branch (405:8): [True: 23.3M, False: 462k]
  ------------------
  406|  23.3M|    {
  407|       |
  408|       |        /* Left CTB's slice header */
  409|  23.3M|        slice_header_t *ps_slice_hdr_left;
  410|  23.3M|        {
  411|  23.3M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  412|  23.3M|            if(i4_is_last_ctb_x)
  ------------------
  |  Branch (412:16): [True: 228k, False: 23.1M]
  ------------------
  413|   228k|                cur_ctb_indx += 1;
  414|  23.3M|            ps_slice_hdr_left = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - 1];
  415|  23.3M|        }
  416|  23.3M|        pu1_src = ps_deblk->pu1_cur_pic_luma +
  417|  23.3M|            ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_codec->i4_strd) << log2_ctb_size) * pixel_size_y;
  418|  23.3M|        pu1_src += i4_is_last_ctb_x ? (ctb_size * pixel_size_y) : 0;
  ------------------
  |  Branch (418:20): [True: 228k, False: 23.1M]
  ------------------
  419|       |
  420|       |        /** Deblocking is done on a shifted CTB -
  421|       |         *  Horizontal edge processing is done by shifting the CTB left by four pixels */
  422|  23.3M|        pu1_src -= 4 * pixel_size_y;
  423|   107M|        for(row = 0; row < ctb_size / 8; row++)
  ------------------
  |  Branch (423:22): [True: 84.1M, False: 23.3M]
  ------------------
  424|  84.1M|        {
  425|  84.1M|            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|  84.1M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (432:16): [True: 49.0M, False: 35.1M]
  ------------------
  433|  49.0M|                shift = (row & 1) << (log2_ctb_size - 1);
  434|       |
  435|       |            /* BS for the row - Last column is excluded and the left column is included*/
  436|  84.1M|            u4_bs = (pu4_horz_bs[0] >> shift) << 2;
  437|       |
  438|  84.1M|            if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (438:16): [True: 78.9M, False: 5.17M]
  |  Branch (438:38): [True: 664k, False: 4.50M]
  ------------------
  439|  79.7M|            {
  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|  79.7M|                UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (1 << (2 * log2_ctb_size - 7)));
  444|  79.7M|                UWORD32 u4_left_bs = (*pu4_horz_bs_left) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  445|  79.7M|                u4_bs |= u4_left_bs & 3;
  446|  79.7M|            }
  447|       |
  448|   334M|            for(col = 0; col < ctb_size / 4;)
  ------------------
  |  Branch (448:26): [True: 250M, False: 84.1M]
  ------------------
  449|   250M|            {
  450|   250M|                WORD8 i1_beta_offset_div2 = ps_slice_hdr->i1_beta_offset_div2;
  451|   250M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  452|       |
  453|   250M|                bs_tz = CTZ(u4_bs) >> 1;
  454|   250M|                if(0 != bs_tz)
  ------------------
  |  Branch (454:20): [True: 93.6M, False: 157M]
  ------------------
  455|  93.6M|                {
  456|  93.6M|                    u4_bs = u4_bs >> (bs_tz << 1);
  457|       |
  458|  93.6M|                    if((col + bs_tz) >= (ctb_size / 4))
  ------------------
  |  Branch (458:24): [True: 67.8M, False: 25.7M]
  ------------------
  459|  67.8M|                        pu1_src += 4 * (ctb_size / 4 - col) * pixel_size_y;
  460|  25.7M|                    else
  461|  25.7M|                        pu1_src += 4 * bs_tz * pixel_size_y;
  462|       |
  463|  93.6M|                    col += bs_tz;
  464|  93.6M|                    continue;
  465|  93.6M|                }
  466|       |
  467|   157M|                if(0 == col)
  ------------------
  |  Branch (467:20): [True: 16.2M, False: 140M]
  ------------------
  468|  16.2M|                {
  469|  16.2M|                    i1_beta_offset_div2 = ps_slice_hdr_left->i1_beta_offset_div2;
  470|  16.2M|                    i1_tc_offset_div2 = ps_slice_hdr_left->i1_tc_offset_div2;
  471|       |
  472|  16.2M|                    if(0 == row)
  ------------------
  |  Branch (472:24): [True: 4.21M, False: 12.0M]
  ------------------
  473|  4.21M|                    {
  474|  4.21M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (474:32): [True: 4.15M, False: 58.6k]
  ------------------
  475|  4.15M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  476|  4.21M|                                        pi1_qp[-qp_strd - 1];
  477|  4.21M|                    }
  478|  12.0M|                    else
  479|  12.0M|                    {
  480|  12.0M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (480:32): [True: 12.0M, False: 18.4E]
  ------------------
  481|  12.0M|                                        pi1_qp[-ctb_size / 8] :
  482|  18.4E|                                        pi1_qp[(row - 1) * qp_strd - 1];
  483|  12.0M|                    }
  484|       |
  485|  16.2M|                    qp_q = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (485:28): [True: 16.0M, False: 224k]
  ------------------
  486|  16.0M|                                    pi1_qp[-ctb_size / 8] :
  487|  16.2M|                                    pi1_qp[row * qp_strd - 1];
  488|  16.2M|                }
  489|   140M|                else
  490|   140M|                {
  491|   140M|                    if(0 == row)
  ------------------
  |  Branch (491:24): [True: 34.1M, False: 106M]
  ------------------
  492|  34.1M|                    {
  493|  34.1M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (493:32): [True: 33.2M, False: 931k]
  ------------------
  494|  33.2M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  495|  34.1M|                                        pi1_qp[((col - 1) >> 1) - qp_strd];
  496|  34.1M|                    }
  497|   106M|                    else
  498|   106M|                    {
  499|   106M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (499:32): [True: 117M, False: 18.4E]
  ------------------
  500|   117M|                                        pi1_qp[0] :
  501|  18.4E|                                        pi1_qp[((col - 1) >> 1) + (row - 1) * qp_strd];
  502|   106M|                    }
  503|       |
  504|   140M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (504:28): [True: 143M, False: 18.4E]
  ------------------
  505|   143M|                                    pi1_qp[0] :
  506|  18.4E|                                    pi1_qp[((col - 1) >> 1) + row * qp_strd];
  507|   140M|                }
  508|       |
  509|   157M|                filter_p = (pu2_ctb_no_loop_filter_flag[row] >> ((col + 1) >> 1)) & 1;
  510|   157M|                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|   157M|                filter_p = !filter_p;
  513|   157M|                filter_q = !filter_q;
  514|       |
  515|   157M|                if(filter_p || filter_q)
  ------------------
  |  Branch (515:20): [True: 155M, False: 1.82M]
  |  Branch (515:32): [True: 671k, False: 1.15M]
  ------------------
  516|   157M|                {
  517|   157M|                    DUMP_DEBLK_LUMA_HORZ(pu1_src, src_strd,
  518|   157M|                                         u4_bs & 3, qp_p, qp_q,
  519|   157M|                                         ps_slice_hdr->i1_beta_offset_div2,
  520|   157M|                                         ps_slice_hdr->i1_tc_offset_div2,
  521|   157M|                                         filter_p, filter_q);
  522|   157M|                    if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   157M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (522:24): [True: 94.1M, False: 63.6M]
  ------------------
  523|  94.1M|                    {
  524|  94.1M|                        ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr(pu1_src, src_strd,
  525|  94.1M|                                                                             u4_bs & 3, qp_p, qp_q,
  526|  94.1M|                                                                             i1_beta_offset_div2,
  527|  94.1M|                                                                             i1_tc_offset_div2, filter_p, filter_q);
  528|  94.1M|                    }
  529|  63.6M|                    else
  530|  63.6M|                    {
  531|  63.6M|                        ps_codec->s_func_selector.ihevc_hbd_deblk_luma_horz_fptr((UWORD16 *)pu1_src,
  532|  63.6M|                                                                                 src_strd,
  533|  63.6M|                                                                                 u4_bs & 3, qp_p, qp_q,
  534|  63.6M|                                                                                 i1_beta_offset_div2,
  535|  63.6M|                                                                                 i1_tc_offset_div2,
  536|  63.6M|                                                                                 filter_p, filter_q,
  537|  63.6M|                                                                                 u1_bit_depth_luma);
  538|  63.6M|                    }
  539|   157M|                }
  540|       |
  541|   157M|                pu1_src += 4 * pixel_size_y;
  542|   157M|                u4_bs = u4_bs >> 2;
  543|   157M|                col++;
  544|   157M|            }
  545|       |
  546|  84.1M|            if((64 == ctb_size) ||
  ------------------
  |  Branch (546:16): [True: 34.9M, False: 49.1M]
  ------------------
  547|  49.1M|                            ((32 == ctb_size) && (row & 1)))
  ------------------
  |  Branch (547:30): [True: 22.3M, False: 26.8M]
  |  Branch (547:50): [True: 11.2M, False: 11.1M]
  ------------------
  548|  46.3M|            {
  549|  46.3M|                pu4_horz_bs++;
  550|  46.3M|            }
  551|  84.1M|            pu1_src -= ctb_size * pixel_size_y;
  552|  84.1M|            pu1_src += ((src_strd << 3) * pixel_size_y);
  553|  84.1M|        }
  554|  23.3M|        pu4_horz_bs = pu4_ctb_horz_bs;
  555|  23.3M|    }
  556|       |
  557|       |
  558|       |    /* Chroma Veritcal Edge */
  559|       |
  560|  23.7M|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 == i4_is_last_ctb_x)
  ------------------
  |  Branch (560:8): [True: 23.5M, False: 211k]
  |  Branch (560:69): [True: 23.3M, False: 221k]
  ------------------
  561|  23.3M|    {
  562|       |
  563|       |        /* Top CTB's slice header */
  564|  23.3M|        slice_header_t *ps_slice_hdr_top;
  565|  23.3M|        {
  566|  23.3M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  567|  23.3M|            if(i4_is_last_ctb_y)
  ------------------
  |  Branch (567:16): [True: 97.3k, False: 23.2M]
  ------------------
  568|  97.3k|                cur_ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  569|  23.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];
  570|  23.3M|        }
  571|       |
  572|  23.3M|        pu1_src = ps_deblk->pu1_cur_pic_chroma +
  573|  23.3M|            ((((ps_deblk->i4_ctb_x * chroma_pixel_strd / h_samp_factor) +
  574|  23.3M|               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|  23.3M|        pu1_src += i4_is_last_ctb_y ?
  ------------------
  |  Branch (575:20): [True: 97.3k, False: 23.2M]
  ------------------
  576|  23.2M|            ((((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|  23.3M|        pu1_src -= 4 * chroma_strd * pixel_size_uv;
  581|       |
  582|  65.1M|        for(col = 0; col < ctb_size / (8 * h_samp_factor); col++)
  ------------------
  |  Branch (582:22): [True: 41.8M, False: 23.3M]
  ------------------
  583|  41.8M|        {
  584|  41.8M|            WORD32 shift = 0;
  585|       |
  586|  41.8M|            if(is_yuv444 && 6 != log2_ctb_size)
  ------------------
  |  Branch (586:16): [True: 0, False: 41.8M]
  |  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|  41.8M|            u4_bs = (pu4_vert_bs[0] >> shift) << 2;
  591|       |
  592|  41.8M|            if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (592:16): [True: 39.0M, False: 2.81M]
  |  Branch (592:38): [True: 11.4k, False: 2.80M]
  ------------------
  593|  39.1M|            {
  594|       |                /* Picking the last BS of the previous CTB corresponding to the same column */
  595|  39.1M|                UWORD32 *pu4_vert_bs_top = (UWORD32 *)((UWORD8 *)pu4_vert_bs - bs_strd);
  596|  39.1M|                UWORD32 u4_top_bs = (*pu4_vert_bs_top) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  597|  39.1M|                u4_bs |= u4_top_bs & 3;
  598|  39.1M|            }
  599|       |
  600|  41.8M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) {
  ------------------
  |  Branch (600:16): [True: 36.8M, False: 4.99M]
  ------------------
  601|       |                /* Every alternate boundary strength value is used for chroma */
  602|  36.8M|                u4_bs &= 0x22222222;
  603|  36.8M|            } 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: 5.73k, False: 4.98M]
  |  Branch (603:80): [True: 4.98M, False: 0]
  ------------------
  604|       |                /* Every boundary strength value is used for chroma */
  605|  4.98M|                u4_bs &= 0xAAAAAAAA;
  606|  4.98M|            }
  607|       |
  608|   158M|            for(row = 0; row < ctb_size / (4 * v_samp_factor);)
  ------------------
  |  Branch (608:26): [True: 117M, False: 41.8M]
  ------------------
  609|   117M|            {
  610|   117M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  611|       |
  612|   117M|                bs_tz = CTZ(u4_bs) >> v_samp_factor;
  613|   117M|                if(0 != bs_tz)
  ------------------
  |  Branch (613:20): [True: 45.4M, False: 71.6M]
  ------------------
  614|  45.4M|                {
  615|  45.4M|                    if((row + bs_tz) >= (ctb_size / (4 * v_samp_factor)))
  ------------------
  |  Branch (615:24): [True: 33.3M, False: 12.0M]
  ------------------
  616|  33.3M|                        pu1_src += 4 * (ctb_size / (4 * v_samp_factor) - row) * chroma_strd * pixel_size_uv;
  617|  12.0M|                    else
  618|  12.0M|                        pu1_src += 4 * bs_tz  * chroma_strd * pixel_size_uv;
  619|  45.4M|                    row += bs_tz;
  620|  45.4M|                    u4_bs = u4_bs >> (bs_tz << v_samp_factor);
  621|  45.4M|                    continue;
  622|  45.4M|                }
  623|       |
  624|  71.6M|                if(0 == row)
  ------------------
  |  Branch (624:20): [True: 8.37M, False: 63.2M]
  ------------------
  625|  8.37M|                {
  626|  8.37M|                    i1_tc_offset_div2 = ps_slice_hdr_top->i1_tc_offset_div2;
  627|       |
  628|  8.37M|                    if(0 == col)
  ------------------
  |  Branch (628:24): [True: 4.03M, False: 4.33M]
  ------------------
  629|  4.03M|                    {
  630|  4.03M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (630:32): [True: 3.98M, False: 53.8k]
  ------------------
  631|  3.98M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  632|  4.03M|                                        pi1_qp[-qp_strd - 1];
  633|  4.03M|                    }
  634|  4.33M|                    else
  635|  4.33M|                    {
  636|  4.33M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (636:32): [True: 4.27M, False: 62.3k]
  ------------------
  637|  4.27M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  638|  4.33M|                                        pi1_qp[h_samp_factor * col - 1 - qp_strd];
  639|  4.33M|                    }
  640|       |
  641|  8.37M|                    qp_q = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (641:28): [True: 8.20M, False: 166k]
  ------------------
  642|  8.20M|                                    pi1_qp[-ctb_size / 8 * qp_strd] :
  643|  8.37M|                                    pi1_qp[h_samp_factor * col - qp_strd];
  644|  8.37M|                }
  645|  63.2M|                else
  646|  63.2M|                {
  647|  63.2M|                    if(0 == col)
  ------------------
  |  Branch (647:24): [True: 21.3M, False: 41.9M]
  ------------------
  648|  21.3M|                    {
  649|  21.3M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (649:32): [True: 20.9M, False: 394k]
  ------------------
  650|  20.9M|                                        pi1_qp[-ctb_size / 8] :
  651|  21.3M|                                        pi1_qp[((row - 1) >> (2 - v_samp_factor)) * qp_strd - 1];
  652|  21.3M|                    }
  653|  41.9M|                    else
  654|  41.9M|                    {
  655|  41.9M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (655:32): [True: 43.8M, False: 18.4E]
  ------------------
  656|  43.8M|                                        pi1_qp[0] :
  657|  18.4E|                                        pi1_qp[((row - 1) >> (2 - v_samp_factor)) * qp_strd + h_samp_factor * col - 1];
  658|  41.9M|                    }
  659|       |
  660|  63.2M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (660:28): [True: 62.8M, False: 414k]
  ------------------
  661|  62.8M|                                    pi1_qp[0] :
  662|  63.2M|                                    pi1_qp[((row - 1) >> (2 - v_samp_factor)) * qp_strd + h_samp_factor * col];
  663|  63.2M|                }
  664|       |
  665|  71.6M|                filter_p = (pu2_ctb_no_loop_filter_flag[(row + (2 - v_samp_factor)) >> (2 - v_samp_factor)] >> (col << (h_samp_factor - 1))) & 1;
  666|  71.6M|                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|  71.6M|                filter_p = !filter_p;
  669|  71.6M|                filter_q = !filter_q;
  670|       |
  671|  71.6M|                if(filter_p || filter_q)
  ------------------
  |  Branch (671:20): [True: 70.2M, False: 1.32M]
  |  Branch (671:32): [True: 408k, False: 917k]
  ------------------
  672|  70.9M|                {
  673|  70.9M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) {
  ------------------
  |  Branch (673:24): [True: 30.0M, False: 40.8M]
  ------------------
  674|  30.0M|                        ASSERT(1 == ((u4_bs & 3) >> 1));
  ------------------
  |  |   55|  30.0M|#define ASSERT(x) {}
  ------------------
  675|  30.0M|                    }
  676|  70.9M|                    DUMP_DEBLK_CHROMA_VERT(pu1_src, chroma_strd,
  677|  70.9M|                                           u4_bs & 3, qp_p, qp_q,
  678|  70.9M|                                           ps_pps->i1_pic_cb_qp_offset,
  679|  70.9M|                                           ps_pps->i1_pic_cr_qp_offset,
  680|  70.9M|                                           ps_slice_hdr->i1_tc_offset_div2,
  681|  70.9M|                                           filter_p, filter_q);
  682|  70.9M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (682:24): [True: 5.54M, False: 65.4M]
  ------------------
  683|  5.54M|                    {
  684|  5.54M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  5.54M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (684:28): [True: 5.20M, False: 344k]
  ------------------
  685|  5.20M|                        {
  686|  5.20M|                            pf_deblk_chroma_vert(pu1_src,
  687|  5.20M|                                                 chroma_strd,
  688|  5.20M|                                                 qp_q,
  689|  5.20M|                                                 qp_p,
  690|  5.20M|                                                 ps_pps->i1_pic_cr_qp_offset,
  691|  5.20M|                                                 ps_pps->i1_pic_cb_qp_offset,
  692|  5.20M|                                                 i1_tc_offset_div2,
  693|  5.20M|                                                 filter_q,
  694|  5.20M|                                                 filter_p,
  695|  5.20M|                                                 ps_sps->i1_chroma_format_idc);
  696|  5.20M|                        }
  697|   344k|                        else
  698|   344k|                        {
  699|   344k|                            pf_hbd_deblk_chroma_vert((UWORD16 *)pu1_src,
  700|   344k|                                                     chroma_strd,
  701|   344k|                                                     qp_q,
  702|   344k|                                                     qp_p,
  703|   344k|                                                     ps_pps->i1_pic_cr_qp_offset,
  704|   344k|                                                     ps_pps->i1_pic_cb_qp_offset,
  705|   344k|                                                     i1_tc_offset_div2,
  706|   344k|                                                     filter_q,
  707|   344k|                                                     filter_p,
  708|   344k|                                                     u1_bit_depth_chroma,
  709|   344k|                                                     ps_sps->i1_chroma_format_idc);
  710|   344k|                        }
  711|  5.54M|                    }
  712|  65.4M|                    else
  713|  65.4M|                    {
  714|  65.4M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  65.4M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (714:28): [True: 25.4M, False: 39.9M]
  ------------------
  715|  25.4M|                        {
  716|  25.4M|                            pf_deblk_chroma_vert(pu1_src,
  717|  25.4M|                                                 chroma_strd,
  718|  25.4M|                                                 qp_p,
  719|  25.4M|                                                 qp_q,
  720|  25.4M|                                                 ps_pps->i1_pic_cb_qp_offset,
  721|  25.4M|                                                 ps_pps->i1_pic_cr_qp_offset,
  722|  25.4M|                                                 i1_tc_offset_div2,
  723|  25.4M|                                                 filter_p,
  724|  25.4M|                                                 filter_q,
  725|  25.4M|                                                 ps_sps->i1_chroma_format_idc);
  726|  25.4M|                        }
  727|  39.9M|                        else
  728|  39.9M|                        {
  729|  39.9M|                            pf_hbd_deblk_chroma_vert((UWORD16 *)pu1_src,
  730|  39.9M|                                                     chroma_strd,
  731|  39.9M|                                                     qp_p,
  732|  39.9M|                                                     qp_q,
  733|  39.9M|                                                     ps_pps->i1_pic_cb_qp_offset,
  734|  39.9M|                                                     ps_pps->i1_pic_cr_qp_offset,
  735|  39.9M|                                                     i1_tc_offset_div2,
  736|  39.9M|                                                     filter_p,
  737|  39.9M|                                                     filter_q,
  738|  39.9M|                                                     u1_bit_depth_chroma,
  739|  39.9M|                                                     ps_sps->i1_chroma_format_idc);
  740|  39.9M|                        }
  741|  65.4M|                    }
  742|  70.9M|                }
  743|       |
  744|  71.6M|                pu1_src += 4 * chroma_strd * pixel_size_uv;
  745|  71.6M|                u4_bs = u4_bs >> (2 * v_samp_factor);
  746|  71.6M|                row++;
  747|  71.6M|            }
  748|       |
  749|  41.8M|            pu1_src -= ((((src_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_ctb_size) * pixel_size_uv);
  750|  41.8M|            if(is_yuv444)
  ------------------
  |  Branch (750:16): [True: 0, False: 41.8M]
  ------------------
  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|  41.8M|            else
  755|  41.8M|            {
  756|  41.8M|                pu4_vert_bs += (64 == ctb_size) ? 2 : 1;
  ------------------
  |  Branch (756:32): [True: 17.2M, False: 24.6M]
  ------------------
  757|  41.8M|            }
  758|  41.8M|            pu1_src += 16 * pixel_size_uv;
  759|  41.8M|        }
  760|  23.3M|    }
  761|       |
  762|       |    /* Chroma Horizontal Edge */
  763|       |
  764|  23.7M|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 == i4_is_last_ctb_y)
  ------------------
  |  Branch (764:8): [True: 23.4M, False: 321k]
  |  Branch (764:69): [True: 23.3M, False: 94.8k]
  ------------------
  765|  23.3M|    {
  766|       |
  767|       |        /* Left CTB's slice header */
  768|  23.3M|        slice_header_t *ps_slice_hdr_left;
  769|  23.3M|        {
  770|  23.3M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  771|  23.3M|            if(i4_is_last_ctb_x)
  ------------------
  |  Branch (771:16): [True: 224k, False: 23.1M]
  ------------------
  772|   224k|                cur_ctb_indx += 1;
  773|  23.3M|            ps_slice_hdr_left = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - 1];
  774|  23.3M|        }
  775|       |
  776|  23.3M|        pu1_src = ps_deblk->pu1_cur_pic_chroma +
  777|  23.3M|            ((((ps_deblk->i4_ctb_x * chroma_pixel_strd / h_samp_factor) +
  778|  23.3M|               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|  23.3M|        pu1_src += i4_is_last_ctb_x ? (ctb_size * chroma_pixel_strd / h_samp_factor * pixel_size_uv) : 0;
  ------------------
  |  Branch (779:20): [True: 224k, False: 23.1M]
  ------------------
  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|  23.3M|        pu1_src -= 8 * pixel_size_uv;
  784|  70.3M|        for(row = 0; row < ctb_size / (8 * v_samp_factor); row++)
  ------------------
  |  Branch (784:22): [True: 47.0M, False: 23.3M]
  ------------------
  785|  47.0M|        {
  786|  47.0M|            WORD32 shift = 0;
  787|       |
  788|  47.0M|            if((is_yuv444 || is_yuv422) && 6 != log2_ctb_size)
  ------------------
  |  Branch (788:17): [True: 18.4E, False: 47.0M]
  |  Branch (788:30): [True: 9.98M, False: 37.0M]
  |  Branch (788:44): [True: 350k, False: 9.63M]
  ------------------
  789|   350k|                shift = (row & 1) << (log2_ctb_size - 1);
  790|       |
  791|       |            /* BS for the row - Last column is excluded and the left column is included*/
  792|  47.0M|            u4_bs = (pu4_horz_bs[0] >> shift) << 2;
  793|       |
  794|  47.0M|            if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (794:16): [True: 43.9M, False: 3.01M]
  |  Branch (794:38): [True: 351k, False: 2.66M]
  ------------------
  795|  44.4M|            {
  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|  44.4M|                UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (1 << (2 * log2_ctb_size - 7)));
  800|  44.4M|                UWORD32 u4_left_bs = (*pu4_horz_bs_left) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  801|  44.4M|                u4_bs |= u4_left_bs & 3;
  802|  44.4M|            }
  803|       |
  804|  47.0M|            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: 37.0M, False: 9.99M]
  |  Branch (804:73): [True: 9.99M, False: 0]
  ------------------
  805|       |                /* Every alternate boundary strength value is used for chroma */
  806|  47.0M|                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|   164M|            for(col = 0; col < ctb_size / (4 * h_samp_factor);)
  ------------------
  |  Branch (812:26): [True: 117M, False: 47.0M]
  ------------------
  813|   117M|            {
  814|   117M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  815|       |
  816|   117M|                bs_tz = CTZ(u4_bs) >> h_samp_factor;
  817|   117M|                if(0 != bs_tz)
  ------------------
  |  Branch (817:20): [True: 50.7M, False: 66.2M]
  ------------------
  818|  50.7M|                {
  819|  50.7M|                    u4_bs = u4_bs >> (bs_tz << h_samp_factor);
  820|       |
  821|  50.7M|                    if((col + bs_tz) >= (ctb_size / (4 * h_samp_factor)))
  ------------------
  |  Branch (821:24): [True: 35.9M, False: 14.8M]
  ------------------
  822|  35.9M|                        pu1_src += 8 * (ctb_size / (4 * h_samp_factor) - col) * pixel_size_uv;
  823|  14.8M|                    else
  824|  14.8M|                        pu1_src += 8 * bs_tz * pixel_size_uv;
  825|       |
  826|  50.7M|                    col += bs_tz;
  827|  50.7M|                    continue;
  828|  50.7M|                }
  829|       |
  830|  66.2M|                if(0 == col)
  ------------------
  |  Branch (830:20): [True: 11.0M, False: 55.2M]
  ------------------
  831|  11.0M|                {
  832|  11.0M|                    i1_tc_offset_div2 = ps_slice_hdr_left->i1_tc_offset_div2;
  833|       |
  834|  11.0M|                    if(0 == row)
  ------------------
  |  Branch (834:24): [True: 4.15M, False: 6.86M]
  ------------------
  835|  4.15M|                    {
  836|  4.15M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (836:32): [True: 4.11M, False: 46.4k]
  ------------------
  837|  4.11M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  838|  4.15M|                                        pi1_qp[-qp_strd - 1];
  839|  4.15M|                    }
  840|  6.86M|                    else
  841|  6.86M|                    {
  842|  6.86M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (842:32): [True: 6.81M, False: 53.7k]
  ------------------
  843|  6.81M|                                        pi1_qp[-ctb_size / 8] :
  844|  6.86M|                                        pi1_qp[(v_samp_factor * row - 1) * qp_strd - 1];
  845|  6.86M|                    }
  846|       |
  847|  11.0M|                    qp_q = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (847:28): [True: 10.8M, False: 161k]
  ------------------
  848|  10.8M|                                    pi1_qp[-ctb_size / 8] :
  849|  11.0M|                                    pi1_qp[(v_samp_factor * row) * qp_strd - 1];
  850|  11.0M|                }
  851|  55.2M|                else
  852|  55.2M|                {
  853|  55.2M|                    if(0 == row)
  ------------------
  |  Branch (853:24): [True: 14.9M, False: 40.2M]
  ------------------
  854|  14.9M|                    {
  855|  14.9M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (855:32): [True: 14.6M, False: 304k]
  ------------------
  856|  14.6M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  857|  14.9M|                                        pi1_qp[((col - 1) >> (2 - h_samp_factor)) - qp_strd];
  858|  14.9M|                    }
  859|  40.2M|                    else
  860|  40.2M|                    {
  861|  40.2M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (861:32): [True: 42.2M, False: 18.4E]
  ------------------
  862|  42.2M|                                        pi1_qp[0] :
  863|  18.4E|                                        pi1_qp[((col - 1) >> (2 - h_samp_factor)) +  (v_samp_factor * row - 1) * qp_strd];
  864|  40.2M|                    }
  865|       |
  866|  55.2M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (866:28): [True: 55.5M, False: 18.4E]
  ------------------
  867|  55.5M|                                    pi1_qp[0] :
  868|  18.4E|                                    pi1_qp[((col - 1) >> (2 - h_samp_factor)) + v_samp_factor * row * qp_strd];
  869|  55.2M|                }
  870|  66.2M|                filter_p = (pu2_ctb_no_loop_filter_flag[row * v_samp_factor] >> ((col + 2 - h_samp_factor) >> (2 - h_samp_factor))) & 1;
  871|  66.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|  66.2M|                filter_p = !filter_p;
  874|  66.2M|                filter_q = !filter_q;
  875|       |
  876|  66.2M|                if(filter_p || filter_q)
  ------------------
  |  Branch (876:20): [True: 65.4M, False: 823k]
  |  Branch (876:32): [True: 325k, False: 498k]
  ------------------
  877|  66.2M|                {
  878|  66.2M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) {
  ------------------
  |  Branch (878:24): [True: 30.0M, False: 36.1M]
  ------------------
  879|  30.0M|                        ASSERT(1 == ((u4_bs & 3) >> 1));
  ------------------
  |  |   55|  30.0M|#define ASSERT(x) {}
  ------------------
  880|  30.0M|                    }
  881|  66.2M|                    DUMP_DEBLK_CHROMA_HORZ(pu1_src, chroma_strd,
  882|  66.2M|                                           u4_bs & 3, qp_p, qp_q,
  883|  66.2M|                                           ps_pps->i1_pic_cb_qp_offset,
  884|  66.2M|                                           ps_pps->i1_pic_cr_qp_offset,
  885|  66.2M|                                           ps_slice_hdr->i1_tc_offset_div2,
  886|  66.2M|                                           filter_p, filter_q);
  887|  66.2M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (887:24): [True: 5.74M, False: 60.4M]
  ------------------
  888|  5.74M|                    {
  889|  5.74M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  5.74M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (889:28): [True: 5.34M, False: 400k]
  ------------------
  890|  5.34M|                        {
  891|  5.34M|                            pf_deblk_chroma_horz(pu1_src,
  892|  5.34M|                                                 chroma_strd,
  893|  5.34M|                                                 qp_q,
  894|  5.34M|                                                 qp_p,
  895|  5.34M|                                                 ps_pps->i1_pic_cr_qp_offset,
  896|  5.34M|                                                 ps_pps->i1_pic_cb_qp_offset,
  897|  5.34M|                                                 i1_tc_offset_div2,
  898|  5.34M|                                                 filter_q,
  899|  5.34M|                                                 filter_p,
  900|  5.34M|                                                 ps_sps->i1_chroma_format_idc);
  901|  5.34M|                        }
  902|   400k|                        else
  903|   400k|                        {
  904|   400k|                            pf_hbd_deblk_chroma_horz((UWORD16 *)pu1_src,
  905|   400k|                                                     chroma_strd,
  906|   400k|                                                     qp_q,
  907|   400k|                                                     qp_p,
  908|   400k|                                                     ps_pps->i1_pic_cr_qp_offset,
  909|   400k|                                                     ps_pps->i1_pic_cb_qp_offset,
  910|   400k|                                                     i1_tc_offset_div2,
  911|   400k|                                                     filter_q,
  912|   400k|                                                     filter_p,
  913|   400k|                                                     u1_bit_depth_chroma,
  914|   400k|                                                     ps_sps->i1_chroma_format_idc);
  915|   400k|                        }
  916|  5.74M|                    }
  917|  60.4M|                    else
  918|  60.4M|                    {
  919|  60.4M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  60.4M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (919:28): [True: 24.8M, False: 35.5M]
  ------------------
  920|  24.8M|                        {
  921|  24.8M|                            pf_deblk_chroma_horz(pu1_src,
  922|  24.8M|                                                 chroma_strd,
  923|  24.8M|                                                 qp_p,
  924|  24.8M|                                                 qp_q,
  925|  24.8M|                                                 ps_pps->i1_pic_cb_qp_offset,
  926|  24.8M|                                                 ps_pps->i1_pic_cr_qp_offset,
  927|  24.8M|                                                 i1_tc_offset_div2,
  928|  24.8M|                                                 filter_p,
  929|  24.8M|                                                 filter_q,
  930|  24.8M|                                                 ps_sps->i1_chroma_format_idc);
  931|  24.8M|                        }
  932|  35.5M|                        else
  933|  35.5M|                        {
  934|  35.5M|                            pf_hbd_deblk_chroma_horz((UWORD16 *)pu1_src,
  935|  35.5M|                                                     chroma_strd,
  936|  35.5M|                                                     qp_p,
  937|  35.5M|                                                     qp_q,
  938|  35.5M|                                                     ps_pps->i1_pic_cb_qp_offset,
  939|  35.5M|                                                     ps_pps->i1_pic_cr_qp_offset,
  940|  35.5M|                                                     i1_tc_offset_div2,
  941|  35.5M|                                                     filter_p,
  942|  35.5M|                                                     filter_q,
  943|  35.5M|                                                     u1_bit_depth_chroma,
  944|  35.5M|                                                     ps_sps->i1_chroma_format_idc);
  945|  35.5M|                        }
  946|  60.4M|                    }
  947|  66.2M|                }
  948|       |
  949|  66.2M|                pu1_src += 8 * pixel_size_uv;
  950|  66.2M|                u4_bs = u4_bs >> (2 * h_samp_factor);
  951|  66.2M|                col++;
  952|  66.2M|            }
  953|  47.0M|            if(is_yuv444 || is_yuv422)
  ------------------
  |  Branch (953:16): [True: 118k, False: 46.8M]
  |  Branch (953:29): [True: 9.96M, False: 36.9M]
  ------------------
  954|  9.97M|            {
  955|  9.97M|                if((64 == ctb_size) || ((32 == ctb_size) && (row & 1))) pu4_horz_bs++;
  ------------------
  |  Branch (955:20): [True: 9.62M, False: 346k]
  |  Branch (955:41): [True: 119k, False: 227k]
  |  Branch (955:61): [True: 60.4k, False: 59.2k]
  ------------------
  956|  9.97M|            }
  957|  37.0M|            else
  958|  37.0M|            {
  959|  37.0M|                pu4_horz_bs += (64 == ctb_size) ? 2 : 1;
  ------------------
  |  Branch (959:32): [True: 12.6M, False: 24.4M]
  ------------------
  960|  37.0M|            }
  961|  47.0M|            pu1_src -= ctb_size * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  962|  47.0M|            pu1_src += 8 * chroma_strd * pixel_size_uv;
  963|       |
  964|  47.0M|        }
  965|  23.3M|    }
  966|  23.7M|}

ihevcd_decode:
  462|   297k|{
  463|   297k|    WORD32 ret = IV_SUCCESS;
  464|   297k|    codec_t *ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
  465|   297k|    ihevcd_cxa_video_decode_ip_t s_hevcd_dec_ip = {};
  466|   297k|    ihevcd_cxa_video_decode_ip_t *ps_hevcd_dec_ip;
  467|   297k|    ihevcd_cxa_video_decode_op_t *ps_hevcd_dec_op;
  468|   297k|    ivd_video_decode_ip_t *ps_dec_ip;
  469|   297k|    ivd_video_decode_op_t *ps_dec_op;
  470|       |
  471|   297k|    WORD32 proc_idx = 0;
  472|   297k|    WORD32 prev_proc_idx = 0;
  473|       |
  474|       |    /* Initialize error code */
  475|   297k|    ps_codec->i4_error_code = 0;
  476|       |    /* Initialize bytes remaining */
  477|   297k|    ps_codec->i4_bytes_remaining = 0;
  478|       |
  479|   297k|    ps_dec_ip = (ivd_video_decode_ip_t *)pv_api_ip;
  480|   297k|    memcpy(&s_hevcd_dec_ip, ps_dec_ip, ps_dec_ip->u4_size);
  481|   297k|    s_hevcd_dec_ip.s_ivd_video_decode_ip_t.u4_size = sizeof(ihevcd_cxa_video_decode_ip_t);
  482|       |
  483|   297k|    ps_hevcd_dec_ip = &s_hevcd_dec_ip;
  484|   297k|    ps_dec_ip = &ps_hevcd_dec_ip->s_ivd_video_decode_ip_t;
  485|       |
  486|   297k|    ps_hevcd_dec_op = (ihevcd_cxa_video_decode_op_t *)pv_api_op;
  487|   297k|    ps_dec_op = &ps_hevcd_dec_op->s_ivd_video_decode_op_t;
  488|       |
  489|   297k|    {
  490|   297k|        UWORD32 u4_size = ps_dec_op->u4_size;
  491|   297k|        memset(ps_hevcd_dec_op, 0, u4_size);
  492|   297k|        ps_dec_op->u4_size = u4_size; //Restore size field
  493|   297k|    }
  494|   297k|    if(ps_codec->i4_init_done != 1)
  ------------------
  |  Branch (494:8): [True: 0, False: 297k]
  ------------------
  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|   297k|    if(ps_codec->u4_pic_cnt >= NUM_FRAMES_LIMIT)
  ------------------
  |  |   82|   297k|#define NUM_FRAMES_LIMIT 0x7FFFFFFF
  ------------------
  |  Branch (501:8): [True: 0, False: 297k]
  ------------------
  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|   297k|    if(ps_codec->u1_enable_cu_info && ps_codec->i4_sps_done)
  ------------------
  |  Branch (508:8): [True: 0, False: 297k]
  |  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|   297k|    if(ps_codec->i4_reset_flag)
  ------------------
  |  Branch (524:8): [True: 655, False: 297k]
  ------------------
  525|    655|    {
  526|    655|        ps_codec->i4_flush_mode = 1;
  527|    655|    }
  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|   297k|    if(0 == ps_codec->i4_flush_mode)
  ------------------
  |  Branch (532:8): [True: 297k, False: 655]
  ------------------
  533|   297k|    {
  534|   297k|        if(ps_dec_ip->pv_stream_buffer == NULL)
  ------------------
  |  Branch (534:12): [True: 0, False: 297k]
  ------------------
  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|   297k|        if(ps_dec_ip->u4_num_Bytes <= MIN_START_CODE_LEN)
  ------------------
  |  |   43|   297k|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (540:12): [True: 1.12k, False: 296k]
  ------------------
  541|  1.12k|        {
  542|  1.12k|            if((WORD32)ps_dec_ip->u4_num_Bytes > 0)
  ------------------
  |  Branch (542:16): [True: 1.12k, False: 0]
  ------------------
  543|  1.12k|                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.12k|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  548|  1.12k|            ps_dec_op->u4_error_code |= IVD_DEC_NUMBYTES_INV;
  549|  1.12k|            return IV_FAIL;
  550|       |
  551|  1.12k|        }
  552|   297k|    }
  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|   296k|    if(0 == ps_codec->i4_share_disp_buf && ps_codec->i4_header_mode == 0)
  ------------------
  |  Branch (565:8): [True: 296k, False: 0]
  |  Branch (565:44): [True: 178k, False: 117k]
  ------------------
  566|   178k|    {
  567|   178k|        UWORD32 i;
  568|   178k|        if((ps_dec_ip->s_out_buffer.u4_num_bufs <= 0) ||
  ------------------
  |  Branch (568:12): [True: 0, False: 178k]
  ------------------
  569|   178k|           (ps_dec_ip->s_out_buffer.u4_num_bufs > IVD_VIDDEC_MAX_IO_BUFFERS))
  ------------------
  |  |   43|   178k|#define IVD_VIDDEC_MAX_IO_BUFFERS 64
  ------------------
  |  Branch (569:12): [True: 0, False: 178k]
  ------------------
  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|   593k|        for(i = 0; i < ps_dec_ip->s_out_buffer.u4_num_bufs; i++)
  ------------------
  |  Branch (576:20): [True: 414k, False: 178k]
  ------------------
  577|   414k|        {
  578|   414k|            if(ps_dec_ip->s_out_buffer.pu1_bufs[i] == NULL)
  ------------------
  |  Branch (578:16): [True: 0, False: 414k]
  ------------------
  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|   414k|            if(ps_dec_ip->s_out_buffer.u4_min_out_buf_size[i] == 0)
  ------------------
  |  Branch (585:16): [True: 0, False: 414k]
  ------------------
  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|   414k|        }
  592|   178k|    }
  593|       |
  594|   296k|    ps_codec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
  595|   296k|    ps_codec->u4_ts = ps_dec_ip->u4_ts;
  596|   296k|    if(ps_codec->i4_flush_mode)
  ------------------
  |  Branch (596:8): [True: 655, False: 296k]
  ------------------
  597|    655|    {
  598|       |
  599|    655|        ps_dec_op->u4_pic_wd = ps_codec->i4_disp_wd;
  600|    655|        ps_dec_op->u4_pic_ht = ps_codec->i4_disp_ht;
  601|       |
  602|    655|        ps_dec_op->u4_new_seq = 0;
  603|       |
  604|    655|        ps_codec->ps_disp_buf = (pic_buf_t *)ihevc_disp_mgr_get(
  605|    655|                        (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|    655|        if((ps_codec->ps_disp_buf)
  ------------------
  |  Branch (608:12): [True: 0, False: 655]
  ------------------
  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|    655|        ihevcd_fill_outargs(ps_codec, ps_hevcd_dec_ip, ps_hevcd_dec_op);
  636|       |
  637|    655|        if(1 == ps_dec_op->u4_output_present)
  ------------------
  |  Branch (637:12): [True: 0, False: 655]
  ------------------
  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|    655|        if(NULL == ps_codec->ps_disp_buf)
  ------------------
  |  Branch (659:12): [True: 655, False: 0]
  ------------------
  660|    655|        {
  661|       |            /* If in flush mode and there are no more buffers to flush,
  662|       |             * check for the reset flag and reset the decoder */
  663|    655|            if(ps_codec->i4_reset_flag)
  ------------------
  |  Branch (663:16): [True: 655, False: 0]
  ------------------
  664|    655|            {
  665|    655|                ihevcd_init(ps_codec);
  666|    655|            }
  667|    655|            return (IV_FAIL);
  668|    655|        }
  669|       |
  670|      0|        return (IV_SUCCESS);
  671|       |
  672|    655|    }
  673|       |    /* In case of shared mode, check if there is a free buffer for reconstruction */
  674|   296k|    if((0 == ps_codec->i4_header_mode) && (1 == ps_codec->i4_share_disp_buf))
  ------------------
  |  Branch (674:8): [True: 178k, False: 117k]
  |  Branch (674:43): [True: 0, False: 178k]
  ------------------
  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|   296k|    ps_codec->i4_bytes_remaining = ps_dec_ip->u4_num_Bytes;
  690|   296k|    ps_codec->pu1_inp_bitsbuf = (UWORD8 *)ps_dec_ip->pv_stream_buffer;
  691|   296k|    ps_codec->s_parse.i4_end_of_frame = 0;
  692|       |
  693|   296k|    ps_codec->i4_pic_present = 0;
  694|   296k|    ps_codec->i4_slice_error = 0;
  695|   296k|    ps_codec->ps_disp_buf = NULL;
  696|   296k|    ps_codec->e_dec_pic_type = IV_NA_FRAME;
  697|       |
  698|   296k|    if(ps_codec->i4_num_cores > 1)
  ------------------
  |  Branch (698:8): [True: 208k, False: 88.0k]
  ------------------
  699|   208k|    {
  700|   208k|        ithread_set_affinity(0);
  701|   208k|    }
  702|   572k|    while(MIN_START_CODE_LEN < ps_codec->i4_bytes_remaining)
  ------------------
  |  |   43|   572k|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (702:11): [True: 568k, False: 4.73k]
  ------------------
  703|   568k|    {
  704|   568k|        WORD32 nal_len;
  705|   568k|        WORD32 nal_ofst;
  706|   568k|        WORD32 bits_len;
  707|       |
  708|   568k|        if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (708:12): [True: 31.1k, False: 536k]
  ------------------
  709|  31.1k|        {
  710|  31.1k|            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|  31.1k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  31.1k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  711|  31.1k|            WORD32 next_slice_addr = ps_slice_hdr_next->i2_ctb_x +
  712|  31.1k|                            ps_slice_hdr_next->i2_ctb_y * ps_codec->s_parse.ps_sps->i2_pic_wd_in_ctb;
  713|  31.1k|            if(ps_codec->s_parse.i4_next_ctb_indx == next_slice_addr)
  ------------------
  |  Branch (713:16): [True: 0, False: 31.1k]
  ------------------
  714|      0|                ps_codec->i4_slice_error = 0;
  715|  31.1k|        }
  716|       |
  717|   568k|        if(ps_codec->pu1_bitsbuf_dynamic)
  ------------------
  |  Branch (717:12): [True: 74.7k, False: 493k]
  ------------------
  718|  74.7k|        {
  719|  74.7k|            ps_codec->pu1_bitsbuf = ps_codec->pu1_bitsbuf_dynamic;
  720|  74.7k|            ps_codec->u4_bitsbuf_size = ps_codec->u4_bitsbuf_size_dynamic;
  721|  74.7k|        }
  722|   493k|        else
  723|   493k|        {
  724|   493k|            ps_codec->pu1_bitsbuf = ps_codec->pu1_bitsbuf_static;
  725|   493k|            ps_codec->u4_bitsbuf_size = ps_codec->u4_bitsbuf_size_static;
  726|   493k|        }
  727|       |
  728|   568k|        nal_ofst = ihevcd_nal_search_start_code(ps_codec->pu1_inp_bitsbuf,
  729|   568k|                                                ps_codec->i4_bytes_remaining);
  730|       |        /* If there is no start code found, consume the data and break */
  731|   568k|        if(nal_ofst == ps_codec->i4_bytes_remaining)
  ------------------
  |  Branch (731:12): [True: 396, False: 567k]
  ------------------
  732|    396|        {
  733|    396|            ps_codec->pu1_inp_bitsbuf += nal_ofst;
  734|    396|            ps_codec->i4_bytes_remaining -= nal_ofst;
  735|    396|            break;
  736|    396|        }
  737|       |
  738|   567k|        ps_codec->i4_nal_ofst = nal_ofst;
  739|   567k|        {
  740|   567k|            WORD32 bytes_remaining = ps_codec->i4_bytes_remaining - nal_ofst;
  741|       |
  742|   567k|            bytes_remaining = MIN((UWORD32)bytes_remaining, ps_codec->u4_bitsbuf_size);
  ------------------
  |  |   43|   567k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 567k, False: 0]
  |  |  ------------------
  ------------------
  743|   567k|            ihevcd_nal_remv_emuln_bytes(ps_codec->pu1_inp_bitsbuf + nal_ofst,
  744|   567k|                                        ps_codec->pu1_bitsbuf,
  745|   567k|                                        bytes_remaining,
  746|   567k|                                        &nal_len, &bits_len);
  747|       |
  748|       |            /* Decoder may read upto 8 extra bytes at the end of frame */
  749|       |            /* These are not used, but still set them to zero to avoid uninitialized reads */
  750|   567k|            if(bits_len < (WORD32)(ps_codec->u4_bitsbuf_size - 8))
  ------------------
  |  Branch (750:16): [True: 567k, False: 4]
  ------------------
  751|   567k|            {
  752|   567k|                memset(ps_codec->pu1_bitsbuf + bits_len, 0, 2 * sizeof(UWORD32));
  753|   567k|            }
  754|   567k|        }
  755|       |        /* This may be used to update the offsets for tiles and entropy sync row offsets */
  756|   567k|        ps_codec->i4_num_emln_bytes = nal_len - bits_len;
  757|   567k|        ps_codec->i4_nal_len = nal_len;
  758|       |
  759|   567k|        ihevcd_bits_init(&ps_codec->s_parse.s_bitstrm, ps_codec->pu1_bitsbuf,
  760|   567k|                         bits_len);
  761|       |
  762|   567k|        ret = ihevcd_nal_unit(ps_codec);
  763|       |
  764|       |        /* If the frame is incomplete and
  765|       |         * the bytes remaining is zero or a header is received,
  766|       |         * complete the frame treating it to be in error */
  767|   567k|        if(ps_codec->i4_pic_present &&
  ------------------
  |  Branch (767:12): [True: 178k, False: 389k]
  ------------------
  768|   178k|                        (ps_codec->s_parse.i4_next_ctb_indx != ps_codec->s_parse.ps_sps->i4_pic_size_in_ctb))
  ------------------
  |  Branch (768:25): [True: 124k, False: 53.5k]
  ------------------
  769|   124k|        {
  770|   124k|            if((ps_codec->i4_bytes_remaining - (nal_len + nal_ofst) <= MIN_START_CODE_LEN) ||
  ------------------
  |  |   43|   124k|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (770:16): [True: 14.2k, False: 110k]
  ------------------
  771|   110k|                            (ps_codec->i4_header_in_slice_mode))
  ------------------
  |  Branch (771:29): [True: 16.2k, False: 94.3k]
  ------------------
  772|  30.4k|            {
  773|  30.4k|                slice_header_t *ps_slice_hdr_next;
  774|       |
  775|  30.4k|                ps_codec->s_parse.i4_cur_slice_idx--;
  776|  30.4k|                if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (776:20): [True: 31, False: 30.4k]
  ------------------
  777|     31|                    ps_codec->s_parse.i4_cur_slice_idx = 0;
  778|       |
  779|  30.4k|                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|  30.4k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  30.4k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  780|  30.4k|                ps_slice_hdr_next->i2_ctb_x = 0;
  781|  30.4k|                ps_slice_hdr_next->i2_ctb_y = ps_codec->s_parse.ps_sps->i2_pic_ht_in_ctb;
  782|  30.4k|                ps_codec->i4_slice_error = 1;
  783|  30.4k|                continue;
  784|  30.4k|            }
  785|   124k|        }
  786|       |
  787|   537k|        if(IHEVCD_IGNORE_SLICE == ret)
  ------------------
  |  Branch (787:12): [True: 39.0k, False: 498k]
  ------------------
  788|  39.0k|        {
  789|  39.0k|            ps_codec->pu1_inp_bitsbuf += (nal_ofst + nal_len);
  790|  39.0k|            ps_codec->i4_bytes_remaining -= (nal_ofst + nal_len);
  791|       |
  792|  39.0k|            ret = IHEVCD_SUCCESS;
  793|  39.0k|            continue;
  794|  39.0k|        }
  795|       |
  796|   498k|        if(IVD_RES_CHANGED == ret)
  ------------------
  |  Branch (796:12): [True: 3.34k, False: 494k]
  ------------------
  797|  3.34k|        {
  798|  3.34k|            break;
  799|  3.34k|        }
  800|       |
  801|       |        /* Update bytes remaining and bytes consumed and input bitstream pointer */
  802|       |        /* Do not consume the NAL in the following cases */
  803|       |        /* Slice header reached during header decode mode */
  804|       |        /* TODO: Next picture's slice reached */
  805|   494k|        if(ret != IHEVCD_SLICE_IN_HEADER_MODE)
  ------------------
  |  Branch (805:12): [True: 409k, False: 85.7k]
  ------------------
  806|   409k|        {
  807|   409k|            if((0 == ps_codec->i4_slice_error) ||
  ------------------
  |  Branch (807:16): [True: 408k, False: 212]
  ------------------
  808|    212|                            (ps_codec->i4_bytes_remaining - (nal_len + nal_ofst) <= MIN_START_CODE_LEN))
  ------------------
  |  |   43|    212|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (808:29): [True: 6, False: 206]
  ------------------
  809|   408k|            {
  810|   408k|                ps_codec->pu1_inp_bitsbuf += (nal_ofst + nal_len);
  811|   408k|                ps_codec->i4_bytes_remaining -= (nal_ofst + nal_len);
  812|   408k|            }
  813|   409k|            if(ret != IHEVCD_SUCCESS)
  ------------------
  |  Branch (813:16): [True: 148k, False: 260k]
  ------------------
  814|   148k|                break;
  815|       |
  816|   260k|            if(ps_codec->s_parse.i4_end_of_frame)
  ------------------
  |  Branch (816:16): [True: 53.5k, False: 207k]
  ------------------
  817|  53.5k|                break;
  818|   260k|        }
  819|  85.7k|        else
  820|  85.7k|        {
  821|  85.7k|            ret = IHEVCD_SUCCESS;
  822|  85.7k|            break;
  823|  85.7k|        }
  824|       |
  825|       |        /* Allocate dynamic bitstream buffer once SPS is decoded */
  826|   207k|        if((ps_codec->u4_allocate_dynamic_done == 0) && ps_codec->i4_sps_done)
  ------------------
  |  Branch (826:12): [True: 32.3k, False: 174k]
  |  Branch (826:57): [True: 25.3k, False: 6.96k]
  ------------------
  827|  25.3k|        {
  828|  25.3k|            WORD32 ret;
  829|  25.3k|            ret = ihevcd_allocate_dynamic_bufs(ps_codec);
  830|  25.3k|            if(ret != IV_SUCCESS)
  ------------------
  |  Branch (830:16): [True: 0, False: 25.3k]
  ------------------
  831|      0|            {
  832|       |                /* Free any dynamic buffers that are allocated */
  833|      0|                ihevcd_free_dynamic_bufs(ps_codec);
  834|      0|                ps_codec->i4_error_code = IVD_MEM_ALLOC_FAILED;
  835|      0|                ps_dec_op->u4_error_code = 1 << IVD_FATALERROR;
  836|      0|                ps_dec_op->u4_error_code |= IVD_MEM_ALLOC_FAILED;
  837|       |
  838|      0|                return IV_FAIL;
  839|      0|            }
  840|  25.3k|        }
  841|       |
  842|   207k|        BREAK_AFTER_SLICE_NAL();
  ------------------
  |  |   81|   207k|#define BREAK_AFTER_SLICE_NAL()     ;
  ------------------
  843|   207k|    }
  844|       |
  845|   296k|    if(1 == ps_codec->i4_pic_present && 0 == ps_codec->s_parse.i4_end_of_frame)
  ------------------
  |  Branch (845:8): [True: 72.9k, False: 223k]
  |  Branch (845:41): [True: 19.3k, False: 53.5k]
  ------------------
  846|  19.3k|    {
  847|  19.3k|        slice_header_t *ps_slice_hdr_next;
  848|  19.3k|        ps_codec->i4_slice_error = 1;
  849|  19.3k|        ps_codec->s_parse.i4_cur_slice_idx--;
  850|  19.3k|        if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (850:12): [True: 1, False: 19.3k]
  ------------------
  851|      1|            ps_codec->s_parse.i4_cur_slice_idx = 0;
  852|       |
  853|  19.3k|        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|  19.3k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  19.3k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  854|  19.3k|        ps_slice_hdr_next->i2_ctb_x = -1;
  855|  19.3k|        ps_slice_hdr_next->i2_ctb_y = -1;
  856|       |
  857|  19.3k|        ihevcd_parse_slice_data(ps_codec);
  858|  19.3k|        ASSERT(ps_codec->s_parse.i4_end_of_frame != 0);
  ------------------
  |  |   55|  19.3k|#define ASSERT(x) {}
  ------------------
  859|  19.3k|    }
  860|       |
  861|   296k|    if(1 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (861:8): [True: 72.9k, False: 223k]
  ------------------
  862|  72.9k|    {
  863|  72.9k|        WORD32 i;
  864|  72.9k|        sps_t *ps_sps = ps_codec->s_parse.ps_sps;
  865|  72.9k|        ps_codec->i4_first_pic_done = 1;
  866|       |
  867|       |        /*TODO temporary fix: end_of_frame is checked before adding format conversion to job queue         */
  868|  72.9k|        if(ps_codec->i4_num_cores > 1 && ps_codec->s_parse.i4_end_of_frame)
  ------------------
  |  Branch (868:12): [True: 51.2k, False: 21.6k]
  |  Branch (868:42): [True: 51.2k, False: 0]
  ------------------
  869|  51.2k|        {
  870|       |
  871|       |            /* Add job queue for format conversion / frame copy for each ctb row */
  872|       |            /* Only if the codec is in non-shared mode or in shared mode but needs 420P output */
  873|  51.2k|            process_ctxt_t *ps_proc;
  874|       |
  875|       |            /* i4_num_cores - 1 contexts are currently being used by other threads */
  876|  51.2k|            ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1];
  877|       |
  878|  51.2k|            if((ps_codec->ps_disp_buf) &&
  ------------------
  |  Branch (878:16): [True: 49.3k, False: 1.90k]
  ------------------
  879|  49.3k|               ((0 == ps_codec->i4_share_disp_buf) || (IV_YUV_420P == ps_codec->e_chroma_fmt)))
  ------------------
  |  Branch (879:17): [True: 49.3k, False: 0]
  |  Branch (879:55): [True: 0, False: 0]
  ------------------
  880|  49.3k|            {
  881|       |                /* If format conversion jobs were not issued in pic_init() add them here */
  882|  49.3k|                if((0 == ps_codec->u4_enable_fmt_conv_ahead) ||
  ------------------
  |  Branch (882:20): [True: 49.3k, False: 0]
  ------------------
  883|      0|                                (ps_codec->i4_disp_buf_id == ps_proc->i4_cur_pic_buf_id))
  ------------------
  |  Branch (883:33): [True: 0, False: 0]
  ------------------
  884|   686k|                    for(i = 0; i < ps_sps->i2_pic_ht_in_ctb; i++)
  ------------------
  |  Branch (884:32): [True: 637k, False: 49.3k]
  ------------------
  885|   637k|                    {
  886|   637k|                        proc_job_t s_job;
  887|   637k|                        IHEVCD_ERROR_T ret;
  888|   637k|                        s_job.i4_cmd = CMD_FMTCONV;
  889|   637k|                        s_job.i2_ctb_cnt = 0;
  890|   637k|                        s_job.i2_ctb_x = 0;
  891|   637k|                        s_job.i2_ctb_y = i;
  892|   637k|                        s_job.i2_slice_idx = 0;
  893|   637k|                        s_job.i4_tu_coeff_data_ofst = 0;
  894|   637k|                        ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq,
  895|   637k|                                                &s_job, sizeof(proc_job_t), 1);
  896|   637k|                        if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (896:28): [True: 0, False: 637k]
  ------------------
  897|      0|                            return (WORD32)ret;
  898|   637k|                    }
  899|  49.3k|            }
  900|       |            /* Reached end of frame : Signal terminate */
  901|       |            /* The terminate flag is checked only after all the jobs are dequeued */
  902|  51.2k|            ret = ihevcd_jobq_terminate((jobq_t *)ps_codec->s_parse.pv_proc_jobq);
  903|       |
  904|   759k|            while(1)
  ------------------
  |  Branch (904:19): [True: 759k, Folded]
  ------------------
  905|   759k|            {
  906|   759k|                IHEVCD_ERROR_T ret;
  907|   759k|                proc_job_t s_job;
  908|   759k|                process_ctxt_t *ps_proc;
  909|       |
  910|       |                /* i4_num_cores - 1 contexts are currently being used by other threads */
  911|   759k|                ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1];
  912|       |
  913|   759k|                ret = ihevcd_jobq_dequeue((jobq_t *)ps_proc->pv_proc_jobq, &s_job,
  914|   759k|                                          sizeof(proc_job_t), 1);
  915|   759k|                if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (915:20): [True: 51.2k, False: 707k]
  ------------------
  916|  51.2k|                    break;
  917|       |
  918|   707k|                ps_proc->i4_ctb_cnt = s_job.i2_ctb_cnt;
  919|   707k|                ps_proc->i4_ctb_x = s_job.i2_ctb_x;
  920|   707k|                ps_proc->i4_ctb_y = s_job.i2_ctb_y;
  921|   707k|                ps_proc->i4_cur_slice_idx = s_job.i2_slice_idx;
  922|       |
  923|   707k|                if(CMD_PROCESS == s_job.i4_cmd)
  ------------------
  |  Branch (923:20): [True: 465k, False: 242k]
  ------------------
  924|   465k|                {
  925|   465k|                    ihevcd_init_proc_ctxt(ps_proc, s_job.i4_tu_coeff_data_ofst);
  926|       |
  927|   465k|                    ihevcd_process(ps_proc);
  928|   465k|                }
  929|   242k|                else if(CMD_FMTCONV == s_job.i4_cmd)
  ------------------
  |  Branch (929:25): [True: 242k, False: 0]
  ------------------
  930|   242k|                {
  931|   242k|                    sps_t *ps_sps = ps_codec->s_parse.ps_sps;
  932|   242k|                    WORD32 num_rows = 1 << ps_sps->i1_log2_ctb_size;
  933|   242k|                    if(0 == ps_proc->i4_init_done)
  ------------------
  |  Branch (933:24): [True: 5.00k, False: 237k]
  ------------------
  934|  5.00k|                    {
  935|  5.00k|                        ihevcd_init_proc_ctxt(ps_proc, 0);
  936|  5.00k|                    }
  937|       |
  938|   242k|                    num_rows = MIN(num_rows, (ps_codec->i4_disp_ht - (s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size)));
  ------------------
  |  |   43|   242k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 222k, False: 20.5k]
  |  |  ------------------
  ------------------
  939|   242k|                    if(num_rows < 0)
  ------------------
  |  Branch (939:24): [True: 723, False: 242k]
  ------------------
  940|    723|                        num_rows = 0;
  941|       |
  942|   242k|                    ihevcd_fmt_conv(ps_codec, ps_proc,
  943|   242k|                                    ps_dec_ip->s_out_buffer.pu1_bufs[0],
  944|   242k|                                    ps_dec_ip->s_out_buffer.pu1_bufs[1],
  945|   242k|                                    ps_dec_ip->s_out_buffer.pu1_bufs[2],
  946|   242k|                                    s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size,
  947|   242k|                                    num_rows);
  948|   242k|                }
  949|   707k|            }
  950|  51.2k|        }
  951|       |        /* In case of non-shared mode and while running in single core mode, then convert/copy the frame to output buffer */
  952|       |        /* Only if the codec is in non-shared mode or in shared mode but needs 420P output */
  953|  21.6k|        else if((ps_codec->ps_disp_buf) && ((0 == ps_codec->i4_share_disp_buf) ||
  ------------------
  |  Branch (953:17): [True: 21.1k, False: 558]
  |  Branch (953:45): [True: 21.1k, False: 0]
  ------------------
  954|      0|                                            (IV_YUV_420P == ps_codec->e_chroma_fmt)) &&
  ------------------
  |  Branch (954:45): [True: 0, False: 0]
  ------------------
  955|  21.1k|                        (ps_codec->s_parse.i4_end_of_frame))
  ------------------
  |  Branch (955:25): [True: 21.1k, False: 0]
  ------------------
  956|  21.1k|        {
  957|  21.1k|            process_ctxt_t *ps_proc = &ps_codec->as_process[proc_idx];
  958|       |            /* Set remaining number of rows to be processed */
  959|  21.1k|            ps_codec->s_fmt_conv.i4_num_rows = ps_codec->i4_disp_ht
  960|  21.1k|                            - ps_codec->s_fmt_conv.i4_cur_row;
  961|  21.1k|            if(0 == ps_proc->i4_init_done)
  ------------------
  |  Branch (961:16): [True: 0, False: 21.1k]
  ------------------
  962|      0|            {
  963|      0|                ihevcd_init_proc_ctxt(ps_proc, 0);
  964|      0|            }
  965|       |
  966|  21.1k|            if(ps_codec->s_fmt_conv.i4_num_rows < 0)
  ------------------
  |  Branch (966:16): [True: 0, False: 21.1k]
  ------------------
  967|      0|                ps_codec->s_fmt_conv.i4_num_rows = 0;
  968|       |
  969|  21.1k|            ret = ihevcd_fmt_conv(ps_codec, ps_proc,
  970|  21.1k|                                  ps_dec_ip->s_out_buffer.pu1_bufs[0],
  971|  21.1k|                                  ps_dec_ip->s_out_buffer.pu1_bufs[1],
  972|  21.1k|                                  ps_dec_ip->s_out_buffer.pu1_bufs[2],
  973|  21.1k|                                  ps_codec->s_fmt_conv.i4_cur_row,
  974|  21.1k|                                  ps_codec->s_fmt_conv.i4_num_rows);
  975|  21.1k|            ps_codec->s_fmt_conv.i4_cur_row += ps_codec->s_fmt_conv.i4_num_rows;
  976|       |
  977|  21.1k|        }
  978|       |
  979|       |
  980|  72.9k|        DEBUG_DUMP_MV_MAP(ps_codec);
  981|       |
  982|       |        /* Mark MV Buf as needed for reference */
  983|  72.9k|        ihevc_buf_mgr_set_status((buf_mgr_t *)ps_codec->pv_mv_buf_mgr,
  984|  72.9k|                                 ps_codec->as_process[proc_idx].i4_cur_mv_bank_buf_id,
  985|  72.9k|                                 BUF_MGR_REF);
  ------------------
  |  |   40|  72.9k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  986|       |
  987|       |        /* Mark pic buf as needed for reference */
  988|  72.9k|        ihevc_buf_mgr_set_status((buf_mgr_t *)ps_codec->pv_pic_buf_mgr,
  989|  72.9k|                                 ps_codec->as_process[proc_idx].i4_cur_pic_buf_id,
  990|  72.9k|                                 BUF_MGR_REF);
  ------------------
  |  |   40|  72.9k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  991|       |
  992|       |        /* Mark pic buf as needed for display */
  993|  72.9k|        ihevc_buf_mgr_set_status((buf_mgr_t *)ps_codec->pv_pic_buf_mgr,
  994|  72.9k|                                 ps_codec->as_process[proc_idx].i4_cur_pic_buf_id,
  995|  72.9k|                                 BUF_MGR_DISP);
  ------------------
  |  |   41|  72.9k|#define BUF_MGR_DISP        (1 << 2)
  ------------------
  996|       |
  997|       |        /* Insert the current picture as short term reference */
  998|  72.9k|        ihevc_dpb_mgr_insert_ref((dpb_mgr_t *)ps_codec->pv_dpb_mgr,
  999|  72.9k|                                 ps_codec->as_process[proc_idx].ps_cur_pic,
 1000|  72.9k|                                 ps_codec->as_process[proc_idx].i4_cur_pic_buf_id);
 1001|       |
 1002|       |        /* If a frame was displayed (in non-shared mode), then release it from display manager */
 1003|  72.9k|        if((0 == ps_codec->i4_share_disp_buf) && (ps_codec->ps_disp_buf))
  ------------------
  |  Branch (1003:12): [True: 72.9k, False: 0]
  |  Branch (1003:50): [True: 70.4k, False: 2.46k]
  ------------------
 1004|  70.4k|            ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_pic_buf_mgr,
 1005|  70.4k|                                  ps_codec->i4_disp_buf_id, BUF_MGR_DISP);
  ------------------
  |  |   41|  70.4k|#define BUF_MGR_DISP        (1 << 2)
  ------------------
 1006|       |
 1007|       |        /* Wait for threads */
 1008|   173k|        for(i = 0; i < (ps_codec->i4_num_cores - 1); i++)
  ------------------
  |  Branch (1008:20): [True: 100k, False: 72.9k]
  ------------------
 1009|   100k|        {
 1010|   100k|            if(ps_codec->ai4_process_thread_created[i])
  ------------------
  |  Branch (1010:16): [True: 100k, False: 0]
  ------------------
 1011|   100k|            {
 1012|   100k|                if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1012:20): [True: 100k, False: 0]
  ------------------
 1013|   100k|                {
 1014|   100k|                    ret = ithread_mutex_lock(ps_codec->apv_proc_done_mutex[i]);
 1015|   100k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   100k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 100k]
  |  |  ------------------
  ------------------
 1016|       |
 1017|   133k|                    while(!ps_codec->ai4_process_done[i])
  ------------------
  |  Branch (1017:27): [True: 32.8k, False: 100k]
  ------------------
 1018|  32.8k|                    {
 1019|  32.8k|                        ithread_cond_wait(ps_codec->apv_proc_done_condition[i],
 1020|  32.8k|                                          ps_codec->apv_proc_done_mutex[i]);
 1021|  32.8k|                    }
 1022|   100k|                    ps_codec->ai4_process_done[i] = 0;
 1023|   100k|                    ret = ithread_mutex_unlock(ps_codec->apv_proc_done_mutex[i]);
 1024|   100k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   100k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 100k]
  |  |  ------------------
  ------------------
 1025|   100k|                }
 1026|      0|                else
 1027|      0|                {
 1028|      0|                    ithread_join(ps_codec->apv_process_thread_handle[i], NULL);
 1029|      0|                    ps_codec->ai4_process_thread_created[i] = 0;
 1030|      0|                }
 1031|   100k|            }
 1032|   100k|        }
 1033|       |
 1034|  72.9k|        DEBUG_VALIDATE_PADDED_REGION(&ps_codec->as_process[proc_idx]);
 1035|  72.9k|        if(ps_codec->u4_pic_cnt > 0)
  ------------------
  |  Branch (1035:12): [True: 51.9k, False: 20.9k]
  ------------------
 1036|  51.9k|        {
 1037|  51.9k|            DEBUG_DUMP_PIC_PU(ps_codec);
 1038|  51.9k|        }
 1039|  72.9k|        DEBUG_DUMP_PIC_BUFFERS(ps_codec);
 1040|       |
 1041|       |        /* Increment the number of pictures decoded */
 1042|  72.9k|        ps_codec->u4_pic_cnt++;
 1043|  72.9k|    }
 1044|   296k|    ihevcd_fill_outargs(ps_codec, ps_hevcd_dec_ip, ps_hevcd_dec_op);
 1045|       |
 1046|   296k|    if(1 == ps_dec_op->u4_output_present)
  ------------------
  |  Branch (1046:8): [True: 70.4k, False: 225k]
  ------------------
 1047|  70.4k|    {
 1048|  70.4k|        WORD32 xpos = ps_codec->i4_disp_wd - 32 - LOGO_WD;
  ------------------
  |  |   41|  70.4k|#define LOGO_WD 90
  ------------------
 1049|  70.4k|        WORD32 ypos = ps_codec->i4_disp_ht - 32 - LOGO_HT;
  ------------------
  |  |   42|  70.4k|#define LOGO_HT 36
  ------------------
 1050|       |
 1051|  70.4k|        if(ypos < 0)
  ------------------
  |  Branch (1051:12): [True: 15.9k, False: 54.5k]
  ------------------
 1052|  15.9k|            ypos = 0;
 1053|       |
 1054|  70.4k|        if(xpos < 0)
  ------------------
  |  Branch (1054:12): [True: 45.1k, False: 25.3k]
  ------------------
 1055|  45.1k|            xpos = 0;
 1056|       |
 1057|  70.4k|        INSERT_LOGO(ps_dec_ip->s_out_buffer.pu1_bufs[0],
 1058|  70.4k|                    ps_dec_ip->s_out_buffer.pu1_bufs[1],
 1059|  70.4k|                    ps_dec_ip->s_out_buffer.pu1_bufs[2], ps_codec->i4_disp_strd,
 1060|  70.4k|                    xpos,
 1061|  70.4k|                    ypos,
 1062|  70.4k|                    ps_codec->e_chroma_fmt,
 1063|  70.4k|                    ps_codec->i4_disp_wd,
 1064|  70.4k|                    ps_codec->i4_disp_ht);
 1065|  70.4k|    }
 1066|       |
 1067|       |
 1068|   296k|    return ret;
 1069|   296k|}
ihevcd_decode.c:ihevcd_fill_outargs:
  188|   296k|{
  189|       |
  190|   296k|    ihevcd_cxa_video_decode_ip_t *ps_hevcd_dec_ip;
  191|   296k|    ihevcd_cxa_video_decode_op_t *ps_hevcd_dec_op;
  192|   296k|    ivd_video_decode_ip_t *ps_dec_ip;
  193|   296k|    ivd_video_decode_op_t *ps_dec_op;
  194|       |
  195|   296k|    ps_hevcd_dec_ip = (ihevcd_cxa_video_decode_ip_t *)pv_api_ip;
  196|   296k|    ps_hevcd_dec_op = (ihevcd_cxa_video_decode_op_t *)pv_api_op;
  197|   296k|    ps_dec_ip = &ps_hevcd_dec_ip->s_ivd_video_decode_ip_t;
  198|   296k|    ps_dec_op = &ps_hevcd_dec_op->s_ivd_video_decode_op_t;
  199|       |
  200|   296k|    ps_dec_op->u4_error_code = ihevcd_map_error((IHEVCD_ERROR_T)ps_codec->i4_error_code);
  201|   296k|    ps_dec_op->u4_num_bytes_consumed = ps_dec_ip->u4_num_Bytes
  202|   296k|                    - ps_codec->i4_bytes_remaining;
  203|   296k|    if(ps_codec->i4_sps_done)
  ------------------
  |  Branch (203:8): [True: 181k, False: 115k]
  ------------------
  204|   181k|    {
  205|   181k|        ps_dec_op->u4_pic_wd = ps_codec->i4_disp_wd;
  206|   181k|        ps_dec_op->u4_pic_ht = ps_codec->i4_disp_ht;
  207|   181k|        ps_dec_op->u4_bit_depth = ps_codec->i4_bit_depth_luma;
  208|   181k|    }
  209|   115k|    else
  210|   115k|    {
  211|   115k|        ps_dec_op->u4_pic_wd = 0;
  212|   115k|        ps_dec_op->u4_pic_ht = 0;
  213|   115k|        ps_dec_op->u4_bit_depth = 0;
  214|   115k|    }
  215|       |
  216|   296k|    ps_dec_op->e_pic_type = ps_codec->e_dec_pic_type;
  217|   296k|    ps_dec_op->u4_frame_decoded_flag = ps_codec->i4_pic_present;
  218|   296k|    ps_dec_op->u4_new_seq = 0;
  219|       |
  220|   296k|    ps_dec_op->u4_output_present = 0;
  221|   296k|    ps_dec_op->u4_progressive_frame_flag = 1;
  222|   296k|    ps_dec_op->i4_display_index = -1;
  223|   296k|    ps_dec_op->i4_reorder_depth = -1;
  224|   296k|    if(ps_codec->i4_sps_done)
  ------------------
  |  Branch (224:8): [True: 181k, False: 115k]
  ------------------
  225|   181k|    {
  226|   181k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
  227|   181k|        profile_tier_lvl_info_t *ps_ptl;
  228|   181k|        ps_ptl = &ps_sps->s_ptl;
  229|   181k|        if((0 == ps_ptl->s_ptl_gen.i1_general_progressive_source_flag) &&
  ------------------
  |  Branch (229:12): [True: 138k, False: 42.4k]
  ------------------
  230|   138k|           (1 == ps_ptl->s_ptl_gen.i1_general_interlaced_source_flag))
  ------------------
  |  Branch (230:12): [True: 15.6k, False: 122k]
  ------------------
  231|  15.6k|        {
  232|  15.6k|            ps_dec_op->u4_progressive_frame_flag = 0;
  233|  15.6k|        }
  234|   181k|        ps_dec_op->i4_reorder_depth =
  235|   181k|                        ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1];
  236|   181k|    }
  237|       |
  238|   296k|    ps_dec_op->u4_is_ref_flag = 1;
  239|   296k|    ps_dec_op->e_output_format = ps_codec->e_chroma_fmt;
  240|   296k|    ps_dec_op->u4_is_ref_flag = 1;
  241|       |
  242|   296k|    ps_dec_op->e4_fld_type = IV_FLD_TYPE_DEFAULT;
  243|   296k|    ps_dec_op->u4_ts = (UWORD32)(-1);
  244|   296k|    ps_dec_op->u4_disp_buf_id = ps_codec->i4_disp_buf_id;
  245|   296k|    if(ps_codec->i4_flush_mode)
  ------------------
  |  Branch (245:8): [True: 655, False: 296k]
  ------------------
  246|    655|    {
  247|    655|        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|    655|        ps_dec_op->u4_is_ref_flag = 0;
  250|    655|        ps_dec_op->e_pic_type = IV_NA_FRAME;
  251|    655|        ps_dec_op->u4_frame_decoded_flag = 0;
  252|       |
  253|    655|    }
  254|   296k|    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|   296k|    if(ps_codec->ps_disp_buf)
  ------------------
  |  Branch (257:8): [True: 70.4k, False: 226k]
  ------------------
  258|  70.4k|    {
  259|  70.4k|        pic_buf_t *ps_disp_buf = ps_codec->ps_disp_buf;
  260|  70.4k|#ifndef DISABLE_SEI
  261|  70.4k|        sei_params_t *ps_sei = &ps_disp_buf->s_sei_params;
  262|       |
  263|  70.4k|        if(ps_sei->i1_sei_parameters_present_flag &&
  ------------------
  |  Branch (263:12): [True: 561, False: 69.9k]
  ------------------
  264|    561|           ps_sei->i1_pic_timing_params_present_flag)
  ------------------
  |  Branch (264:12): [True: 421, False: 140]
  ------------------
  265|    421|        {
  266|    421|            UWORD32 u4_pic_struct;
  267|    421|            u4_pic_struct = ps_sei->s_pic_timing_sei_params.u4_pic_struct;
  268|    421|            switch(u4_pic_struct)
  269|    421|            {
  270|     67|                case 1:
  ------------------
  |  Branch (270:17): [True: 67, False: 354]
  ------------------
  271|     67|                    ps_dec_op->e4_fld_type = IV_TOP_FLD;
  272|     67|                    ps_dec_op->u4_progressive_frame_flag = 0;
  273|     67|                    break;
  274|     73|                case 2:
  ------------------
  |  Branch (274:17): [True: 73, False: 348]
  ------------------
  275|     73|                    ps_dec_op->e4_fld_type = IV_BOT_FLD;
  276|     73|                    ps_dec_op->u4_progressive_frame_flag = 0;
  277|     73|                    break;
  278|    281|                case 0:
  ------------------
  |  Branch (278:17): [True: 281, False: 140]
  ------------------
  279|    281|                default:
  ------------------
  |  Branch (279:17): [True: 0, False: 421]
  ------------------
  280|    281|                    ps_dec_op->e4_fld_type = IV_FLD_TYPE_DEFAULT;
  281|    281|                    ps_dec_op->u4_progressive_frame_flag = 1;
  282|    281|                    break;
  283|    421|            }
  284|    421|        }
  285|  70.4k|#endif
  286|  70.4k|        ps_dec_op->i4_display_index = ps_disp_buf->i4_abs_poc;
  287|  70.4k|        ps_dec_op->u4_output_present = 1;
  288|  70.4k|        ps_dec_op->u4_ts = ps_disp_buf->u4_ts;
  289|  70.4k|        if((ps_codec->i4_flush_mode == 0) && (ps_codec->s_parse.i4_end_of_frame == 0))
  ------------------
  |  Branch (289:12): [True: 70.4k, False: 0]
  |  Branch (289:46): [True: 0, False: 70.4k]
  ------------------
  290|      0|            ps_dec_op->u4_output_present = 0;
  291|  70.4k|        ps_dec_op->s_disp_frm_buf.u4_y_wd = ps_codec->i4_disp_wd;
  292|  70.4k|        ps_dec_op->s_disp_frm_buf.u4_y_ht = ps_codec->i4_disp_ht;
  293|       |
  294|  70.4k|        if(ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (294:12): [True: 0, False: 70.4k]
  ------------------
  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|  70.4k|        else
  325|  70.4k|        {
  326|  70.4k|            ps_dec_op->s_disp_frm_buf.pv_y_buf =
  327|  70.4k|                            ps_dec_ip->s_out_buffer.pu1_bufs[0];
  328|  70.4k|            ps_dec_op->s_disp_frm_buf.pv_u_buf =
  329|  70.4k|                            ps_dec_ip->s_out_buffer.pu1_bufs[1];
  330|  70.4k|            ps_dec_op->s_disp_frm_buf.pv_v_buf =
  331|  70.4k|                            ps_dec_ip->s_out_buffer.pu1_bufs[2];
  332|  70.4k|            ps_dec_op->s_disp_frm_buf.u4_y_strd = ps_codec->i4_disp_strd;
  333|  70.4k|        }
  334|       |
  335|  70.4k|        if((IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (335:12): [True: 10.2k, False: 60.2k]
  ------------------
  336|  60.2k|                        || (IV_YUV_420SP_UV == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (336:28): [True: 8.99k, False: 51.2k]
  ------------------
  337|  19.2k|        {
  338|  19.2k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = ALIGN2(ps_dec_op->s_disp_frm_buf.u4_y_strd);
  ------------------
  |  |   55|  19.2k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  339|  19.2k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = 0;
  340|  19.2k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = ALIGN2(ps_dec_op->s_disp_frm_buf.u4_y_wd);
  ------------------
  |  |   55|  19.2k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  341|  19.2k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = 0;
  342|  19.2k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = (ps_dec_op->s_disp_frm_buf.u4_y_ht + 1) / 2;
  343|  19.2k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = 0;
  344|  19.2k|        }
  345|  51.2k|        else if(IV_YUV_420P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (345:17): [True: 36.6k, False: 14.6k]
  ------------------
  346|  36.6k|        {
  347|  36.6k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  348|  36.6k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  349|  36.6k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  350|  36.6k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  351|  36.6k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = (ps_dec_op->s_disp_frm_buf.u4_y_ht + 1) / 2;
  352|  36.6k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = (ps_dec_op->s_disp_frm_buf.u4_y_ht + 1) / 2;
  353|  36.6k|        }
  354|  14.6k|        else if(IV_YUV_444P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (354:17): [True: 0, False: 14.6k]
  ------------------
  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|  14.6k|        else if(IV_GRAY == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (363:17): [True: 12.6k, False: 1.96k]
  ------------------
  364|  12.6k|        {
  365|  12.6k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = 0;
  366|  12.6k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = 0;
  367|  12.6k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = 0;
  368|  12.6k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = 0;
  369|  12.6k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = 0;
  370|  12.6k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = 0;
  371|  12.6k|        }
  372|  1.96k|        else if(IV_YUV_422P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (372:17): [True: 1.96k, False: 0]
  ------------------
  373|  1.96k|        {
  374|  1.96k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  375|  1.96k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  376|  1.96k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  377|  1.96k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  378|  1.96k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht;
  379|  1.96k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht;
  380|  1.96k|        }
  381|       |
  382|  70.4k|    }
  383|   226k|    else if(ps_codec->i4_flush_mode)
  ------------------
  |  Branch (383:13): [True: 655, False: 225k]
  ------------------
  384|    655|    {
  385|    655|        ps_dec_op->u4_error_code = IHEVCD_END_OF_SEQUENCE;
  386|       |        /* Come out of flush mode */
  387|    655|        ps_codec->i4_flush_mode = 0;
  388|    655|    }
  389|       |
  390|   296k|    if(ps_codec->u1_enable_cu_info && ps_dec_op->u4_output_present)
  ------------------
  |  Branch (390:8): [True: 0, False: 296k]
  |  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|   296k|}
ihevcd_decode.c:ihevcd_map_error:
  126|   296k|{
  127|   296k|    UWORD32 error_code = 0;
  128|   296k|    error_code = e_error;
  129|   296k|    switch(error_code)
  130|   296k|    {
  131|   206k|        case IHEVCD_SUCCESS :
  ------------------
  |  Branch (131:9): [True: 206k, False: 90.7k]
  ------------------
  132|   206k|            break;
  133|      0|        case IHEVCD_INIT_NOT_DONE:
  ------------------
  |  Branch (133:9): [True: 0, False: 296k]
  ------------------
  134|      0|        case IHEVCD_LEVEL_UNSUPPORTED:
  ------------------
  |  Branch (134:9): [True: 0, False: 296k]
  ------------------
  135|      0|        case IHEVCD_NUM_REF_UNSUPPORTED:
  ------------------
  |  Branch (135:9): [True: 0, False: 296k]
  ------------------
  136|      0|        case IHEVCD_NUM_REORDER_UNSUPPORTED:
  ------------------
  |  Branch (136:9): [True: 0, False: 296k]
  ------------------
  137|      0|        case IHEVCD_NUM_EXTRA_DISP_UNSUPPORTED:
  ------------------
  |  Branch (137:9): [True: 0, False: 296k]
  ------------------
  138|      0|        case IHEVCD_INSUFFICIENT_MEM_MVBANK:
  ------------------
  |  Branch (138:9): [True: 0, False: 296k]
  ------------------
  139|      0|        case IHEVCD_INSUFFICIENT_MEM_PICBUF:
  ------------------
  |  Branch (139:9): [True: 0, False: 296k]
  ------------------
  140|     66|        case IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC:
  ------------------
  |  Branch (140:9): [True: 66, False: 296k]
  ------------------
  141|  2.63k|        case IHEVCD_UNSUPPORTED_BIT_DEPTH:
  ------------------
  |  Branch (141:9): [True: 2.56k, False: 294k]
  ------------------
  142|  2.63k|        case IVD_MEM_ALLOC_FAILED:
  ------------------
  |  Branch (142:9): [True: 0, False: 296k]
  ------------------
  143|  3.90k|        case IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED:
  ------------------
  |  Branch (143:9): [True: 1.27k, False: 295k]
  ------------------
  144|  3.90k|            error_code |= 1 << IVD_FATALERROR;
  145|  3.90k|            break;
  146|      0|        case IHEVCD_INVALID_DISP_STRD:
  ------------------
  |  Branch (146:9): [True: 0, False: 296k]
  ------------------
  147|      0|        case IHEVCD_CXA_VERS_BUF_INSUFFICIENT:
  ------------------
  |  Branch (147:9): [True: 0, False: 296k]
  ------------------
  148|      0|        case IHEVCD_UNSUPPORTED_VPS_ID:
  ------------------
  |  Branch (148:9): [True: 0, False: 296k]
  ------------------
  149|  24.1k|        case IHEVCD_UNSUPPORTED_SPS_ID:
  ------------------
  |  Branch (149:9): [True: 24.1k, False: 272k]
  ------------------
  150|  25.0k|        case IHEVCD_UNSUPPORTED_PPS_ID:
  ------------------
  |  Branch (150:9): [True: 947, False: 295k]
  ------------------
  151|  25.0k|        case IHEVCD_BUF_MGR_ERROR:
  ------------------
  |  Branch (151:9): [True: 0, False: 296k]
  ------------------
  152|  25.5k|        case IHEVCD_NO_FREE_MVBANK:
  ------------------
  |  Branch (152:9): [True: 454, False: 296k]
  ------------------
  153|  25.5k|        case IHEVCD_NO_FREE_PICBUF:
  ------------------
  |  Branch (153:9): [True: 42, False: 296k]
  ------------------
  154|  25.5k|        case IHEVCD_SLICE_IN_HEADER_MODE:
  ------------------
  |  Branch (154:9): [True: 0, False: 296k]
  ------------------
  155|  25.5k|        case IHEVCD_END_OF_SEQUENCE:
  ------------------
  |  Branch (155:9): [True: 0, False: 296k]
  ------------------
  156|  25.5k|            break;
  157|  61.2k|        default:
  ------------------
  |  Branch (157:9): [True: 61.2k, False: 235k]
  ------------------
  158|  61.2k|            break;
  159|   296k|    }
  160|   296k|    return error_code;
  161|   296k|}

ihevcd_fmt_conv_420sp_to_420sp:
  127|   179k|{
  128|   179k|    UWORD8 *pu1_src, *pu1_dst;
  129|   179k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  130|   179k|    WORD32 i;
  131|       |
  132|       |    /* copy luma */
  133|   179k|    pu1_src = (UWORD8 *)pu1_y_src;
  134|   179k|    pu1_dst = (UWORD8 *)pu1_y_dst;
  135|       |
  136|   179k|    num_rows = ht;
  137|   179k|    num_cols = wd;
  138|       |
  139|   179k|    src_strd = src_y_strd;
  140|   179k|    dst_strd = dst_y_strd;
  141|       |
  142|  7.60M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (142:16): [True: 7.42M, False: 179k]
  ------------------
  143|  7.42M|    {
  144|  7.42M|        memcpy(pu1_dst, pu1_src, num_cols);
  145|  7.42M|        pu1_dst += dst_strd;
  146|  7.42M|        pu1_src += src_strd;
  147|  7.42M|    }
  148|       |
  149|       |    /* copy U and V */
  150|   179k|    pu1_src = (UWORD8 *)pu1_uv_src;
  151|   179k|    pu1_dst = (UWORD8 *)pu1_uv_dst;
  152|       |
  153|   179k|    num_rows = ht >> 1;
  154|   179k|    num_cols = wd;
  155|       |
  156|   179k|    src_strd = src_uv_strd;
  157|   179k|    dst_strd = dst_uv_strd;
  158|       |
  159|  4.18M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (159:16): [True: 4.00M, False: 179k]
  ------------------
  160|  4.00M|    {
  161|  4.00M|        memcpy(pu1_dst, pu1_src, num_cols);
  162|  4.00M|        pu1_dst += dst_strd;
  163|  4.00M|        pu1_src += src_strd;
  164|  4.00M|    }
  165|   179k|    return;
  166|   179k|}
ihevcd_hbd_fmt_conv_420sp_to_420sp:
  178|  25.4k|{
  179|  25.4k|    UWORD8 *pu1_src, *pu1_dst;
  180|  25.4k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  181|  25.4k|    WORD32 i;
  182|       |
  183|       |    /* copy luma */
  184|  25.4k|    pu1_src = (UWORD8 *)pu2_y_src;
  185|  25.4k|    pu1_dst = (UWORD8 *)pu2_y_dst;
  186|       |
  187|  25.4k|    num_rows = ht;
  188|  25.4k|    num_cols = wd * sizeof(UWORD16);
  189|       |
  190|  25.4k|    src_strd = src_y_strd * sizeof(UWORD16);
  191|  25.4k|    dst_strd = dst_y_strd * sizeof(UWORD16);
  192|       |
  193|  1.54M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (193:16): [True: 1.51M, False: 25.4k]
  ------------------
  194|  1.51M|    {
  195|  1.51M|        memcpy(pu1_dst, pu1_src, num_cols);
  196|  1.51M|        pu1_dst += dst_strd;
  197|  1.51M|        pu1_src += src_strd;
  198|  1.51M|    }
  199|       |
  200|       |    /* copy U and V */
  201|  25.4k|    pu1_src = (UWORD8 *)pu2_uv_src;
  202|  25.4k|    pu1_dst = (UWORD8 *)pu2_uv_dst;
  203|       |
  204|  25.4k|    num_rows = ht >> 1;
  205|  25.4k|    num_cols = wd * sizeof(UWORD16);
  206|       |
  207|  25.4k|    src_strd = src_uv_strd * sizeof(UWORD16);
  208|  25.4k|    dst_strd = dst_uv_strd * sizeof(UWORD16);
  209|       |
  210|   803k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (210:16): [True: 777k, False: 25.4k]
  ------------------
  211|   777k|    {
  212|   777k|        memcpy(pu1_dst, pu1_src, num_cols);
  213|   777k|        pu1_dst += dst_strd;
  214|   777k|        pu1_src += src_strd;
  215|   777k|    }
  216|  25.4k|    return;
  217|  25.4k|}
ihevcd_fmt_conv_luma_copy:
  260|   234k|{
  261|   234k|    UWORD8 *pu1_src, *pu1_dst;
  262|   234k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  263|   234k|    WORD32 i;
  264|       |
  265|       |    /* copy luma */
  266|   234k|    pu1_src = (UWORD8 *)pu1_y_src;
  267|   234k|    pu1_dst = (UWORD8 *)pu1_y_dst;
  268|       |
  269|   234k|    num_rows = ht;
  270|   234k|    num_cols = wd;
  271|       |
  272|   234k|    src_strd = src_y_strd;
  273|   234k|    dst_strd = dst_y_strd;
  274|       |
  275|  7.72M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (275:16): [True: 7.48M, False: 234k]
  ------------------
  276|  7.48M|    {
  277|  7.48M|        memcpy(pu1_dst, pu1_src, num_cols);
  278|  7.48M|        pu1_dst += dst_strd;
  279|  7.48M|        pu1_src += src_strd;
  280|  7.48M|    }
  281|   234k|    return;
  282|   234k|}
ihevcd_fmt_conv_400_to_420p:
  330|  2.02k|{
  331|  2.02k|    ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd);
  332|  58.7k|    for(int i = 0; i < ALIGN2(ht) / 2; i++)
  ------------------
  |  |   55|  58.7k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  |  Branch (332:20): [True: 56.7k, False: 2.02k]
  ------------------
  333|  56.7k|    {
  334|  56.7k|        memset(pu1_u_dst, 128, ALIGN2(wd) / 2);
  ------------------
  |  |   55|  56.7k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  335|  56.7k|        memset(pu1_v_dst, 128, ALIGN2(wd) / 2);
  ------------------
  |  |   55|  56.7k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  336|  56.7k|        pu1_u_dst += dst_uv_strd;
  337|  56.7k|        pu1_v_dst += dst_uv_strd;
  338|  56.7k|    }
  339|  2.02k|    return;
  340|  2.02k|}
ihevcd_hbd_fmt_conv_400_to_420p:
  372|    866|{
  373|    866|    UWORD16 *pu2_src = pu2_y_src;
  374|    866|    UWORD16 *pu2_dst = pu2_y_dst;
  375|    866|    WORD32 num_rows = ht;
  376|    866|    WORD32 num_cols = wd;
  377|    866|    WORD32 src_strd = src_y_strd;
  378|    866|    WORD32 dst_strd = dst_y_strd;
  379|    866|    WORD32 i, j;
  380|    866|    UWORD16 neutral;
  381|       |
  382|  57.1k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (382:16): [True: 56.3k, False: 866]
  ------------------
  383|  56.3k|    {
  384|  56.3k|        memcpy(pu2_dst, pu2_src, num_cols * sizeof(UWORD16));
  385|  56.3k|        pu2_dst += dst_strd;
  386|  56.3k|        pu2_src += src_strd;
  387|  56.3k|    }
  388|       |
  389|    866|    neutral = (UWORD16)(1 << (bit_depth - 1));
  390|  31.0k|    for(i = 0; i < ALIGN2(ht) / 2; i++)
  ------------------
  |  |   55|  31.0k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  |  Branch (390:16): [True: 30.1k, False: 866]
  ------------------
  391|  30.1k|    {
  392|  1.51M|        for(j = 0; j < ALIGN2(wd) / 2; j++)
  ------------------
  |  |   55|  1.51M|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  |  Branch (392:20): [True: 1.48M, False: 30.1k]
  ------------------
  393|  1.48M|        {
  394|  1.48M|            pu2_u_dst[j] = neutral;
  395|  1.48M|            pu2_v_dst[j] = neutral;
  396|  1.48M|        }
  397|  30.1k|        pu2_u_dst += dst_uv_strd;
  398|  30.1k|        pu2_v_dst += dst_uv_strd;
  399|  30.1k|    }
  400|    866|    return;
  401|    866|}
ihevcd_fmt_conv_420sp_to_420p:
  609|  95.8k|{
  610|  95.8k|    UWORD8 *pu1_src, *pu1_dst;
  611|  95.8k|    UWORD8 *pu1_u_src, *pu1_v_src;
  612|  95.8k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  613|  95.8k|    WORD32 i, j;
  614|       |
  615|  95.8k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (615:8): [True: 0, False: 95.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|  95.8k|    if(is_u_first)
  ------------------
  |  Branch (635:8): [True: 95.6k, False: 191]
  ------------------
  636|  95.6k|    {
  637|  95.6k|        pu1_u_src = (UWORD8 *)pu1_uv_src;
  638|  95.6k|        pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
  639|  95.6k|    }
  640|    191|    else
  641|    191|    {
  642|    191|        pu1_u_src = (UWORD8 *)pu1_uv_src + 1;
  643|    191|        pu1_v_src = (UWORD8 *)pu1_uv_src;
  644|    191|    }
  645|       |
  646|       |
  647|  95.8k|    num_rows = ht >> 1;
  648|  95.8k|    num_cols = wd >> 1;
  649|       |
  650|  95.8k|    src_strd = src_uv_strd;
  651|  95.8k|    dst_strd = dst_uv_strd;
  652|       |
  653|  3.36M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (653:16): [True: 3.27M, False: 95.8k]
  ------------------
  654|  3.27M|    {
  655|   701M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (655:20): [True: 698M, False: 3.27M]
  ------------------
  656|   698M|        {
  657|   698M|            pu1_u_dst[j] = pu1_u_src[j * 2];
  658|   698M|            pu1_v_dst[j] = pu1_v_src[j * 2];
  659|   698M|        }
  660|       |
  661|  3.27M|        pu1_u_dst += dst_strd;
  662|  3.27M|        pu1_v_dst += dst_strd;
  663|  3.27M|        pu1_u_src += src_strd;
  664|  3.27M|        pu1_v_src += src_strd;
  665|  3.27M|    }
  666|  95.8k|    return;
  667|  95.8k|}
ihevcd_fmt_conv_422sp_to_422p:
  930|  13.4k|{
  931|  13.4k|    UWORD8 *pu1_u_src, *pu1_v_src;
  932|  13.4k|    WORD32 i, j;
  933|       |
  934|  13.4k|    ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd);
  935|       |
  936|  13.4k|    pu1_u_src = (UWORD8 *)pu1_uv_src;
  937|  13.4k|    pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
  938|       |
  939|   428k|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (939:16): [True: 415k, False: 13.4k]
  ------------------
  940|   415k|    {
  941|  25.3M|        for(j = 0; j < (wd >> 1); j++)
  ------------------
  |  Branch (941:20): [True: 24.9M, False: 415k]
  ------------------
  942|  24.9M|        {
  943|  24.9M|            pu1_u_dst[j] = pu1_u_src[j * 2];
  944|  24.9M|            pu1_v_dst[j] = pu1_v_src[j * 2];
  945|  24.9M|        }
  946|       |
  947|   415k|        pu1_u_dst += dst_uv_strd;
  948|   415k|        pu1_v_dst += dst_uv_strd;
  949|   415k|        pu1_u_src += src_uv_strd;
  950|   415k|        pu1_v_src += src_uv_strd;
  951|   415k|    }
  952|  13.4k|    return;
  953|  13.4k|}
ihevcd_fmt_conv_422sp_to_420p:
  966|  16.6k|{
  967|  16.6k|    ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd);
  968|       |
  969|   417k|    for(WORD32 i = 0; i < ht; i += 2)
  ------------------
  |  Branch (969:23): [True: 400k, False: 16.6k]
  ------------------
  970|   400k|    {
  971|  26.2M|        for(WORD32 j = 0; j < wd; j += 2)
  ------------------
  |  Branch (971:27): [True: 25.8M, False: 400k]
  ------------------
  972|  25.8M|        {
  973|  25.8M|            WORD32 cb_sum = pu1_uv_src[j];
  974|  25.8M|            WORD32 cr_sum = pu1_uv_src[j + 1];
  975|       |
  976|  25.8M|            if((i + 1) < ht)
  ------------------
  |  Branch (976:16): [True: 25.8M, False: 553]
  ------------------
  977|  25.8M|            {
  978|  25.8M|                cb_sum += pu1_uv_src[j + src_uv_strd] + 1;
  979|  25.8M|                cr_sum += pu1_uv_src[j + 1 + src_uv_strd] + 1;
  980|       |
  981|  25.8M|                cb_sum >>= 1;
  982|  25.8M|                cr_sum >>= 1;
  983|  25.8M|            }
  984|  25.8M|            pu1_u_dst[j / 2] = cb_sum;
  985|  25.8M|            pu1_v_dst[j / 2] = cr_sum;
  986|  25.8M|        }
  987|   400k|        pu1_u_dst += dst_uv_strd;
  988|   400k|        pu1_v_dst += dst_uv_strd;
  989|   400k|        pu1_uv_src += (src_uv_strd * 2);
  990|   400k|    }
  991|  16.6k|    return;
  992|  16.6k|}
ihevcd_hbd_fmt_conv_422sp_to_422p:
 1007|  5.66k|{
 1008|  5.66k|    UWORD16 *pu2_src, *pu2_dst;
 1009|  5.66k|    UWORD16 *pu2_u_src, *pu2_v_src;
 1010|  5.66k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
 1011|  5.66k|    WORD32 i, j;
 1012|       |
 1013|  5.66k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (1013:8): [True: 5.67k, False: 18.4E]
  ------------------
 1014|  5.67k|    {
 1015|       |        /* copy luma */
 1016|  5.67k|        pu2_src = (UWORD16 *)pu2_y_src;
 1017|  5.67k|        pu2_dst = (UWORD16 *)pu2_y_dst;
 1018|       |
 1019|  5.67k|        num_rows = ht;
 1020|  5.67k|        num_cols = wd;
 1021|       |
 1022|  5.67k|        src_strd = src_y_strd;
 1023|  5.67k|        dst_strd = dst_y_strd;
 1024|       |
 1025|   204k|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1025:20): [True: 198k, False: 5.67k]
  ------------------
 1026|   198k|        {
 1027|   198k|            memcpy(pu2_dst, pu2_src, num_cols * sizeof(UWORD16));
 1028|   198k|            pu2_dst += dst_strd;
 1029|   198k|            pu2_src += src_strd;
 1030|   198k|        }
 1031|  5.67k|    }
 1032|       |    /* de-interleave U and V and copy to destination */
 1033|  5.66k|    if(is_u_first)
  ------------------
  |  Branch (1033:8): [True: 5.71k, False: 18.4E]
  ------------------
 1034|  5.71k|    {
 1035|  5.71k|        pu2_u_src = (UWORD16 *)pu2_uv_src;
 1036|  5.71k|        pu2_v_src = (UWORD16 *)pu2_uv_src + 1;
 1037|  5.71k|    }
 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|  5.66k|    num_rows = ht;
 1045|  5.66k|    num_cols = wd >> 1;
 1046|       |
 1047|  5.66k|    src_strd = src_uv_strd;
 1048|  5.66k|    dst_strd = dst_uv_strd;
 1049|       |
 1050|   213k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1050:16): [True: 208k, False: 5.66k]
  ------------------
 1051|   208k|    {
 1052|  79.7M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (1052:20): [True: 79.5M, False: 208k]
  ------------------
 1053|  79.5M|        {
 1054|  79.5M|            pu2_u_dst[j] = pu2_u_src[j * 2];
 1055|  79.5M|            pu2_v_dst[j] = pu2_v_src[j * 2];
 1056|  79.5M|        }
 1057|       |
 1058|   208k|        pu2_u_dst += dst_strd;
 1059|   208k|        pu2_v_dst += dst_strd;
 1060|   208k|        pu2_u_src += src_strd;
 1061|   208k|        pu2_v_src += src_strd;
 1062|   208k|    }
 1063|  5.66k|    return;
 1064|  5.66k|}
ihevcd_hbd_fmt_conv_422sp_to_420p:
 1079|  63.4k|{
 1080|  63.4k|    UWORD16 *pu2_src, *pu2_dst;
 1081|  63.4k|    UWORD16 *pu2_u_src, *pu2_v_src;
 1082|  63.4k|    WORD32 num_rows, num_cols;
 1083|  63.4k|    WORD32 i, j;
 1084|  63.4k|    WORD32 cb_sum, cr_sum;
 1085|       |
 1086|  63.4k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (1086:8): [True: 63.4k, False: 18.4E]
  ------------------
 1087|  63.4k|    {
 1088|       |        /* copy luma */
 1089|  63.4k|        pu2_src = (UWORD16 *)pu2_y_src;
 1090|  63.4k|        pu2_dst = (UWORD16 *)pu2_y_dst;
 1091|       |
 1092|  63.4k|        num_rows = ht;
 1093|  63.4k|        num_cols = wd;
 1094|       |
 1095|  3.32M|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1095:20): [True: 3.25M, False: 63.4k]
  ------------------
 1096|  3.25M|        {
 1097|  3.25M|            memcpy(pu2_dst, pu2_src, num_cols * sizeof(UWORD16));
 1098|  3.25M|            pu2_dst += dst_y_strd;
 1099|  3.25M|            pu2_src += src_y_strd;
 1100|  3.25M|        }
 1101|  63.4k|    }
 1102|       |
 1103|       |    /* de-interleave U and V, downsample vertically and copy to destination */
 1104|  63.4k|    if(is_u_first)
  ------------------
  |  Branch (1104:8): [True: 65.4k, False: 18.4E]
  ------------------
 1105|  65.4k|    {
 1106|  65.4k|        pu2_u_src = (UWORD16 *)pu2_uv_src;
 1107|  65.4k|        pu2_v_src = (UWORD16 *)pu2_uv_src + 1;
 1108|  65.4k|    }
 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|  63.4k|    num_rows = ht;
 1116|  63.4k|    num_cols = wd >> 1;
 1117|       |
 1118|  1.95M|    for(i = 0; i < num_rows; i += 2)
  ------------------
  |  Branch (1118:16): [True: 1.88M, False: 63.4k]
  ------------------
 1119|  1.88M|    {
 1120|   646M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (1120:20): [True: 644M, False: 1.88M]
  ------------------
 1121|   644M|        {
 1122|   644M|            cb_sum = pu2_u_src[j * 2];
 1123|   644M|            cr_sum = pu2_v_src[j * 2];
 1124|       |
 1125|   644M|            if((i + 1) < num_rows)
  ------------------
  |  Branch (1125:16): [True: 644M, False: 76.5k]
  ------------------
 1126|   644M|            {
 1127|   644M|                cb_sum += pu2_u_src[j * 2 + src_uv_strd] + 1;
 1128|   644M|                cr_sum += pu2_v_src[j * 2 + src_uv_strd] + 1;
 1129|       |
 1130|   644M|                cb_sum >>= 1;
 1131|   644M|                cr_sum >>= 1;
 1132|   644M|            }
 1133|   644M|            pu2_u_dst[j] = cb_sum;
 1134|   644M|            pu2_v_dst[j] = cr_sum;
 1135|   644M|        }
 1136|       |
 1137|  1.88M|        pu2_u_dst += dst_uv_strd;
 1138|  1.88M|        pu2_v_dst += dst_uv_strd;
 1139|  1.88M|        pu2_u_src += (src_uv_strd * 2);
 1140|  1.88M|        pu2_v_src += (src_uv_strd * 2);
 1141|  1.88M|    }
 1142|  63.4k|    return;
 1143|  63.4k|}
ihevcd_hbd_fmt_conv_420sp_to_420p:
 1158|  15.4k|{
 1159|  15.4k|    UWORD16 *pu2_src, *pu2_dst;
 1160|  15.4k|    UWORD16 *pu2_u_src, *pu2_v_src;
 1161|  15.4k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
 1162|  15.4k|    WORD32 i, j;
 1163|       |
 1164|  15.4k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (1164:8): [True: 0, False: 15.4k]
  ------------------
 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|  15.4k|    if(is_u_first)
  ------------------
  |  Branch (1184:8): [True: 15.4k, False: 18.4E]
  ------------------
 1185|  15.4k|    {
 1186|  15.4k|        pu2_u_src = (UWORD16 *)pu2_uv_src;
 1187|  15.4k|        pu2_v_src = (UWORD16 *)pu2_uv_src + 1;
 1188|  15.4k|    }
 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|  15.4k|    num_rows = ht >> 1;
 1197|  15.4k|    num_cols = wd >> 1;
 1198|       |
 1199|  15.4k|    src_strd = src_uv_strd;
 1200|  15.4k|    dst_strd = dst_uv_strd;
 1201|       |
 1202|   375k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1202:16): [True: 359k, False: 15.4k]
  ------------------
 1203|   359k|    {
 1204|  28.0M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (1204:20): [True: 27.6M, False: 359k]
  ------------------
 1205|  27.6M|        {
 1206|  27.6M|            pu2_u_dst[j] = pu2_u_src[j * 2];
 1207|  27.6M|            pu2_v_dst[j] = pu2_v_src[j * 2];
 1208|  27.6M|        }
 1209|       |
 1210|   359k|        pu2_u_dst += dst_strd;
 1211|   359k|        pu2_v_dst += dst_strd;
 1212|   359k|        pu2_u_src += src_strd;
 1213|   359k|        pu2_v_src += src_strd;
 1214|   359k|    }
 1215|  15.4k|    return;
 1216|  15.4k|}
ihevcd_fmt_conv:
 1254|   655k|{
 1255|   655k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1256|   655k|    pic_buf_t *ps_disp_pic;
 1257|   655k|    UWORD8 *pu1_y_src, *pu1_uv_src;
 1258|   655k|    UWORD8 *pu1_y_dst_tmp, *pu1_uv_dst_tmp;
 1259|   655k|    UWORD8 *pu1_u_dst_tmp, *pu1_v_dst_tmp;
 1260|   655k|    WORD32 is_u_first;
 1261|   655k|    UWORD8 *pu1_luma;
 1262|   655k|    UWORD8 *pu1_chroma;
 1263|   655k|    sps_t *ps_sps;
 1264|   655k|    WORD32 disable_luma_copy;
 1265|   655k|    WORD32 crop_unit_x, crop_unit_y;
 1266|   655k|    WORD32 h_samp_factor, v_samp_factor;
 1267|   655k|    WORD32 src_chroma_pixel_strd = 2;
 1268|   655k|    WORD32 src_chroma_row_stride;
 1269|       |
 1270|   655k|    if(0 == num_rows)
  ------------------
  |  Branch (1270:8): [True: 1.59k, False: 653k]
  ------------------
 1271|  1.59k|        return ret;
 1272|       |
 1273|       |    /* In case processing is disabled, then no need to format convert/copy */
 1274|   653k|    PROFILE_DISABLE_FMT_CONV();
  ------------------
  |  |   78|   653k|#define PROFILE_DISABLE_FMT_CONV();
  ------------------
 1275|   653k|    ps_sps = ps_proc->ps_sps;
 1276|       |
 1277|   653k|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (1277:21): [True: 0, False: 653k]
  ------------------
 1278|   653k|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (1278:21): [True: 532k, False: 121k]
  ------------------
 1279|       |
 1280|   653k|    crop_unit_x = 1;
 1281|   653k|    crop_unit_y = 1;
 1282|       |
 1283|   653k|    if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1283:8): [True: 532k, False: 121k]
  ------------------
 1284|   532k|    {
 1285|   532k|        crop_unit_x = 2;
 1286|   532k|        crop_unit_y = 2;
 1287|   532k|    }
 1288|   121k|    else if(CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1288:13): [True: 117k, False: 4.17k]
  ------------------
 1289|   117k|    {
 1290|   117k|        crop_unit_x = 2;
 1291|   117k|        crop_unit_y = 1;
 1292|   117k|    }
 1293|       |
 1294|   653k|    ps_disp_pic = ps_codec->ps_disp_buf;
 1295|   653k|    pu1_luma = ps_disp_pic->pu1_luma;
 1296|   653k|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1296:8): [True: 649k, False: 4.19k]
  ------------------
 1297|   649k|    {
 1298|   649k|        pu1_chroma = ps_disp_pic->pu1_chroma;
 1299|   649k|    }
 1300|       |
 1301|       |
 1302|       |    /* Take care of cropping */
 1303|   653k|    pu1_luma    +=
 1304|   653k|        (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|   653k|        ps_codec->i4_pixel_size_y;
 1306|       |
 1307|   653k|    src_chroma_row_stride = (ps_codec->i4_strd * src_chroma_pixel_strd / h_samp_factor);
 1308|   653k|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1308:8): [True: 649k, False: 4.20k]
  ------------------
 1309|   649k|    {
 1310|   649k|        pu1_chroma += ((ps_sps->i2_pic_crop_top_offset * src_chroma_row_stride)
 1311|   649k|                        + ps_sps->i2_pic_crop_left_offset * src_chroma_pixel_strd) * ps_codec->i4_pixel_size_uv;
 1312|   649k|    }
 1313|   653k|    is_u_first = (IV_YUV_420SP_UV == ps_codec->e_ref_chroma_fmt) ? 1 : 0;
  ------------------
  |  Branch (1313:18): [True: 565k, False: 88.3k]
  ------------------
 1314|       |
 1315|       |    /* In case of 420P output luma copy is disabled for shared mode */
 1316|   653k|    disable_luma_copy = 0;
 1317|   653k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (1317:8): [True: 0, False: 653k]
  ------------------
 1318|      0|    {
 1319|      0|        disable_luma_copy = 1;
 1320|      0|    }
 1321|       |
 1322|       |
 1323|       |
 1324|   653k|    {
 1325|   653k|        pu1_y_src   = pu1_luma + cur_row * ps_codec->i4_strd * ps_codec->i4_pixel_size_y;
 1326|   653k|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1326:12): [True: 648k, False: 5.16k]
  ------------------
 1327|   648k|        {
 1328|   648k|            pu1_uv_src = pu1_chroma + (((cur_row / v_samp_factor) * src_chroma_row_stride) * ps_codec->i4_pixel_size_uv);
 1329|   648k|        }
 1330|       |
 1331|       |        /* In case of shared mode, with 420P output, get chroma destination */
 1332|   653k|        if((1 == ps_codec->i4_share_disp_buf) && (IV_YUV_420P == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (1332:12): [True: 0, False: 653k]
  |  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|   653k|        pu1_y_dst_tmp  = pu1_y_dst  + cur_row * ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_y;
 1350|   653k|        if(IV_YUV_444P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1350:12): [True: 0, False: 653k]
  ------------------
 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|   653k|        else if(IV_YUV_422P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1355:17): [True: 19.7k, False: 633k]
  ------------------
 1356|  19.7k|        {
 1357|  19.7k|            pu1_u_dst_tmp = pu1_u_dst + cur_row * ((ps_codec->i4_disp_strd + 1) / 2) * ps_codec->i4_pixel_size_uv;
 1358|  19.7k|            pu1_v_dst_tmp = pu1_v_dst + cur_row * ((ps_codec->i4_disp_strd + 1) / 2) * ps_codec->i4_pixel_size_uv;
 1359|  19.7k|        }
 1360|   633k|        else if(IV_YUV_420P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1360:17): [True: 215k, False: 418k]
  ------------------
 1361|   215k|        {
 1362|   215k|            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|   215k|            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|   215k|        }
 1365|   418k|        else if(IV_YUV_420SP_UV == ps_codec->e_chroma_fmt
  ------------------
  |  Branch (1365:17): [True: 122k, False: 295k]
  ------------------
 1366|   295k|                        || IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1366:28): [True: 87.8k, False: 207k]
  ------------------
 1367|   208k|        {
 1368|   208k|            pu1_uv_dst_tmp = pu1_u_dst + ((cur_row + 1) / 2) * ALIGN2(ps_codec->i4_disp_strd) * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |   55|   208k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
 1369|   208k|        }
 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|   653k|        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: 652k, False: 1.50k]
  |  Branch (1378:46): [True: 634k, False: 17.8k]
  |  Branch (1378:106): [True: 612k, False: 20.5k]
  ------------------
 1379|   612k|        {
 1380|   612k|            WORD32 idx;
 1381|   612k|            UWORD8 *pu1_buf;
 1382|   612k|            WORD32 status;
 1383|   612k|            WORD32 last_row = cur_row + num_rows;
 1384|   612k|            WORD32 last_ctb_y;
 1385|   612k|            UWORD32 ctb_in_row;
 1386|       |
 1387|  23.9M|            while(1)
  ------------------
  |  Branch (1387:19): [True: 23.9M, Folded]
  ------------------
 1388|  23.9M|            {
 1389|  23.9M|                last_row = cur_row + MAX(num_rows, (1 << ps_sps->i1_log2_ctb_size)) +
  ------------------
  |  |   42|  23.9M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 23.9M]
  |  |  ------------------
  ------------------
 1390|  23.9M|                                ps_sps->i2_pic_crop_top_offset * crop_unit_y;
 1391|  23.9M|                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|  23.9M|                last_ctb_y++;
 1394|       |                /* In case of a  conformance window, an extra wait of one row might be needed */
 1395|  23.9M|                last_ctb_y++;
 1396|  23.9M|                last_ctb_y = MIN(last_ctb_y, (ps_sps->i2_pic_ht_in_ctb - 1));
  ------------------
  |  |   43|  23.9M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 14.3M, False: 9.63M]
  |  |  ------------------
  ------------------
 1397|       |
 1398|  23.9M|                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|  23.9M|                status = 1;
 1402|   917M|                for(ctb_in_row = 0; (WORD32)ctb_in_row < ps_sps->i2_pic_wd_in_ctb; ctb_in_row++)
  ------------------
  |  Branch (1402:37): [True: 893M, False: 23.9M]
  ------------------
 1403|   893M|                {
 1404|   893M|                    pu1_buf = (ps_codec->pu1_proc_map + idx + ctb_in_row);
 1405|   893M|                    status &= *pu1_buf;
 1406|   893M|                }
 1407|       |
 1408|  23.9M|                if(status)
  ------------------
  |  Branch (1408:20): [True: 607k, False: 23.3M]
  ------------------
 1409|   607k|                {
 1410|   607k|                    break;
 1411|   607k|                }
 1412|  23.3M|                else
 1413|  23.3M|                {
 1414|  23.3M|                    ithread_yield();
 1415|  23.3M|                }
 1416|  23.9M|            }
 1417|   612k|        }
 1418|       |
 1419|   653k|        if((IV_YUV_420SP_UV == ps_codec->e_chroma_fmt) || (IV_YUV_420SP_VU == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (1419:12): [True: 128k, False: 525k]
  |  Branch (1419:59): [True: 88.1k, False: 436k]
  ------------------
 1420|   207k|        {
 1421|   207k|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1421:16): [True: 207k, False: 316]
  ------------------
 1422|   207k|            {
 1423|   207k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   207k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1423:20): [True: 181k, False: 25.5k]
  ------------------
 1424|   181k|                {
 1425|   181k|                    ihevcd_fmt_conv_420sp_to_420sp_ft *fmt_conv_fptr;
 1426|   181k|                    if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|   181k|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (1426:24): [True: 166k, False: 15.5k]
  ------------------
 1427|   166k|                    {
 1428|   166k|                        fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr;
 1429|   166k|                    }
 1430|  15.5k|                    else
 1431|  15.5k|                    {
 1432|  15.5k|                        fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420sp;
 1433|  15.5k|                    }
 1434|   181k|                    fmt_conv_fptr(pu1_y_src, pu1_uv_src,
 1435|   181k|                                  pu1_y_dst_tmp, pu1_uv_dst_tmp,
 1436|   181k|                                  ps_codec->i4_disp_wd, num_rows,
 1437|   181k|                                  ps_codec->i4_strd, ps_codec->i4_strd,
 1438|   181k|                                  ps_codec->i4_disp_strd, ps_codec->i4_disp_strd);
 1439|   181k|                }
 1440|  25.5k|                else
 1441|  25.5k|                {
 1442|  25.5k|                    ihevcd_hbd_fmt_conv_420sp_to_420sp((UWORD16 *)pu1_y_src, (UWORD16 *)pu1_uv_src,
 1443|  25.5k|                                                       (UWORD16 *)pu1_y_dst_tmp, (UWORD16 *)pu1_uv_dst_tmp,
 1444|  25.5k|                                                       ps_codec->i4_disp_wd, num_rows,
 1445|  25.5k|                                                       ps_codec->i4_strd, ps_codec->i4_strd,
 1446|  25.5k|                                                       ps_codec->i4_disp_strd, ps_codec->i4_disp_strd);
 1447|  25.5k|                }
 1448|   207k|            }
 1449|    316|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1449:21): [True: 0, False: 316]
  ------------------
 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|   207k|        }
 1471|   445k|        else if(IV_GRAY == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1471:17): [True: 204k, False: 241k]
  ------------------
 1472|   204k|        {
 1473|   204k|            ihevcd_fmt_conv_luma_copy(pu1_y_src,
 1474|   204k|                                      pu1_y_dst_tmp,
 1475|   204k|                                      ps_codec->i4_disp_wd * ps_codec->i4_pixel_size_y,
 1476|   204k|                                      num_rows,
 1477|   204k|                                      ps_codec->i4_strd * ps_codec->i4_pixel_size_y,
 1478|   204k|                                      ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_y);
 1479|   204k|        }
 1480|   241k|        else if(IV_YUV_444P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1480:17): [True: 0, False: 241k]
  ------------------
 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|   241k|        else if(IV_YUV_422P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1503:17): [True: 19.3k, False: 221k]
  ------------------
 1504|  19.3k|        {
 1505|  19.3k|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1505:16): [True: 19.3k, False: 18.4E]
  ------------------
 1506|  19.3k|            {
 1507|  19.3k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  19.3k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1507:20): [True: 13.6k, False: 5.72k]
  ------------------
 1508|  13.6k|                {
 1509|  13.6k|                    ihevcd_fmt_conv_422sp_to_422p(pu1_y_src, pu1_uv_src,
 1510|  13.6k|                                                  pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1511|  13.6k|                                                  ps_codec->i4_disp_wd, num_rows,
 1512|  13.6k|                                                  ps_codec->i4_strd, ps_codec->i4_strd,
 1513|  13.6k|                                                  ps_codec->i4_disp_strd,
 1514|  13.6k|                                                  ((ps_codec->i4_disp_strd + 1) / 2));
 1515|  13.6k|                }
 1516|  5.72k|                else
 1517|  5.72k|                {
 1518|  5.72k|                    ihevcd_hbd_fmt_conv_422sp_to_422p((UWORD16 *)pu1_y_src, (UWORD16 *)pu1_uv_src,
 1519|  5.72k|                                                      (UWORD16 *)pu1_y_dst_tmp, (UWORD16 *)pu1_u_dst_tmp,
 1520|  5.72k|                                                      (UWORD16 *)pu1_v_dst_tmp, ps_codec->i4_disp_wd, num_rows,
 1521|  5.72k|                                                      ps_codec->i4_strd, ps_codec->i4_strd,
 1522|  5.72k|                                                      ps_codec->i4_disp_strd, ((ps_codec->i4_disp_strd + 1) / 2),
 1523|  5.72k|                                                      is_u_first, disable_luma_copy);
 1524|  5.72k|                }
 1525|  19.3k|            }
 1526|  19.3k|        }
 1527|   221k|        else if(IV_YUV_420P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1527:17): [True: 211k, False: 10.1k]
  ------------------
 1528|   211k|        {
 1529|   211k|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1529:16): [True: 2.92k, False: 208k]
  ------------------
 1530|  2.92k|            {
 1531|  2.92k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  2.92k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1531:20): [True: 2.05k, False: 874]
  ------------------
 1532|  2.05k|                {
 1533|  2.05k|                    ihevcd_fmt_conv_400_to_420p(pu1_y_src,
 1534|  2.05k|                                                pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1535|  2.05k|                                                ps_codec->i4_disp_wd, num_rows,
 1536|  2.05k|                                                ps_codec->i4_strd,
 1537|  2.05k|                                                ps_codec->i4_disp_strd,
 1538|  2.05k|                                                ((ps_codec->i4_disp_strd + 1) / 2));
 1539|  2.05k|                }
 1540|    874|                else
 1541|    874|                {
 1542|    874|                    ihevcd_hbd_fmt_conv_400_to_420p((UWORD16 *)pu1_y_src,
 1543|    874|                                                    (UWORD16 *)pu1_y_dst_tmp,
 1544|    874|                                                    (UWORD16 *)pu1_u_dst_tmp,
 1545|    874|                                                    (UWORD16 *)pu1_v_dst_tmp,
 1546|    874|                                                    ps_codec->i4_disp_wd, num_rows,
 1547|    874|                                                    ps_codec->i4_strd,
 1548|    874|                                                    ps_codec->i4_disp_strd,
 1549|    874|                                                    ((ps_codec->i4_disp_strd + 1) / 2),
 1550|    874|                                                    ps_sps->i1_bit_depth_luma_minus8 + 8);
 1551|    874|                }
 1552|  2.92k|            }
 1553|   208k|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1553:21): [True: 127k, False: 81.2k]
  ------------------
 1554|   127k|            {
 1555|   127k|                ihevcd_fmt_conv_420sp_to_420p_ft *fmt_conv_fptr;
 1556|   127k|                if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|   127k|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (1556:20): [True: 117k, False: 9.54k]
  ------------------
 1557|   117k|                {
 1558|   117k|                    fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr;
 1559|   117k|                }
 1560|  9.54k|                else
 1561|  9.54k|                {
 1562|  9.54k|                    fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420p;
 1563|  9.54k|                }
 1564|       |
 1565|   127k|                if(0 == disable_luma_copy)
  ------------------
  |  Branch (1565:20): [True: 127k, False: 18.4E]
  ------------------
 1566|   127k|                {
 1567|       |                    // copy luma
 1568|   127k|                    WORD32 i;
 1569|   127k|                    WORD32 num_cols = ps_codec->i4_disp_wd * ps_codec->i4_pixel_size_y;
 1570|       |
 1571|  8.98M|                    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1571:32): [True: 8.86M, False: 127k]
  ------------------
 1572|  8.86M|                    {
 1573|  8.86M|                        memcpy(pu1_y_dst_tmp, pu1_y_src, num_cols);
 1574|  8.86M|                        pu1_y_dst_tmp += ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_y;
 1575|  8.86M|                        pu1_y_src += ps_codec->i4_strd * ps_codec->i4_pixel_size_y;
 1576|  8.86M|                    }
 1577|       |
 1578|   127k|                    disable_luma_copy = 1;
 1579|   127k|                }
 1580|       |
 1581|   127k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   127k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1581:20): [True: 111k, False: 15.5k]
  ------------------
 1582|   111k|                {
 1583|   111k|                    fmt_conv_fptr(pu1_y_src, pu1_uv_src,
 1584|   111k|                                  pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1585|   111k|                                  ps_codec->i4_disp_wd,
 1586|   111k|                                  num_rows,
 1587|   111k|                                  ps_codec->i4_strd,
 1588|   111k|                                  ps_codec->i4_strd,
 1589|   111k|                                  ps_codec->i4_disp_strd,
 1590|   111k|                                  (ps_codec->i4_disp_strd / 2),
 1591|   111k|                                  is_u_first,
 1592|   111k|                                  disable_luma_copy);
 1593|   111k|                }
 1594|  15.5k|                else
 1595|  15.5k|                {
 1596|  15.5k|                    ps_codec->s_func_selector.ihevcd_hbd_fmt_conv_420sp_to_420p_fptr(
 1597|  15.5k|                                    (UWORD16 *)pu1_y_src, (UWORD16 *)pu1_uv_src,
 1598|  15.5k|                                    (UWORD16 *)pu1_y_dst_tmp, (UWORD16 *)pu1_u_dst_tmp,
 1599|  15.5k|                                    (UWORD16 *)pu1_v_dst_tmp,
 1600|  15.5k|                                    ps_codec->i4_disp_wd,
 1601|  15.5k|                                    num_rows,
 1602|  15.5k|                                    ps_codec->i4_strd,
 1603|  15.5k|                                    ps_codec->i4_strd,
 1604|  15.5k|                                    ps_codec->i4_disp_strd,
 1605|  15.5k|                                    (ps_codec->i4_disp_strd / 2),
 1606|  15.5k|                                    is_u_first,
 1607|  15.5k|                                    disable_luma_copy);
 1608|  15.5k|                }
 1609|   127k|            }
 1610|  81.2k|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1610:21): [True: 0, False: 81.2k]
  ------------------
 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|  81.2k|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1635:21): [True: 81.0k, False: 201]
  ------------------
 1636|  81.0k|            {
 1637|  81.0k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  81.0k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1637:20): [True: 16.6k, False: 64.4k]
  ------------------
 1638|  16.6k|                {
 1639|  16.6k|                    ihevcd_fmt_conv_422sp_to_420p(pu1_y_src, pu1_uv_src,
 1640|  16.6k|                                                  pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1641|  16.6k|                                                  ps_codec->i4_disp_wd, num_rows,
 1642|  16.6k|                                                  ps_codec->i4_strd, src_chroma_row_stride,
 1643|  16.6k|                                                  ps_codec->i4_disp_strd,
 1644|  16.6k|                                                  ((ps_codec->i4_disp_strd + 1) / 2));
 1645|  16.6k|                }
 1646|  64.4k|                else
 1647|  64.4k|                {
 1648|  64.4k|                    ihevcd_hbd_fmt_conv_422sp_to_420p((UWORD16 *)pu1_y_src,
 1649|  64.4k|                                                      (UWORD16 *)pu1_uv_src,
 1650|  64.4k|                                                      (UWORD16 *)pu1_y_dst_tmp,
 1651|  64.4k|                                                      (UWORD16 *)pu1_u_dst_tmp,
 1652|  64.4k|                                                      (UWORD16 *)pu1_v_dst_tmp,
 1653|  64.4k|                                                      ps_codec->i4_disp_wd, num_rows,
 1654|  64.4k|                                                      ps_codec->i4_strd, src_chroma_row_stride,
 1655|  64.4k|                                                      ps_codec->i4_disp_strd,
 1656|  64.4k|                                                      ((ps_codec->i4_disp_strd + 1) / 2),
 1657|  64.4k|                                                      is_u_first, disable_luma_copy);
 1658|  64.4k|                }
 1659|  81.0k|            }
 1660|   211k|        }
 1661|   653k|    }
 1662|   653k|    return (ret);
 1663|   655k|}

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

ihevcd_get_mv_ctb:
  108|  3.73M|{
  109|       |
  110|  3.73M|    WORD32 i;
  111|  3.73M|    sps_t *ps_sps;
  112|  3.73M|    pps_t *ps_pps;
  113|  3.73M|    pu_t *ps_pu;
  114|  3.73M|    tile_t *ps_tile;
  115|  3.73M|    UWORD8 *pu1_pic_pu_map_ctb;
  116|  3.73M|    WORD32 num_minpu_in_ctb;
  117|  3.73M|    WORD32 ctb_start_pu_idx;
  118|  3.73M|    UWORD32 *pu4_top_pu_idx, *pu4_left_pu_idx, *pu4_top_left_pu_idx;
  119|  3.73M|    WORD32 pu_x_in_4x4, pu_y_in_4x4;
  120|  3.73M|    WORD32 pu_x_in_4x4_single_mcl, pu_y_in_4x4_single_mcl;
  121|  3.73M|    pu_mv_t s_pred_mv;
  122|  3.73M|    WORD32 ctb_size, ctb_size_in_min_pu;
  123|  3.73M|    WORD32 num_pu_per_ctb, pu_wd, pu_ht, pu_cnt;
  124|  3.73M|    WORD32  pu_wd_single_mcl, pu_ht_single_mcl;
  125|  3.73M|    UWORD32 au4_nbr_avail[MAX_CTB_SIZE / MIN_PU_SIZE
  126|  3.73M|                    + 2 /* Top nbr + bot nbr */];
  127|  3.73M|    UWORD32 *pu4_nbr_pu_idx/* (Left + ctb_size + right ) * (top + ctb_size + bottom) */;
  128|  3.73M|    WORD32 top_avail_bits;
  129|  3.73M|    UWORD8 u1_lb_avail, u1_l_avail, u1_t_avail, u1_tr_avail, u1_tl_avail;
  130|  3.73M|    WORD32 nbr_pu_idx_strd;
  131|  3.73M|    WORD32 cb_size;
  132|  3.73M|    WORD32 single_mcl_flag;
  133|       |
  134|  3.73M|    PROFILE_DISABLE_MV_PREDICTION();
  ------------------
  |  |   90|  3.73M|#define PROFILE_DISABLE_MV_PREDICTION() ;
  ------------------
  135|  3.73M|    ps_sps = ps_mv_ctxt->ps_sps;
  136|  3.73M|    ps_pps = ps_mv_ctxt->ps_pps;
  137|  3.73M|    ps_pu = ps_mv_ctxt->ps_pu;
  138|  3.73M|    ps_tile = ps_mv_ctxt->ps_tile;
  139|       |
  140|  3.73M|    pu4_nbr_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx_map;
  141|       |
  142|  3.73M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  143|       |
  144|  3.73M|    ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  3.73M|#define MIN_PU_SIZE         4
  ------------------
  145|       |
  146|  3.73M|    num_minpu_in_ctb = ctb_size_in_min_pu * ctb_size_in_min_pu;
  147|  3.73M|    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|  3.73M|    num_pu_per_ctb = ps_mv_ctxt->i4_ctb_pu_cnt;
  150|  3.73M|    ctb_start_pu_idx = ps_mv_ctxt->i4_ctb_start_pu_idx;
  151|  3.73M|    nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  3.73M|#define MAX_CTB_SIZE        64
  ------------------
                  nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  3.73M|#define MIN_PU_SIZE         4
  ------------------
  152|       |
  153|  3.73M|    {
  154|       |        /* Updating the initial availability map */
  155|  3.73M|        WORD32 i;
  156|  3.73M|        UWORD32 u4_left_ctb_avail, u4_top_lt_ctb_avail, u4_top_rt_ctb_avail,
  157|  3.73M|                        u4_top_ctb_avail;
  158|       |
  159|  3.73M|        u4_left_ctb_avail = ps_mv_ctxt->u1_left_ctb_avail;
  160|  3.73M|        u4_top_lt_ctb_avail = ps_mv_ctxt->u1_top_lt_ctb_avail;
  161|  3.73M|        u4_top_ctb_avail = ps_mv_ctxt->u1_top_ctb_avail;
  162|  3.73M|        u4_top_rt_ctb_avail = ps_mv_ctxt->u1_top_rt_ctb_avail;
  163|       |
  164|       |        /* Initializing the availability array */
  165|  3.73M|        memset(au4_nbr_avail, 0,
  166|  3.73M|               (MAX_CTB_SIZE / MIN_PU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  351|  3.73M|#define MAX_CTB_SIZE        64
  ------------------
                             (MAX_CTB_SIZE / MIN_PU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  367|  3.73M|#define MIN_PU_SIZE         4
  ------------------
  167|       |        /* Initializing the availability array with CTB level availability flags */
  168|  3.73M|        {
  169|  3.73M|            WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
  170|  3.73M|                            - (ps_mv_ctxt->i4_ctb_y << ps_sps->i1_log2_ctb_size);
  171|  3.73M|            WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  3.73M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.57M, False: 153k]
  |  |  ------------------
  ------------------
  172|  37.4M|            for(i = 0; i < ctb_size_left / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|  37.4M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (172:24): [True: 33.7M, False: 3.73M]
  ------------------
  173|  33.7M|            {
  174|  33.7M|                au4_nbr_avail[i + 1] = (u4_left_ctb_avail << 31);
  175|  33.7M|            }
  176|  3.73M|        }
  177|  3.73M|        au4_nbr_avail[0] |= ((u4_top_rt_ctb_avail << 31)
  178|  3.73M|                        >> (1 + ctb_size_in_min_pu)); /* 1+ctb_size/4 position bit pos from msb */
  179|       |
  180|  3.73M|        au4_nbr_avail[0] |= (u4_top_lt_ctb_avail << 31);
  181|  3.73M|        {
  182|  3.73M|            WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples
  183|  3.73M|                            - (ps_mv_ctxt->i4_ctb_x << ps_sps->i1_log2_ctb_size);
  184|  3.73M|            WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  3.73M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.36M, False: 363k]
  |  |  ------------------
  ------------------
  185|  3.73M|            WORD32 shift = (31 - (ctb_size / MIN_TU_SIZE));
  ------------------
  |  |  358|  3.73M|#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|  3.73M|            shift += ((ctb_size - ctb_size_top) / MIN_TU_SIZE);
  ------------------
  |  |  358|  3.73M|#define MIN_TU_SIZE         4
  ------------------
  191|       |
  192|  3.73M|            top_avail_bits = ((1 << (ctb_size_top / MIN_PU_SIZE)) - 1) << shift;
  ------------------
  |  |  367|  3.73M|#define MIN_PU_SIZE         4
  ------------------
  193|  3.73M|        }
  194|       |
  195|  3.73M|        au4_nbr_avail[0] |= ((u4_top_ctb_avail == 1) ? top_avail_bits : 0x0);
  ------------------
  |  Branch (195:30): [True: 3.45M, False: 275k]
  ------------------
  196|       |        /* Starting from msb 2nd bit to (1+ctb_size/4) bit, set 1 if top avail,or 0 */
  197|       |
  198|  3.73M|    }
  199|       |
  200|  3.73M|    {
  201|       |        /* In case of a  tile boundary, left and top arrays must change*/
  202|       |        /*Left*/
  203|       |        /* If start of tile row*/
  204|  3.73M|        if(((ps_tile->u1_pos_x) == (ps_mv_ctxt->i4_ctb_x)) && (ps_mv_ctxt->i4_ctb_x != 0))
  ------------------
  |  Branch (204:12): [True: 458k, False: 3.27M]
  |  Branch (204:63): [True: 57.3k, False: 401k]
  ------------------
  205|  57.3k|        {
  206|  57.3k|            WORD32 index_pic_map;
  207|  57.3k|            WORD32 ctb_pu_idx;
  208|  57.3k|            UWORD8 *pu1_pic_pu_map;
  209|       |
  210|       |            /* Goto the left ctb which belongs to another tile */
  211|  57.3k|            index_pic_map = ((ps_mv_ctxt->i4_ctb_x - 1) + ps_mv_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  212|  57.3k|            ctb_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx[index_pic_map];
  213|  57.3k|            index_pic_map *= num_minpu_in_ctb;
  214|       |
  215|       |            /*Replicate the PUs of the last column of the left ctb*/
  216|  57.3k|            pu1_pic_pu_map = ps_mv_ctxt->pu1_pic_pu_map + index_pic_map + ctb_size_in_min_pu - 1;
  217|   561k|            for(i = 0; i < ctb_size_in_min_pu; i++)
  ------------------
  |  Branch (217:24): [True: 504k, False: 57.3k]
  ------------------
  218|   504k|            {
  219|       |                /* Left neighbors change*/
  220|   504k|                pu4_ctb_left_pu_idx[i] = ctb_pu_idx + (WORD32)*pu1_pic_pu_map;
  221|   504k|                pu1_pic_pu_map = pu1_pic_pu_map + ctb_size_in_min_pu;
  222|   504k|            }
  223|       |
  224|       |
  225|       |            /* Top left ctb is a valid neighbor only when a row above exists */
  226|  57.3k|            if(ps_mv_ctxt->i4_ctb_y != 0)
  ------------------
  |  Branch (226:16): [True: 54.7k, False: 2.55k]
  ------------------
  227|  54.7k|            {
  228|  54.7k|                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|  54.7k|                ctb_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx[index_pic_map];
  230|  54.7k|                index_pic_map *= num_minpu_in_ctb;
  231|  54.7k|                index_pic_map += (num_minpu_in_ctb - 1);
  232|  54.7k|                pu4_ctb_top_left_pu_idx[0] = ctb_pu_idx + ps_mv_ctxt->pu1_pic_pu_map[index_pic_map];
  233|  54.7k|            }
  234|  57.3k|        }
  235|       |        /*Top*/
  236|       |        /* If start of tile column*/
  237|  3.73M|        if(((ps_tile->u1_pos_y) == (ps_mv_ctxt->i4_ctb_y)) && (ps_mv_ctxt->i4_ctb_y != 0))
  ------------------
  |  Branch (237:12): [True: 280k, False: 3.45M]
  |  Branch (237:63): [True: 110k, False: 170k]
  ------------------
  238|   110k|        {
  239|   110k|            WORD32 index_pic_map;
  240|   110k|            WORD32 ctb_pu_idx;
  241|   110k|            UWORD8 *pu1_pic_pu_map;
  242|       |
  243|       |            /* Goto the top ctb which belongs to another tile */
  244|   110k|            index_pic_map =  (ps_mv_ctxt->i4_ctb_x) + ((ps_mv_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  245|   110k|            ctb_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx[index_pic_map];
  246|   110k|            index_pic_map *= num_minpu_in_ctb;
  247|       |
  248|       |            /*Replicate the PUs of the last row of the top ctb*/
  249|   110k|            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: 110k]
  ------------------
  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|   110k|        }
  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|  38.3M|        for(i = 0; i < ctb_size_in_min_pu; i++)
  ------------------
  |  Branch (261:20): [True: 34.6M, False: 3.73M]
  ------------------
  262|  34.6M|        {
  263|       |            /* Left */
  264|  34.6M|            pu4_nbr_pu_idx[(i + 1) * nbr_pu_idx_strd] = pu4_ctb_left_pu_idx[i];
  265|       |            /* Top */
  266|  34.6M|            pu4_nbr_pu_idx[i + 1] = pu4_ctb_top_pu_idx[i];
  267|  34.6M|        }
  268|       |        /* Top right */
  269|  3.73M|        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|  3.73M|        pu4_nbr_pu_idx[0] = pu4_ctb_top_left_pu_idx[0];
  273|       |
  274|  3.73M|    }
  275|       |
  276|       |    /* CTB level MV pred */
  277|  76.0M|    for(pu_cnt = 0; pu_cnt < num_pu_per_ctb; pu_cnt++, ps_pu++)
  ------------------
  |  Branch (277:21): [True: 72.3M, False: 3.73M]
  ------------------
  278|  72.3M|    {
  279|  72.3M|        pu_ht = (ps_pu->b4_ht + 1) << 2;
  280|  72.3M|        pu_wd = (ps_pu->b4_wd + 1) << 2;
  281|       |
  282|  72.3M|        pu_ht_single_mcl = pu_ht;
  283|  72.3M|        pu_wd_single_mcl = pu_wd;
  284|       |
  285|  72.3M|        pu_x_in_4x4 = ps_pu->b4_pos_x;
  286|  72.3M|        pu_y_in_4x4 = ps_pu->b4_pos_y;
  287|       |
  288|  72.3M|        pu_x_in_4x4_single_mcl = pu_x_in_4x4;
  289|  72.3M|        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.3M|        single_mcl_flag = 0;
  311|  72.3M|        if(1 == ps_pu->b1_merge_flag)
  ------------------
  |  Branch (311:12): [True: 71.5M, False: 734k]
  ------------------
  312|  71.5M|        {
  313|  71.5M|            cb_size = MAX(pu_wd_single_mcl, pu_ht_single_mcl);
  ------------------
  |  |   42|  71.5M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 172k, False: 71.4M]
  |  |  ------------------
  ------------------
  314|  71.5M|            cb_size = MAX(cb_size,
  ------------------
  |  |   42|  71.5M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 628k, False: 70.9M]
  |  |  ------------------
  ------------------
  315|  71.5M|                          (1 << ps_sps->i1_log2_min_coding_block_size));
  316|  71.5M|            if((ps_pps->i1_log2_parallel_merge_level > 2) && cb_size == 8 && (pu_wd_single_mcl != pu_ht_single_mcl))
  ------------------
  |  Branch (316:16): [True: 13.0M, False: 58.4M]
  |  Branch (316:62): [True: 11.8M, False: 1.19M]
  |  Branch (316:78): [True: 24.3k, False: 11.8M]
  ------------------
  317|  24.3k|            {
  318|  24.3k|                single_mcl_flag = 1;
  319|  24.3k|                if((PART_Nx2N == ps_pu->b3_part_mode) && (1 == ps_pu->b2_part_idx))
  ------------------
  |  Branch (319:20): [True: 11.6k, False: 12.6k]
  |  Branch (319:58): [True: 5.74k, False: 5.92k]
  ------------------
  320|  5.74k|                {
  321|  5.74k|                    pu_x_in_4x4_single_mcl = pu_x_in_4x4_single_mcl - 1;
  322|  5.74k|                }
  323|  18.6k|                else if((PART_2NxN == ps_pu->b3_part_mode) && (1 == ps_pu->b2_part_idx))
  ------------------
  |  Branch (323:25): [True: 12.6k, False: 5.92k]
  |  Branch (323:63): [True: 6.39k, False: 6.29k]
  ------------------
  324|  6.39k|                {
  325|  6.39k|                    pu_y_in_4x4_single_mcl = pu_y_in_4x4_single_mcl - 1;
  326|  6.39k|                }
  327|  24.3k|                pu_ht_single_mcl = 8;
  328|  24.3k|                pu_wd_single_mcl = 8;
  329|  24.3k|            }
  330|  71.5M|        }
  331|  72.3M|        pu4_top_pu_idx = &pu4_nbr_pu_idx[(1 + pu_x_in_4x4_single_mcl)
  332|  72.3M|                        + (1 + pu_y_in_4x4_single_mcl - 1) * nbr_pu_idx_strd];
  333|  72.3M|        pu4_top_left_pu_idx = pu4_top_pu_idx - 1;
  334|  72.3M|        pu4_left_pu_idx = pu4_top_pu_idx - 1 + nbr_pu_idx_strd;
  335|       |
  336|       |        /* Get neibhbor availability */
  337|  72.3M|        {
  338|  72.3M|            u1_lb_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl + pu_ht_single_mcl / MIN_PU_SIZE]
  ------------------
  |  |  367|  72.3M|#define MIN_PU_SIZE         4
  ------------------
  339|  72.3M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl - 1))) & 1;
  340|  72.3M|            u1_l_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl]
  341|  72.3M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl - 1))) & 1;
  342|  72.3M|            u1_t_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl - 1]
  343|  72.3M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl))) & 1;
  344|  72.3M|            u1_tr_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl - 1]
  345|  72.3M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl + pu_wd_single_mcl / MIN_PU_SIZE)))
  ------------------
  |  |  367|  72.3M|#define MIN_PU_SIZE         4
  ------------------
  346|  72.3M|                            & 1;
  347|  72.3M|            u1_tl_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl - 1]
  348|  72.3M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl - 1))) & 1;
  349|  72.3M|        }
  350|  72.3M|        if(ps_pu->b1_intra_flag == 0)
  ------------------
  |  Branch (350:12): [True: 71.9M, False: 345k]
  ------------------
  351|  71.9M|        {
  352|  71.9M|            if(ps_pu->b1_merge_flag == 0)
  ------------------
  |  Branch (352:16): [True: 660k, False: 71.3M]
  ------------------
  353|   660k|            {
  354|   660k|                WORD32 pred_flag_l0, pred_flag_l1;
  355|   660k|                WORD32 tmp_x, tmp_y, mvd_x, mvd_y, mvp_x, mvp_y;
  356|   660k|                WORD32 two_pow_16, two_pow_15;
  357|       |
  358|   660k|                ihevcd_mv_pred(ps_mv_ctxt, pu4_top_pu_idx, pu4_left_pu_idx,
  359|   660k|                               pu4_top_left_pu_idx, nbr_pu_idx_strd,
  360|   660k|                               ps_pu, u1_lb_avail, u1_l_avail,
  361|   660k|                               u1_tr_avail, u1_t_avail, u1_tl_avail,
  362|   660k|                               &s_pred_mv);
  363|       |
  364|   660k|                pred_flag_l0 = (ps_pu->b2_pred_mode != PRED_L1);
  365|   660k|                pred_flag_l1 = (ps_pu->b2_pred_mode != PRED_L0);
  366|       |
  367|   660k|                two_pow_16 = (1 << 16);
  368|   660k|                two_pow_15 = (1 << 15);
  369|       |
  370|       |                /* L0 MV */
  371|   660k|                if(pred_flag_l0)
  ------------------
  |  Branch (371:20): [True: 539k, False: 121k]
  ------------------
  372|   539k|                {
  373|   539k|                    mvp_x = s_pred_mv.s_l0_mv.i2_mvx;
  374|   539k|                    mvp_y = s_pred_mv.s_l0_mv.i2_mvy;
  375|   539k|                    mvd_x = ps_pu->mv.s_l0_mv.i2_mvx;
  376|   539k|                    mvd_y = ps_pu->mv.s_l0_mv.i2_mvy;
  377|       |
  378|   539k|                    tmp_x = (mvp_x + mvd_x + two_pow_16) & (two_pow_16 - 1);
  379|   539k|                    tmp_x = tmp_x >= two_pow_15 ?
  ------------------
  |  Branch (379:29): [True: 180k, False: 358k]
  ------------------
  380|   358k|                                    (tmp_x - two_pow_16) : tmp_x;
  381|   539k|                    ps_pu->mv.s_l0_mv.i2_mvx = tmp_x;
  382|   539k|                    tmp_y = (mvp_y + mvd_y + two_pow_16) & (two_pow_16 - 1);
  383|   539k|                    tmp_y = tmp_y >= two_pow_15 ?
  ------------------
  |  Branch (383:29): [True: 172k, False: 366k]
  ------------------
  384|   366k|                                    (tmp_y - two_pow_16) : tmp_y;
  385|   539k|                    ps_pu->mv.s_l0_mv.i2_mvy = tmp_y;
  386|   539k|                }
  387|       |                /* L1 MV */
  388|   660k|                if(pred_flag_l1)
  ------------------
  |  Branch (388:20): [True: 230k, False: 429k]
  ------------------
  389|   230k|                {
  390|   230k|                    mvp_x = s_pred_mv.s_l1_mv.i2_mvx;
  391|   230k|                    mvp_y = s_pred_mv.s_l1_mv.i2_mvy;
  392|   230k|                    mvd_x = ps_pu->mv.s_l1_mv.i2_mvx;
  393|   230k|                    mvd_y = ps_pu->mv.s_l1_mv.i2_mvy;
  394|       |
  395|   230k|                    tmp_x = (mvp_x + mvd_x + two_pow_16) & (two_pow_16 - 1);
  396|   230k|                    tmp_x = tmp_x >= two_pow_15 ?
  ------------------
  |  Branch (396:29): [True: 69.2k, False: 161k]
  ------------------
  397|   161k|                                    (tmp_x - two_pow_16) : tmp_x;
  398|   230k|                    ps_pu->mv.s_l1_mv.i2_mvx = tmp_x;
  399|   230k|                    tmp_y = (mvp_y + mvd_y + two_pow_16) & (two_pow_16 - 1);
  400|   230k|                    tmp_y = tmp_y >= two_pow_15 ?
  ------------------
  |  Branch (400:29): [True: 64.9k, False: 165k]
  ------------------
  401|   165k|                                    (tmp_y - two_pow_16) : tmp_y;
  402|   230k|                    ps_pu->mv.s_l1_mv.i2_mvy = tmp_y;
  403|   230k|                }
  404|   660k|            }
  405|  71.3M|            else
  406|  71.3M|            {
  407|  71.3M|                WORD32 part_mode;
  408|  71.3M|                WORD32 part_idx;
  409|  71.3M|                part_mode = ps_pu->b3_part_mode;
  410|       |                //TODO: Get part_idx
  411|  71.3M|                part_idx = ps_pu->b2_part_idx;
  412|       |
  413|  71.3M|                ihevcd_mv_merge(ps_mv_ctxt, pu4_top_pu_idx, pu4_left_pu_idx,
  414|  71.3M|                                nbr_pu_idx_strd, ps_pu, part_mode,
  415|  71.3M|                                part_idx, pu_wd_single_mcl, pu_ht_single_mcl,
  416|  71.3M|                                pu_x_in_4x4_single_mcl << 2, pu_y_in_4x4_single_mcl << 2,
  417|  71.3M|                                single_mcl_flag, u1_lb_avail, u1_l_avail, u1_tr_avail,
  418|  71.3M|                                u1_t_avail, u1_tl_avail);
  419|       |
  420|  71.3M|                if(PRED_BI == ps_pu->b2_pred_mode)
  ------------------
  |  Branch (420:20): [True: 61.1M, False: 10.1M]
  ------------------
  421|  61.1M|                {
  422|  61.1M|                    if(((ps_pu->b3_part_mode == PART_2NxN) && (pu_wd == 8))
  ------------------
  |  Branch (422:25): [True: 75.2k, False: 61.0M]
  |  Branch (422:63): [True: 55.0k, False: 20.2k]
  ------------------
  423|  61.1M|                                    || ((ps_pu->b3_part_mode == PART_Nx2N)
  ------------------
  |  Branch (423:41): [True: 88.3k, False: 61.0M]
  ------------------
  424|  88.3k|                                                    && (pu_ht == 8)))
  ------------------
  |  Branch (424:56): [True: 53.8k, False: 34.4k]
  ------------------
  425|   108k|                    {
  426|   108k|                        ps_pu->b2_pred_mode = PRED_L0;
  427|   108k|                    }
  428|  61.1M|                }
  429|  71.3M|            }
  430|  71.9M|        }
  431|       |
  432|  72.3M|        {
  433|  72.3M|            slice_header_t *ps_slice_hdr;
  434|  72.3M|            pic_buf_t *ps_pic_buf_l0, *ps_pic_buf_l1;
  435|  72.3M|            ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  436|  72.3M|            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.3M|            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.3M|            ps_pu->mv.i1_l0_ref_pic_buf_id = ps_pic_buf_l0->u1_buf_id;
  439|  72.3M|            if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (439:16): [True: 72.5M, False: 18.4E]
  ------------------
  440|  72.5M|            {
  441|  72.5M|                ps_pu->mv.i1_l1_ref_pic_buf_id = ps_pic_buf_l1->u1_buf_id;
  442|  72.5M|            }
  443|  72.3M|        }
  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.3M|        {
  449|  72.3M|            WORD32 trans_in_min_tu;
  450|  72.3M|            UWORD32 cur_tu_in_bits;
  451|  72.3M|            UWORD32 cur_tu_avail_flag;
  452|       |
  453|  72.3M|            trans_in_min_tu = pu_wd / MIN_PU_SIZE;
  ------------------
  |  |  367|  72.3M|#define MIN_PU_SIZE         4
  ------------------
  454|  72.3M|            cur_tu_in_bits = (1 << trans_in_min_tu) - 1;
  455|  72.3M|            cur_tu_in_bits = cur_tu_in_bits << (32 - trans_in_min_tu);
  456|       |
  457|  72.3M|            cur_tu_avail_flag = cur_tu_in_bits >> (pu_x_in_4x4 + 1);
  458|       |
  459|   222M|            for(i = 0; i < pu_ht / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|   222M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (459:24): [True: 150M, False: 72.3M]
  ------------------
  460|   150M|                au4_nbr_avail[1 + pu_y_in_4x4 + i] |= cur_tu_avail_flag;
  461|  72.3M|        }
  462|       |
  463|       |        /* Neighbor PU idx update inside CTB */
  464|       |        /* 1byte per 4x4. Indicates the PU idx that 4x4 block belongs to */
  465|       |
  466|  72.3M|        {
  467|  72.3M|            WORD32 row, col;
  468|  72.3M|            UWORD32 cur_pu_idx;
  469|  72.3M|            WORD32 offset;
  470|  72.3M|            cur_pu_idx = ctb_start_pu_idx + pu_cnt;
  471|       |
  472|  72.3M|            offset = (1 + pu_x_in_4x4 + 0) + (1 + pu_y_in_4x4 + 0) * nbr_pu_idx_strd;
  473|       |
  474|   220M|            for(row = 0; row < pu_ht / MIN_PU_SIZE; row++)
  ------------------
  |  |  367|   220M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (474:26): [True: 148M, False: 72.3M]
  ------------------
  475|   148M|            {
  476|   484M|                for(col = 0; col < pu_wd / MIN_PU_SIZE; col++)
  ------------------
  |  |  367|   484M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (476:30): [True: 336M, False: 148M]
  ------------------
  477|   336M|                {
  478|   336M|                    pu4_nbr_pu_idx[offset + col] = cur_pu_idx;
  479|   336M|                }
  480|   148M|                offset += nbr_pu_idx_strd;
  481|   148M|            }
  482|  72.3M|        }
  483|       |
  484|  72.3M|    }
  485|       |
  486|       |    /* Updating Top and Left pointers */
  487|  3.73M|    {
  488|  3.73M|        WORD32 offset_top, offset_left;
  489|       |
  490|  3.73M|        offset_left = ctb_size_in_min_pu + (0 + 1) * nbr_pu_idx_strd;
  491|  3.73M|        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|  3.73M|        pu4_ctb_top_left_pu_idx[0] = pu4_ctb_top_pu_idx[ctb_size_in_min_pu - 1];
  496|       |
  497|  38.3M|        for(i = 0; i < ctb_size_in_min_pu; i++)
  ------------------
  |  Branch (497:20): [True: 34.6M, False: 3.73M]
  ------------------
  498|  34.6M|        {
  499|       |            /* Left */
  500|       |            /* Last column of au4_nbr_pu_idx */
  501|  34.6M|            pu4_ctb_left_pu_idx[i] = pu4_nbr_pu_idx[offset_left];
  502|       |            /* Top */
  503|       |            /* Last row of au4_nbr_pu_idx */
  504|  34.6M|            pu4_ctb_top_pu_idx[i] = pu4_nbr_pu_idx[offset_top];
  505|       |
  506|  34.6M|            offset_left += nbr_pu_idx_strd;
  507|  34.6M|            offset_top += 1;
  508|  34.6M|        }
  509|  3.73M|    }
  510|       |
  511|       |    /* Updating the CTB level PU idx (Used for collocated MV pred)*/
  512|  3.73M|    {
  513|  3.73M|        WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map;
  514|  3.73M|        WORD32 first_pu_of_ctb;
  515|  3.73M|        first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd];
  516|  3.73M|        UWORD32 cur_ctb_ht_in_min_pu = MIN(((ps_sps->i2_pic_height_in_luma_samples
  ------------------
  |  |   43|  3.73M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 139k, False: 3.59M]
  |  |  ------------------
  ------------------
  517|  3.73M|                    - (ps_mv_ctxt->i4_ctb_y << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  518|  3.73M|        UWORD32 cur_ctb_wd_in_min_pu = MIN(((ps_sps->i2_pic_width_in_luma_samples
  ------------------
  |  |   43|  3.73M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 332k, False: 3.39M]
  |  |  ------------------
  ------------------
  519|  3.73M|                    - (ps_mv_ctxt->i4_ctb_x << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  520|       |
  521|  3.73M|        index_pic_map = 0 * ctb_size_in_min_pu + 0;
  522|  3.73M|        index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1);
  523|       |
  524|  37.3M|        for(ctb_row = 0; ctb_row < cur_ctb_ht_in_min_pu; ctb_row++)
  ------------------
  |  Branch (524:26): [True: 33.6M, False: 3.73M]
  ------------------
  525|  33.6M|        {
  526|   386M|            for(ctb_col = 0; ctb_col < cur_ctb_wd_in_min_pu; ctb_col++)
  ------------------
  |  Branch (526:30): [True: 352M, False: 33.6M]
  ------------------
  527|   352M|            {
  528|   352M|                pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col]
  529|   352M|                                - first_pu_of_ctb;
  530|   352M|            }
  531|  33.6M|            index_pic_map += ctb_size_in_min_pu;
  532|  33.6M|            index_nbr_map += nbr_pu_idx_strd;
  533|  33.6M|        }
  534|  3.73M|    }
  535|  3.73M|    return num_pu_per_ctb;
  536|  3.73M|}

ihevcd_inter_pred_ctb:
   95|  3.75M|{
   96|  3.75M|    UWORD8 *ref_pic_luma_l0, *ref_pic_chroma_l0;
   97|  3.75M|    UWORD8 *ref_pic_luma_l1, *ref_pic_chroma_l1;
   98|       |
   99|  3.75M|    UWORD8 *ref_pic_l0 = NULL, *ref_pic_l1 = NULL;
  100|       |
  101|  3.75M|    slice_header_t *ps_slice_hdr;
  102|  3.75M|    sps_t *ps_sps;
  103|  3.75M|    pps_t *ps_pps;
  104|  3.75M|    pu_t *ps_pu;
  105|  3.75M|    codec_t *ps_codec;
  106|  3.75M|    pred_wt_ofst_t *ps_wt_ofst;
  107|  3.75M|    WORD32 pu_indx;
  108|  3.75M|    WORD32 pu_x, pu_y;
  109|  3.75M|    WORD32 pu_wd, pu_ht;
  110|  3.75M|    WORD32 i4_pu_cnt;
  111|  3.75M|    WORD32 cur_ctb_idx;
  112|       |
  113|  3.75M|    WORD32 clr_indx;
  114|  3.75M|    WORD32 ntaps;
  115|       |
  116|       |
  117|       |
  118|  3.75M|    WORD32 ai2_xint[2] = { 0, 0 }, ai2_yint[2] = { 0, 0 };
  119|  3.75M|    WORD32 ai2_xfrac[2] = { 0, 0 }, ai2_yfrac[2] = { 0, 0 };
  120|       |
  121|  3.75M|    WORD32 weighted_pred, bi_pred;
  122|       |
  123|  3.75M|    WORD32 ref_strd;
  124|  3.75M|    UWORD8 *pu1_dst_luma, *pu1_dst_chroma;
  125|       |
  126|  3.75M|    UWORD8 *pu1_dst;
  127|       |
  128|  3.75M|    WORD16 *pi2_tmp1, *pi2_tmp2;
  129|       |
  130|  3.75M|    WORD32 luma_weight_l0, luma_weight_l1;
  131|  3.75M|    WORD32 chroma_weight_l0_cb, chroma_weight_l1_cb, chroma_weight_l0_cr, chroma_weight_l1_cr;
  132|  3.75M|    WORD32 luma_offset_l0, luma_offset_l1;
  133|  3.75M|    WORD32 chroma_offset_l0_cb, chroma_offset_l1_cb, chroma_offset_l0_cr, chroma_offset_l1_cr;
  134|  3.75M|    WORD32 shift, lvl_shift1, lvl_shift2;
  135|       |
  136|  3.75M|    pf_inter_pred func_ptr1, func_ptr2, func_ptr3, func_ptr4;
  137|  3.75M|    pf_hbd_inter_pred hbd_func_ptr1, hbd_func_ptr2, hbd_func_ptr3, hbd_func_ptr4;
  138|  3.75M|    WORD32 func_indx1, func_indx2, func_indx3, func_indx4;
  139|  3.75M|    void *func_src;
  140|  3.75M|    void *func_dst;
  141|  3.75M|    WORD32 func_src_strd;
  142|  3.75M|    WORD32 func_dst_strd;
  143|  3.75M|    WORD8 *func_coeff;
  144|  3.75M|    WORD32 func_wd;
  145|  3.75M|    WORD32 func_ht;
  146|  3.75M|    WORD32 next_ctb_idx;
  147|  3.75M|    WORD8(*coeff)[8];
  148|  3.75M|    WORD32  chroma_yuv420sp_vu;
  149|  3.75M|    WORD32 num_comp;
  150|  3.75M|    WORD32 h_samp_factor, v_samp_factor;
  151|  3.75M|    WORD32 chroma_pixel_strd = 2;
  152|  3.75M|    WORD32 is_yuv420, is_yuv422, is_yuv444;
  153|  3.75M|    WORD32 pixel_size_y, pixel_size_uv;
  154|  3.75M|    WORD32 bit_depth_luma, bit_depth_chroma;
  155|  3.75M|    WORD32 wp_ofst_bd_shift_luma, wp_ofst_bd_shift_chroma;
  156|       |
  157|  3.75M|    PROFILE_DISABLE_INTER_PRED();
  ------------------
  |  |   69|  3.75M|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
  158|  3.75M|    ps_codec = ps_proc->ps_codec;
  159|  3.75M|    pixel_size_y     = ps_codec->i4_pixel_size_y;
  160|  3.75M|    pixel_size_uv    = ps_codec->i4_pixel_size_uv;
  161|  3.75M|    bit_depth_luma   = ps_codec->i4_bit_depth_luma;
  162|  3.75M|    bit_depth_chroma = ps_codec->i4_bit_depth_chroma;
  163|  3.75M|    ps_slice_hdr = ps_proc->ps_slice_hdr;
  164|  3.75M|    ps_wt_ofst = &ps_slice_hdr->s_wt_ofst;
  165|  3.75M|    ps_pps = ps_proc->ps_pps;
  166|  3.75M|    ps_sps = ps_proc->ps_sps;
  167|  3.75M|    cur_ctb_idx = ps_proc->i4_ctb_x
  168|  3.75M|                    + 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|  3.75M|    next_ctb_idx = ps_proc->i4_next_pu_ctb_cnt;
  174|  3.75M|    i4_pu_cnt = ps_proc->pu4_pic_pu_idx[next_ctb_idx] - ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  175|       |
  176|  3.75M|    ps_pu = ps_proc->ps_pu;
  177|  3.75M|    ref_strd = ps_codec->i4_strd;
  178|  3.75M|    pi2_tmp1 = ps_proc->pi2_inter_pred_tmp_buf1;
  179|  3.75M|    pi2_tmp2 = ps_proc->pi2_inter_pred_tmp_buf2;
  180|  3.75M|    pu1_dst_luma = ps_proc->pu1_cur_pic_luma;
  181|  3.75M|    pu1_dst_chroma = ps_proc->pu1_cur_pic_chroma;
  182|       |
  183|  3.75M|    chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
  184|       |
  185|  3.75M|    ASSERT(PSLICE == ps_slice_hdr->i1_slice_type || BSLICE == ps_slice_hdr->i1_slice_type);
  ------------------
  |  |   55|  3.75M|#define ASSERT(x) {}
  ------------------
  186|       |
  187|  3.75M|    ref_pic_luma_l0 = NULL;
  188|  3.75M|    ref_pic_chroma_l0 = NULL;
  189|       |
  190|  3.75M|    luma_weight_l0 = 0;
  191|  3.75M|    chroma_weight_l0_cb = 0;
  192|  3.75M|    chroma_weight_l0_cr = 0;
  193|       |
  194|  3.75M|    luma_offset_l0 = 0;
  195|  3.75M|    chroma_offset_l0_cb = 0;
  196|  3.75M|    chroma_offset_l0_cr = 0;
  197|       |
  198|  3.75M|    ref_pic_luma_l1 = NULL;
  199|  3.75M|    ref_pic_chroma_l1 = NULL;
  200|       |
  201|  3.75M|    luma_weight_l1 = 0;
  202|  3.75M|    chroma_weight_l1_cb = 0;
  203|  3.75M|    chroma_weight_l1_cr = 0;
  204|       |
  205|  3.75M|    luma_offset_l1 = 0;
  206|  3.75M|    chroma_offset_l1_cb = 0;
  207|  3.75M|    chroma_offset_l1_cr = 0;
  208|       |
  209|  3.75M|    num_comp = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME ? 1 : 2;
  ------------------
  |  Branch (209:16): [True: 4.16k, False: 3.75M]
  ------------------
  210|  3.75M|    is_yuv420 = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 1 : 0;
  ------------------
  |  Branch (210:17): [True: 3.73M, False: 27.9k]
  ------------------
  211|  3.75M|    is_yuv422 = (CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc) ? 1 : 0;
  ------------------
  |  Branch (211:17): [True: 31.9k, False: 3.72M]
  ------------------
  212|  3.75M|    is_yuv444 = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 0;
  ------------------
  |  Branch (212:17): [True: 0, False: 3.75M]
  ------------------
  213|  3.75M|    h_samp_factor = is_yuv444 ? 1 : 2;
  ------------------
  |  Branch (213:21): [True: 0, False: 3.75M]
  ------------------
  214|  3.75M|    v_samp_factor = is_yuv420 ? 2 : 1;
  ------------------
  |  Branch (214:21): [True: 3.72M, False: 33.1k]
  ------------------
  215|       |
  216|  3.75M|    wp_ofst_bd_shift_luma = ps_sps->i1_use_high_precision_pred_wt ? 0 : (bit_depth_luma - 8);
  ------------------
  |  Branch (216:29): [True: 2.21k, False: 3.75M]
  ------------------
  217|  3.75M|    wp_ofst_bd_shift_chroma = ps_sps->i1_use_high_precision_pred_wt ? 0 : (bit_depth_chroma - 8);
  ------------------
  |  Branch (217:31): [True: 2.21k, False: 3.75M]
  ------------------
  218|       |
  219|  76.3M|    for(pu_indx = 0; pu_indx < i4_pu_cnt; pu_indx++, ps_pu++)
  ------------------
  |  Branch (219:22): [True: 72.5M, False: 3.75M]
  ------------------
  220|  72.5M|    {
  221|       |        /* If the PU is intra then proceed to the next */
  222|  72.5M|        if(1 == ps_pu->b1_intra_flag)
  ------------------
  |  Branch (222:12): [True: 102k, False: 72.4M]
  ------------------
  223|   102k|            continue;
  224|  72.4M|        pu_x = (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size) + (ps_pu->b4_pos_x << 2);
  225|  72.4M|        pu_y = (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size) + (ps_pu->b4_pos_y << 2);
  226|       |
  227|  72.4M|        pu_wd = (ps_pu->b4_wd + 1) << 2;
  228|  72.4M|        pu_ht = (ps_pu->b4_ht + 1) << 2;
  229|       |
  230|  72.4M|        weighted_pred = (ps_slice_hdr->i1_slice_type == PSLICE) ? ps_pps->i1_weighted_pred_flag :
  ------------------
  |  Branch (230:25): [True: 455k, False: 72.0M]
  ------------------
  231|  72.4M|                        ps_pps->i1_weighted_bipred_flag;
  232|  72.4M|        bi_pred = (ps_pu->b2_pred_mode == PRED_BI);
  233|       |
  234|  72.4M|        if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (234:12): [True: 69.8M, False: 2.62M]
  ------------------
  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.6k]
  ------------------
  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|  72.4M|        if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (256:12): [True: 64.3M, False: 8.12M]
  ------------------
  257|  64.3M|        {
  258|  64.3M|            pic_buf_t *ps_pic_buf_l1;
  259|  64.3M|            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|  64.3M|            ref_pic_luma_l1 = ps_pic_buf_l1->pu1_luma;
  261|       |
  262|  64.3M|            luma_weight_l1 = ps_wt_ofst->i2_luma_weight_l1[ps_pu->mv.i1_l1_ref_idx];
  263|  64.3M|            luma_offset_l1 = ps_wt_ofst->i2_luma_offset_l1[ps_pu->mv.i1_l1_ref_idx] << wp_ofst_bd_shift_luma;
  264|       |
  265|  64.3M|            if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (265:16): [True: 64.4M, False: 18.4E]
  ------------------
  266|  64.4M|            {
  267|  64.4M|                ref_pic_chroma_l1 = ps_pic_buf_l1->pu1_chroma;
  268|  64.4M|                chroma_weight_l1_cb = ps_wt_ofst->i2_chroma_weight_l1_cb[ps_pu->mv.i1_l1_ref_idx];
  269|  64.4M|                chroma_weight_l1_cr = ps_wt_ofst->i2_chroma_weight_l1_cr[ps_pu->mv.i1_l1_ref_idx];
  270|       |
  271|  64.4M|                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|  64.4M|                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|  64.4M|            }
  274|  64.3M|        }
  275|       |
  276|       |        /*luma and chroma components*/
  277|   213M|        for(clr_indx = 0; clr_indx < num_comp; clr_indx++)
  ------------------
  |  Branch (277:27): [True: 141M, False: 72.4M]
  ------------------
  278|   141M|        {
  279|   141M|            WORD32 pixel_size;
  280|   141M|            UWORD8 u1_bit_depth;
  281|       |
  282|   141M|            PROFILE_DISABLE_INTER_PRED_LUMA(clr_indx);
  ------------------
  |  |   98|   141M|#define PROFILE_DISABLE_INTER_PRED_LUMA(clr_indx) ;
  ------------------
  283|   141M|            PROFILE_DISABLE_INTER_PRED_CHROMA(clr_indx);
  ------------------
  |  |   99|   141M|#define PROFILE_DISABLE_INTER_PRED_CHROMA(clr_indx) ;
  ------------------
  284|       |
  285|   141M|            if(clr_indx == 0)
  ------------------
  |  Branch (285:16): [True: 73.2M, False: 68.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: 70.6M, False: 2.65M]
  ------------------
  292|  70.6M|                {
  293|  70.6M|                    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|  70.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.28M, False: 69.3M]
  |  |  |  Branch (40:53): [True: 973k, False: 68.3M]
  |  |  ------------------
  ------------------
  294|  70.6M|                    ai2_xint[0] = pu_x + (mv >> 2);
  295|  70.6M|                    ai2_xfrac[0] = mv & 3;
  296|       |
  297|  70.6M|                    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|  70.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 725k, False: 69.8M]
  |  |  |  Branch (40:53): [True: 789k, False: 69.0M]
  |  |  ------------------
  ------------------
  298|  70.6M|                    ai2_yint[0] = pu_y + (mv >> 2);
  299|  70.6M|                    ai2_yfrac[0] = mv & 3;
  300|       |
  301|  70.6M|                    ai2_xfrac[0] &= ps_codec->i4_mv_frac_mask;
  302|  70.6M|                    ai2_yfrac[0] &= ps_codec->i4_mv_frac_mask;
  303|       |
  304|       |
  305|  70.6M|                    ref_pic_l0 = ref_pic_luma_l0 + (ai2_yint[0] * ref_strd
  306|  70.6M|                                    + ai2_xint[0]) * pixel_size_y;
  307|  70.6M|                }
  308|       |
  309|  73.2M|                if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (309:20): [True: 64.0M, False: 9.20M]
  ------------------
  310|  64.0M|                {
  311|       |
  312|  64.0M|                    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.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.06M, False: 62.9M]
  |  |  |  Branch (40:53): [True: 863k, False: 62.1M]
  |  |  ------------------
  ------------------
  313|  64.0M|                    ai2_xint[1] = pu_x + (mv >> 2);
  314|  64.0M|                    ai2_xfrac[1] = mv & 3;
  315|       |
  316|  64.0M|                    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.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 701k, False: 63.3M]
  |  |  |  Branch (40:53): [True: 628k, False: 62.7M]
  |  |  ------------------
  ------------------
  317|  64.0M|                    ai2_yint[1] = pu_y + (mv >> 2);
  318|  64.0M|                    ai2_yfrac[1] = mv & 3;
  319|       |
  320|  64.0M|                    ref_pic_l1 = ref_pic_luma_l1 + (ai2_yint[1] * ref_strd
  321|  64.0M|                                    + ai2_xint[1]) * pixel_size_y;
  322|  64.0M|                    ai2_xfrac[1] &= ps_codec->i4_mv_frac_mask;
  323|  64.0M|                    ai2_yfrac[1] &= ps_codec->i4_mv_frac_mask;
  324|       |
  325|  64.0M|                }
  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|  68.2M|            else
  334|  68.2M|            {
  335|  68.2M|                WORD32 mv;
  336|  68.2M|                pixel_size = pixel_size_uv;
  337|  68.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|  68.2M|                if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (341:20): [True: 70.4M, False: 18.4E]
  ------------------
  342|  70.4M|                {
  343|  70.4M|                    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|  70.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.27M, False: 69.1M]
  |  |  |  Branch (40:53): [True: 967k, False: 68.1M]
  |  |  ------------------
  ------------------
  344|  70.4M|                    ai2_xint[0] = (pu_x *  chroma_pixel_strd / h_samp_factor) + (mv >> (2 + h_samp_factor - 1)) * chroma_pixel_strd;
  345|  70.4M|                    ai2_xfrac[0] = mv & (is_yuv444 ? 3 : 7);
  ------------------
  |  Branch (345:42): [True: 0, False: 70.4M]
  ------------------
  346|       |
  347|  70.4M|                    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|  70.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 722k, False: 69.6M]
  |  |  |  Branch (40:53): [True: 779k, False: 68.9M]
  |  |  ------------------
  ------------------
  348|  70.4M|                    ai2_yint[0] = ((pu_y / v_samp_factor) + (mv >> (2 + v_samp_factor - 1)));
  349|  70.4M|                    ai2_yfrac[0] = mv & (is_yuv420 ? 7 : 3);
  ------------------
  |  Branch (349:42): [True: 70.1M, False: 269k]
  ------------------
  350|       |
  351|  70.4M|                    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|  70.4M|                    ai2_xfrac[0] &= ps_codec->i4_mv_frac_mask;
  354|  70.4M|                    ai2_yfrac[0] &= ps_codec->i4_mv_frac_mask;
  355|       |
  356|  70.4M|                }
  357|       |
  358|  68.2M|                if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (358:20): [True: 64.0M, False: 4.14M]
  ------------------
  359|  64.0M|                {
  360|  64.0M|                    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.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.06M, False: 63.0M]
  |  |  |  Branch (40:53): [True: 854k, False: 62.1M]
  |  |  ------------------
  ------------------
  361|  64.0M|                    ai2_xint[1] = (pu_x *  chroma_pixel_strd / h_samp_factor) + (mv >> (2 + h_samp_factor - 1)) * chroma_pixel_strd;
  362|  64.0M|                    ai2_xfrac[1] = mv & (is_yuv444 ? 3 : 7);
  ------------------
  |  Branch (362:42): [True: 0, False: 64.0M]
  ------------------
  363|       |
  364|  64.0M|                    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.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 689k, False: 63.3M]
  |  |  |  Branch (40:53): [True: 620k, False: 62.7M]
  |  |  ------------------
  ------------------
  365|  64.0M|                    ai2_yint[1] = ((pu_y / v_samp_factor) + (mv >> (2 + v_samp_factor - 1)));
  366|  64.0M|                    ai2_yfrac[1] = mv & (is_yuv420 ? 7 : 3);
  ------------------
  |  Branch (366:42): [True: 63.8M, False: 234k]
  ------------------
  367|       |
  368|  64.0M|                    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.0M|                    ai2_xfrac[1] &= ps_codec->i4_mv_frac_mask;
  371|  64.0M|                    ai2_yfrac[1] &= ps_codec->i4_mv_frac_mask;
  372|       |
  373|  64.0M|                }
  374|       |
  375|  68.2M|                pu1_dst = pu1_dst_chroma + ((pu_y / v_samp_factor) * (ref_strd * chroma_pixel_strd / h_samp_factor) +
  376|  68.2M|                                (pu_x * chroma_pixel_strd / h_samp_factor)) * pixel_size_uv;
  377|       |
  378|  68.2M|                ntaps = NTAPS_CHROMA;
  ------------------
  |  |   40|  68.2M|#define NTAPS_CHROMA 4
  ------------------
  379|  68.2M|                coeff = gai1_ihevc_chroma_filter;
  380|  68.2M|            }
  381|       |
  382|   141M|            if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (382:16): [True: 135M, False: 5.88M]
  ------------------
  383|   135M|            {
  384|   135M|                func_indx1 = 4 * (weighted_pred || bi_pred) + 1 + 11 * clr_indx;
  ------------------
  |  Branch (384:35): [True: 46.9M, False: 88.6M]
  |  Branch (384:52): [True: 72.8M, False: 15.8M]
  ------------------
  385|   135M|                func_indx1 += ai2_xfrac[0] ? 2 : 0;
  ------------------
  |  Branch (385:31): [True: 24.1M, False: 111M]
  ------------------
  386|   135M|                func_indx1 += ai2_yfrac[0] ? 1 : 0;
  ------------------
  |  Branch (386:31): [True: 24.5M, False: 111M]
  ------------------
  387|       |
  388|   135M|                func_indx2 = (ai2_xfrac[0] && ai2_yfrac[0])
  ------------------
  |  Branch (388:31): [True: 24.4M, False: 111M]
  |  Branch (388:47): [True: 14.4M, False: 10.0M]
  ------------------
  389|   135M|                                * (9 + (weighted_pred || bi_pred)) + 11 * clr_indx;
  ------------------
  |  Branch (389:41): [True: 46.8M, False: 88.7M]
  |  Branch (389:58): [True: 72.8M, False: 15.8M]
  ------------------
  390|       |
  391|   135M|                func_ptr1 = ps_codec->apf_inter_pred[func_indx1];
  392|   135M|                func_ptr2 = ps_codec->apf_inter_pred[func_indx2];
  393|   135M|                hbd_func_ptr1 = ps_codec->apf_hbd_inter_pred[func_indx1];
  394|   135M|                hbd_func_ptr2 = ps_codec->apf_hbd_inter_pred[func_indx2];
  395|   135M|            }
  396|  5.88M|            else
  397|  5.88M|            {
  398|  5.88M|                func_ptr1 = NULL;
  399|  5.88M|                func_ptr2 = NULL;
  400|  5.88M|                hbd_func_ptr1 = NULL;
  401|  5.88M|                hbd_func_ptr2 = NULL;
  402|  5.88M|            }
  403|   141M|            if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (403:16): [True: 123M, False: 17.6M]
  ------------------
  404|   123M|            {
  405|   123M|                func_indx3 = 4 * (weighted_pred || bi_pred) + 1 + 11 * clr_indx;
  ------------------
  |  Branch (405:35): [True: 46.3M, False: 77.5M]
  |  Branch (405:52): [True: 72.8M, False: 4.69M]
  ------------------
  406|   123M|                func_indx3 += ai2_xfrac[1] ? 2 : 0;
  ------------------
  |  Branch (406:31): [True: 13.6M, False: 110M]
  ------------------
  407|   123M|                func_indx3 += ai2_yfrac[1] ? 1 : 0;
  ------------------
  |  Branch (407:31): [True: 15.5M, False: 108M]
  ------------------
  408|       |
  409|   123M|                func_indx4 = (ai2_xfrac[1] && ai2_yfrac[1])
  ------------------
  |  Branch (409:31): [True: 13.8M, False: 110M]
  |  Branch (409:47): [True: 7.25M, False: 6.56M]
  ------------------
  410|   123M|                                * (9 + (weighted_pred || bi_pred)) + 11 * clr_indx;
  ------------------
  |  Branch (410:41): [True: 46.2M, False: 77.6M]
  |  Branch (410:58): [True: 72.9M, False: 4.70M]
  ------------------
  411|       |
  412|   123M|                func_ptr3 = ps_codec->apf_inter_pred[func_indx3];
  413|   123M|                func_ptr4 = ps_codec->apf_inter_pred[func_indx4];
  414|   123M|                hbd_func_ptr3 = ps_codec->apf_hbd_inter_pred[func_indx3];
  415|   123M|                hbd_func_ptr4 = ps_codec->apf_hbd_inter_pred[func_indx4];
  416|   123M|            }
  417|  17.6M|            else
  418|  17.6M|            {
  419|  17.6M|                func_ptr3 = NULL;
  420|  17.6M|                func_ptr4 = NULL;
  421|  17.6M|                hbd_func_ptr3 = NULL;
  422|  17.6M|                hbd_func_ptr4 = NULL;
  423|  17.6M|            }
  424|       |
  425|       |            /*Function 1*/
  426|   141M|            if(func_ptr1 != NULL)
  ------------------
  |  Branch (426:16): [True: 135M, False: 6.20M]
  ------------------
  427|   135M|            {
  428|   135M|                func_src_strd = ref_strd;
  429|   135M|                if (clr_indx != 0)
  ------------------
  |  Branch (429:21): [True: 70.3M, False: 64.9M]
  ------------------
  430|  70.3M|                {
  431|  70.3M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  432|  70.3M|                }
  433|   135M|                func_src = (ai2_xfrac[0] && ai2_yfrac[0]) ?
  ------------------
  |  Branch (433:29): [True: 24.5M, False: 110M]
  |  Branch (433:45): [True: 14.4M, False: 10.0M]
  ------------------
  434|  14.4M|                                ref_pic_l0 - (ntaps / 2 - 1) * func_src_strd * pixel_size :
  435|   135M|                                ref_pic_l0;
  436|   135M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (436:29): [True: 46.6M, False: 88.6M]
  |  Branch (436:46): [True: 72.6M, False: 16.0M]
  ------------------
  437|   119M|                                (void *)pi2_tmp1 : (void *)pu1_dst;
  438|   135M|                if(ai2_xfrac[0] && ai2_yfrac[0])
  ------------------
  |  Branch (438:20): [True: 24.5M, False: 110M]
  |  Branch (438:36): [True: 14.4M, False: 10.0M]
  ------------------
  439|  14.4M|                {
  440|  14.4M|                    func_dst = pi2_tmp1;
  441|  14.4M|                }
  442|       |
  443|   135M|                func_dst_strd = (weighted_pred || bi_pred
  ------------------
  |  Branch (443:34): [True: 46.7M, False: 88.4M]
  |  Branch (443:51): [True: 72.4M, False: 16.0M]
  ------------------
  444|  16.0M|                                || (ai2_xfrac[0] && ai2_yfrac[0])) ?
  ------------------
  |  Branch (444:37): [True: 8.86M, False: 7.16M]
  |  Branch (444:53): [True: 5.68M, False: 3.18M]
  ------------------
  445|   124M|                                pu_wd : ref_strd;
  446|   135M|                if (clr_indx != 0)
  ------------------
  |  Branch (446:21): [True: 70.1M, False: 65.0M]
  ------------------
  447|  70.1M|                {
  448|  70.1M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  449|  70.1M|                }
  450|   135M|                func_coeff = ai2_xfrac[0] ? coeff[ai2_xfrac[0] << (is_yuv444 ? clr_indx : 0)]
  ------------------
  |  Branch (450:30): [True: 24.4M, False: 110M]
  |  Branch (450:68): [True: 0, False: 24.4M]
  ------------------
  451|   135M|                                : coeff[ai2_yfrac[0] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (451:58): [True: 110M, False: 366k]
  ------------------
  452|   135M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (452:37): [True: 0, False: 135M]
  ------------------
  453|   135M|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (453:37): [True: 134M, False: 933k]
  ------------------
  454|   135M|                func_ht += (ai2_xfrac[0] && ai2_yfrac[0]) ? ntaps - 1 : 0;
  ------------------
  |  Branch (454:29): [True: 24.4M, False: 110M]
  |  Branch (454:45): [True: 14.3M, False: 10.0M]
  ------------------
  455|       |
  456|   135M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|   135M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (456:21): [True: 133M, False: 1.88M]
  ------------------
  457|   133M|                {
  458|   133M|                    func_ptr1(func_src, func_dst, func_src_strd, func_dst_strd,
  459|   133M|                              func_coeff, func_ht, func_wd);
  460|   133M|                }
  461|  1.88M|                else
  462|  1.88M|                {
  463|  1.88M|                    hbd_func_ptr1(func_src, func_dst,  func_src_strd, func_dst_strd,
  464|  1.88M|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  465|  1.88M|                }
  466|   135M|            }
  467|       |
  468|       |            /*Function 2*/
  469|   141M|            if(func_ptr2 != NULL)
  ------------------
  |  Branch (469:16): [True: 14.0M, False: 127M]
  ------------------
  470|  14.0M|            {
  471|  14.0M|                func_src_strd = pu_wd;
  472|  14.0M|                if (clr_indx != 0)
  ------------------
  |  Branch (472:21): [True: 8.32M, False: 5.67M]
  ------------------
  473|  8.32M|                {
  474|  8.32M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  475|  8.32M|                }
  476|  14.0M|                func_src = pi2_tmp1 + (ntaps / 2 - 1) * func_src_strd;
  477|  14.0M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (477:29): [True: 953k, False: 13.0M]
  |  Branch (477:46): [True: 7.59M, False: 5.45M]
  ------------------
  478|  8.61M|                                (void *)pi2_tmp1 : (void *)pu1_dst;
  479|       |
  480|  14.0M|                func_dst_strd = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (480:34): [True: 894k, False: 13.1M]
  |  Branch (480:51): [True: 7.64M, False: 5.46M]
  ------------------
  481|  8.63M|                                pu_wd : ref_strd;
  482|  14.0M|                if (clr_indx != 0)
  ------------------
  |  Branch (482:21): [True: 8.37M, False: 5.62M]
  ------------------
  483|  8.37M|                {
  484|  8.37M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  485|  8.37M|                }
  486|  18.4E|                func_coeff = coeff[ai2_yfrac[0] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (486:53): [True: 14.1M, False: 18.4E]
  ------------------
  487|  14.0M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (487:37): [True: 0, False: 14.0M]
  ------------------
  488|  18.4E|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (488:37): [True: 14.1M, False: 18.4E]
  ------------------
  489|       |
  490|  14.0M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  14.0M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (490:21): [True: 14.1M, False: 18.4E]
  ------------------
  491|  14.1M|                {
  492|  14.1M|                    func_ptr2(func_src, func_dst, func_src_strd, func_dst_strd,
  493|  14.1M|                              func_coeff, func_ht, func_wd);
  494|  14.1M|                }
  495|  18.4E|                else
  496|  18.4E|                {
  497|  18.4E|                    hbd_func_ptr2(func_src, func_dst, func_src_strd, func_dst_strd,
  498|  18.4E|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  499|  18.4E|                }
  500|  14.0M|            }
  501|       |
  502|   141M|            if(func_ptr3 != NULL)
  ------------------
  |  Branch (502:16): [True: 122M, False: 19.2M]
  ------------------
  503|   122M|            {
  504|   122M|                func_src_strd = ref_strd;
  505|   122M|                if (clr_indx != 0)
  ------------------
  |  Branch (505:21): [True: 62.8M, False: 59.3M]
  ------------------
  506|  62.8M|                {
  507|  62.8M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  508|  62.8M|                }
  509|   122M|                func_src = (ai2_xfrac[1] && ai2_yfrac[1]) ?
  ------------------
  |  Branch (509:29): [True: 13.7M, False: 108M]
  |  Branch (509:45): [True: 7.23M, False: 6.52M]
  ------------------
  510|  7.23M|                                ref_pic_l1 - (ntaps / 2 - 1) * func_src_strd * pixel_size :
  511|   122M|                                ref_pic_l1;
  512|       |
  513|   122M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (513:29): [True: 45.1M, False: 76.9M]
  |  Branch (513:46): [True: 72.3M, False: 4.69M]
  ------------------
  514|   117M|                                (void *)pi2_tmp2 : (void *)pu1_dst;
  515|   122M|                if(ai2_xfrac[1] && ai2_yfrac[1])
  ------------------
  |  Branch (515:20): [True: 13.7M, False: 108M]
  |  Branch (515:36): [True: 7.26M, False: 6.50M]
  ------------------
  516|  7.27M|                {
  517|  7.27M|                    func_dst = pi2_tmp2;
  518|  7.27M|                }
  519|   122M|                func_dst_strd = (weighted_pred || bi_pred
  ------------------
  |  Branch (519:34): [True: 45.1M, False: 77.0M]
  |  Branch (519:51): [True: 72.3M, False: 4.72M]
  ------------------
  520|  4.75M|                                || (ai2_xfrac[1] && ai2_yfrac[1])) ?
  ------------------
  |  Branch (520:37): [True: 2.61M, False: 2.14M]
  |  Branch (520:53): [True: 1.94M, False: 662k]
  ------------------
  521|   119M|                                pu_wd : ref_strd;
  522|   122M|                if (clr_indx != 0)
  ------------------
  |  Branch (522:21): [True: 62.8M, False: 59.3M]
  ------------------
  523|  62.8M|                {
  524|  62.8M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  525|  62.8M|                }
  526|   122M|                func_coeff = ai2_xfrac[1] ? coeff[ai2_xfrac[1] << (is_yuv444 ? clr_indx : 0)]
  ------------------
  |  Branch (526:30): [True: 13.7M, False: 108M]
  |  Branch (526:68): [True: 0, False: 13.7M]
  ------------------
  527|  18.4E|                                : coeff[ai2_yfrac[1] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (527:58): [True: 108M, False: 18.4E]
  ------------------
  528|   122M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (528:37): [True: 0, False: 122M]
  ------------------
  529|   122M|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (529:37): [True: 122M, False: 13.3k]
  ------------------
  530|       |
  531|   122M|                func_ht += (ai2_xfrac[1] && ai2_yfrac[1]) ? ntaps - 1 : 0;
  ------------------
  |  Branch (531:29): [True: 13.7M, False: 108M]
  |  Branch (531:45): [True: 7.24M, False: 6.53M]
  ------------------
  532|       |
  533|   122M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|   122M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (533:21): [True: 121M, False: 357k]
  ------------------
  534|   121M|                {
  535|   121M|                    func_ptr3(func_src, func_dst, func_src_strd, func_dst_strd,
  536|   121M|                              func_coeff, func_ht, func_wd);
  537|   121M|                }
  538|   357k|                else
  539|   357k|                {
  540|   357k|                    hbd_func_ptr3(func_src, func_dst, func_src_strd, func_dst_strd,
  541|   357k|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  542|   357k|                }
  543|       |
  544|       |
  545|   122M|            }
  546|       |
  547|   141M|            if(func_ptr4 != NULL)
  ------------------
  |  Branch (547:16): [True: 7.17M, False: 134M]
  ------------------
  548|  7.17M|            {
  549|  7.17M|                func_src_strd = pu_wd;
  550|  7.17M|                if (clr_indx != 0)
  ------------------
  |  Branch (550:21): [True: 4.48M, False: 2.68M]
  ------------------
  551|  4.48M|                {
  552|  4.48M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  553|  4.48M|                }
  554|  7.17M|                func_src = pi2_tmp2 + (ntaps / 2 - 1) * func_src_strd;
  555|       |
  556|  7.17M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (556:29): [True: 391k, False: 6.78M]
  |  Branch (556:46): [True: 4.86M, False: 1.92M]
  ------------------
  557|  5.28M|                                (void *)pi2_tmp2 : (void *)pu1_dst;
  558|  7.17M|                func_dst_strd = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (558:34): [True: 370k, False: 6.80M]
  |  Branch (558:51): [True: 4.88M, False: 1.92M]
  ------------------
  559|  5.28M|                                pu_wd : ref_strd;
  560|  7.17M|                if (clr_indx != 0)
  ------------------
  |  Branch (560:21): [True: 4.48M, False: 2.68M]
  ------------------
  561|  4.48M|                {
  562|  4.48M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  563|  4.48M|                }
  564|  18.4E|                func_coeff = coeff[ai2_yfrac[1] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (564:53): [True: 7.19M, False: 18.4E]
  ------------------
  565|  7.17M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (565:37): [True: 0, False: 7.17M]
  ------------------
  566|  18.4E|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (566:37): [True: 7.20M, False: 18.4E]
  ------------------
  567|       |
  568|  7.17M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  7.17M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (568:21): [True: 7.18M, False: 18.4E]
  ------------------
  569|  7.18M|                {
  570|  7.18M|                    func_ptr4(func_src, func_dst, func_src_strd, func_dst_strd,
  571|  7.18M|                              func_coeff, func_ht, func_wd);
  572|  7.18M|                }
  573|  18.4E|                else
  574|  18.4E|                {
  575|  18.4E|                    hbd_func_ptr4(func_src, func_dst, func_src_strd, func_dst_strd,
  576|  18.4E|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  577|  18.4E|                }
  578|       |
  579|  7.17M|            }
  580|       |
  581|   141M|            PROFILE_DISABLE_INTER_PRED_LUMA_AVERAGING(clr_indx);
  ------------------
  |  |  100|   141M|#define PROFILE_DISABLE_INTER_PRED_LUMA_AVERAGING(clr_indx) ;
  ------------------
  582|   141M|            PROFILE_DISABLE_INTER_PRED_CHROMA_AVERAGING(clr_indx);
  ------------------
  |  |  101|   141M|#define PROFILE_DISABLE_INTER_PRED_CHROMA_AVERAGING(clr_indx) ;
  ------------------
  583|       |
  584|       |
  585|   141M|            if((weighted_pred != 0) && (bi_pred != 0))
  ------------------
  |  Branch (585:16): [True: 46.4M, False: 95.0M]
  |  Branch (585:40): [True: 44.8M, False: 1.55M]
  ------------------
  586|  44.9M|            {
  587|  44.9M|                lvl_shift1 = 0;
  588|  44.9M|                lvl_shift2 = 0;
  589|  44.9M|                if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (589:20): [True: 23.4M, False: 21.4M]
  |  Branch (589:40): [True: 360k, False: 23.1M]
  |  Branch (589:56): [True: 241k, False: 118k]
  ------------------
  590|   241k|                    lvl_shift1 = (1 << 13);
  591|       |
  592|  44.9M|                if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (592:20): [True: 23.4M, False: 21.4M]
  |  Branch (592:40): [True: 220k, False: 23.2M]
  |  Branch (592:56): [True: 160k, False: 59.8k]
  ------------------
  593|   160k|                    lvl_shift2 = (1 << 13);
  594|       |
  595|       |
  596|  44.9M|                if(0 == clr_indx)
  ------------------
  |  Branch (596:20): [True: 23.4M, False: 21.4M]
  ------------------
  597|  23.4M|                {
  598|  23.4M|                    shift = ps_wt_ofst->i1_luma_log2_weight_denom
  599|  23.4M|                                + 14 - bit_depth_luma + 1;
  600|       |
  601|  23.4M|                    if (PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  23.4M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (601:25): [True: 23.2M, False: 209k]
  ------------------
  602|  23.2M|                    {
  603|  23.2M|                        ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr(pi2_tmp1,
  604|  23.2M|                                                                            pi2_tmp2,
  605|  23.2M|                                                                            pu1_dst,
  606|  23.2M|                                                                            pu_wd,
  607|  23.2M|                                                                            pu_wd,
  608|  23.2M|                                                                            ref_strd,
  609|  23.2M|                                                                            luma_weight_l0,
  610|  23.2M|                                                                            luma_offset_l0,
  611|  23.2M|                                                                            luma_weight_l1,
  612|  23.2M|                                                                            luma_offset_l1,
  613|  23.2M|                                                                            shift,
  614|  23.2M|                                                                            lvl_shift1,
  615|  23.2M|                                                                            lvl_shift2,
  616|  23.2M|                                                                            pu_ht,
  617|  23.2M|                                                                            pu_wd);
  618|  23.2M|                    }
  619|   209k|                    else
  620|   209k|                    {
  621|   209k|                        ps_codec->s_func_selector.ihevc_hbd_weighted_pred_bi_fptr(pi2_tmp1,
  622|   209k|                                                                                  pi2_tmp2,
  623|   209k|                                                                                  (UWORD16 *)pu1_dst,
  624|   209k|                                                                                  pu_wd,
  625|   209k|                                                                                  pu_wd,
  626|   209k|                                                                                  ref_strd,
  627|   209k|                                                                                  luma_weight_l0,
  628|   209k|                                                                                  luma_offset_l0,
  629|   209k|                                                                                  luma_weight_l1,
  630|   209k|                                                                                  luma_offset_l1,
  631|   209k|                                                                                  shift,
  632|   209k|                                                                                  lvl_shift1,
  633|   209k|                                                                                  lvl_shift2,
  634|   209k|                                                                                  pu_ht,
  635|   209k|                                                                                  pu_wd,
  636|   209k|                                                                                  bit_depth_luma);
  637|   209k|                    }
  638|  23.4M|                }
  639|  21.4M|                else
  640|  21.4M|                {
  641|  21.4M|                    shift = ps_wt_ofst->i1_chroma_log2_weight_denom
  642|  21.4M|                                    + 14 - bit_depth_chroma + 1;
  643|  21.4M|                    func_src_strd = pu_wd * (chroma_pixel_strd / h_samp_factor);
  644|  21.4M|                    func_dst_strd = ref_strd * (chroma_pixel_strd / h_samp_factor);
  645|       |
  646|  21.4M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (646:24): [True: 1.69M, False: 19.7M]
  ------------------
  647|  1.69M|                    {
  648|  1.69M|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  1.69M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (648:29): [True: 1.67M, False: 22.0k]
  ------------------
  649|  1.67M|                        {
  650|  1.67M|                            ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  651|  1.67M|                                                                                         pi2_tmp2,
  652|  1.67M|                                                                                         pu1_dst,
  653|  1.67M|                                                                                         func_src_strd,
  654|  1.67M|                                                                                         func_src_strd,
  655|  1.67M|                                                                                         func_dst_strd,
  656|  1.67M|                                                                                         chroma_weight_l0_cr,
  657|  1.67M|                                                                                         chroma_weight_l0_cb,
  658|  1.67M|                                                                                         chroma_offset_l0_cr,
  659|  1.67M|                                                                                         chroma_offset_l0_cb,
  660|  1.67M|                                                                                         chroma_weight_l1_cr,
  661|  1.67M|                                                                                         chroma_weight_l1_cb,
  662|  1.67M|                                                                                         chroma_offset_l1_cr,
  663|  1.67M|                                                                                         chroma_offset_l1_cb,
  664|  1.67M|                                                                                         shift,
  665|  1.67M|                                                                                         lvl_shift1,
  666|  1.67M|                                                                                         lvl_shift2,
  667|  18.4E|                                                                                         pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (667:100): [True: 1.67M, False: 18.4E]
  ------------------
  668|  1.67M|                                                                                         pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (668:100): [True: 0, False: 1.67M]
  ------------------
  669|  1.67M|                        }
  670|  22.0k|                        else
  671|  22.0k|                        {
  672|  22.0k|                            ps_codec->s_func_selector.ihevc_hbd_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  673|  22.0k|                                                                                             pi2_tmp2,
  674|  22.0k|                                                                                             (UWORD16 *)pu1_dst,
  675|  22.0k|                                                                                             func_src_strd,
  676|  22.0k|                                                                                             func_src_strd,
  677|  22.0k|                                                                                             func_dst_strd,
  678|  22.0k|                                                                                             chroma_weight_l0_cr,
  679|  22.0k|                                                                                             chroma_weight_l0_cb,
  680|  22.0k|                                                                                             chroma_offset_l0_cr,
  681|  22.0k|                                                                                             chroma_offset_l0_cb,
  682|  22.0k|                                                                                             chroma_weight_l1_cr,
  683|  22.0k|                                                                                             chroma_weight_l1_cb,
  684|  22.0k|                                                                                             chroma_offset_l1_cr,
  685|  22.0k|                                                                                             chroma_offset_l1_cb,
  686|  22.0k|                                                                                             shift,
  687|  22.0k|                                                                                             lvl_shift1,
  688|  22.0k|                                                                                             lvl_shift2,
  689|  18.4E|                                                                                             pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (689:104): [True: 22.6k, False: 18.4E]
  ------------------
  690|  22.0k|                                                                                             pu_wd >> (is_yuv444 ? 0 : clr_indx),
  ------------------
  |  Branch (690:104): [True: 0, False: 22.0k]
  ------------------
  691|  22.0k|                                                                                             (UWORD8)bit_depth_chroma);
  692|  22.0k|                        }
  693|  1.69M|                    }
  694|  19.7M|                    else
  695|  19.7M|                    {
  696|  19.7M|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  19.7M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (696:29): [True: 21.1M, False: 18.4E]
  ------------------
  697|  21.1M|                        {
  698|  21.1M|                            ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  699|  21.1M|                                                                                         pi2_tmp2,
  700|  21.1M|                                                                                         pu1_dst,
  701|  21.1M|                                                                                         func_src_strd,
  702|  21.1M|                                                                                         func_src_strd,
  703|  21.1M|                                                                                         func_dst_strd,
  704|  21.1M|                                                                                         chroma_weight_l0_cb,
  705|  21.1M|                                                                                         chroma_weight_l0_cr,
  706|  21.1M|                                                                                         chroma_offset_l0_cb,
  707|  21.1M|                                                                                         chroma_offset_l0_cr,
  708|  21.1M|                                                                                         chroma_weight_l1_cb,
  709|  21.1M|                                                                                         chroma_weight_l1_cr,
  710|  21.1M|                                                                                         chroma_offset_l1_cb,
  711|  21.1M|                                                                                         chroma_offset_l1_cr,
  712|  21.1M|                                                                                         shift,
  713|  21.1M|                                                                                         lvl_shift1,
  714|  21.1M|                                                                                         lvl_shift2,
  715|  21.1M|                                                                                         pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (715:100): [True: 21.1M, False: 35.0k]
  ------------------
  716|  21.1M|                                                                                         pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (716:100): [True: 0, False: 21.1M]
  ------------------
  717|  21.1M|                        }
  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: 72.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.7M|                    }
  742|  21.4M|                }
  743|  44.9M|            }
  744|       |
  745|  96.5M|            else if((weighted_pred != 0) && (bi_pred == 0))
  ------------------
  |  Branch (745:21): [True: 1.66M, False: 94.8M]
  |  Branch (745:45): [True: 1.66M, False: 18.4E]
  ------------------
  746|  1.66M|            {
  747|  1.66M|                lvl_shift1 = 0;
  748|  1.66M|                if(ps_pu->b2_pred_mode == PRED_L0)
  ------------------
  |  Branch (748:20): [True: 1.38M, False: 278k]
  ------------------
  749|  1.38M|                {
  750|  1.38M|                    if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (750:24): [True: 721k, False: 664k]
  |  Branch (750:44): [True: 269k, False: 451k]
  |  Branch (750:60): [True: 184k, False: 84.9k]
  ------------------
  751|   184k|                        lvl_shift1 = (1 << 13);
  752|  1.38M|                }
  753|   278k|                else
  754|   278k|                {
  755|   278k|                    if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (755:24): [True: 145k, False: 132k]
  |  Branch (755:44): [True: 42.6k, False: 103k]
  |  Branch (755:60): [True: 34.4k, False: 8.15k]
  ------------------
  756|  34.4k|                        lvl_shift1 = (1 << 13);
  757|   278k|                }
  758|       |
  759|  1.66M|                if(0 == clr_indx)
  ------------------
  |  Branch (759:20): [True: 869k, False: 795k]
  ------------------
  760|   869k|                {
  761|   869k|                    shift = ps_wt_ofst->i1_luma_log2_weight_denom
  762|   869k|                                    + 14 - bit_depth_luma;
  763|       |
  764|   869k|                    if (PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   869k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (764:25): [True: 795k, False: 73.6k]
  ------------------
  765|   795k|                    {
  766|   795k|                        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: 655k, False: 140k]
  ------------------
  767|   795k|                                                                               pu1_dst,
  768|   795k|                                                                               pu_wd,
  769|   795k|                                                                               ref_strd,
  770|   795k|                                                                               ps_pu->b2_pred_mode == PRED_L0 ? luma_weight_l0 : luma_weight_l1,
  ------------------
  |  Branch (770:80): [True: 655k, False: 139k]
  ------------------
  771|   795k|                                                                               ps_pu->b2_pred_mode == PRED_L0 ? luma_offset_l0 : luma_offset_l1,
  ------------------
  |  Branch (771:80): [True: 655k, False: 140k]
  ------------------
  772|   795k|                                                                               shift,
  773|   795k|                                                                               lvl_shift1,
  774|   795k|                                                                               pu_ht,
  775|   795k|                                                                               pu_wd);
  776|   795k|                    }
  777|  73.6k|                    else
  778|  73.6k|                    {
  779|  73.6k|                        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: 68.7k, False: 4.90k]
  ------------------
  780|  73.6k|                                                                                   (UWORD16 *)pu1_dst,
  781|  73.6k|                                                                                   pu_wd,
  782|  73.6k|                                                                                   ref_strd,
  783|  73.6k|                                                                                   ps_pu->b2_pred_mode == PRED_L0 ? luma_weight_l0 : luma_weight_l1,
  ------------------
  |  Branch (783:84): [True: 68.7k, False: 4.90k]
  ------------------
  784|  73.6k|                                                                                   ps_pu->b2_pred_mode == PRED_L0 ? luma_offset_l0 : luma_offset_l1,
  ------------------
  |  Branch (784:84): [True: 68.7k, False: 4.90k]
  ------------------
  785|  73.6k|                                                                                   shift,
  786|  73.6k|                                                                                   lvl_shift1,
  787|  73.6k|                                                                                   pu_ht,
  788|  73.6k|                                                                                   pu_wd,
  789|  73.6k|                                                                                   (UWORD8)bit_depth_luma);
  790|  73.6k|                    }
  791|   869k|                }
  792|   795k|                else
  793|   795k|                {
  794|   795k|                    shift = ps_wt_ofst->i1_chroma_log2_weight_denom
  795|   795k|                                    + 14 - bit_depth_chroma;
  796|   795k|                    func_src_strd = pu_wd * (chroma_pixel_strd / h_samp_factor);
  797|   795k|                    func_dst_strd = ref_strd * (chroma_pixel_strd / h_samp_factor);
  798|       |
  799|   795k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (799:24): [True: 167k, False: 628k]
  ------------------
  800|   167k|                    {
  801|   167k|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   167k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (801:29): [True: 156k, False: 10.8k]
  ------------------
  802|   156k|                        {
  803|   156k|                            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: 141k, False: 15.3k]
  ------------------
  804|   156k|                                                                                          pu1_dst,
  805|   156k|                                                                                          func_src_strd,
  806|   156k|                                                                                          func_dst_strd,
  807|   156k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (807:91): [True: 141k, False: 15.3k]
  ------------------
  808|   156k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (808:91): [True: 141k, False: 15.4k]
  ------------------
  809|   156k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (809:91): [True: 141k, False: 15.3k]
  ------------------
  810|   156k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (810:91): [True: 141k, False: 15.3k]
  ------------------
  811|   156k|                                                                                          shift,
  812|   156k|                                                                                          lvl_shift1,
  813|  18.4E|                                                                                          pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (813:101): [True: 156k, False: 18.4E]
  ------------------
  814|   156k|                                                                                          pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (814:101): [True: 0, False: 156k]
  ------------------
  815|   156k|                        }
  816|  10.8k|                        else
  817|  10.8k|                        {
  818|  10.8k|                            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: 9.86k, False: 1.00k]
  ------------------
  819|  10.8k|                                                                                             (UWORD16 *)pu1_dst,
  820|  10.8k|                                                                                             func_src_strd,
  821|  10.8k|                                                                                             func_dst_strd,
  822|  10.8k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (822:94): [True: 9.86k, False: 1.00k]
  ------------------
  823|  10.8k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (823:94): [True: 9.86k, False: 1.00k]
  ------------------
  824|  10.8k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (824:94): [True: 9.84k, False: 1.02k]
  ------------------
  825|  10.8k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (825:94): [True: 9.84k, False: 1.02k]
  ------------------
  826|  10.8k|                                                                                             shift,
  827|  10.8k|                                                                                             lvl_shift1,
  828|  18.4E|                                                                                             pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (828:104): [True: 11.0k, False: 18.4E]
  ------------------
  829|  10.8k|                                                                                             pu_wd >> (is_yuv444 ? 0 : clr_indx),
  ------------------
  |  Branch (829:104): [True: 0, False: 10.8k]
  ------------------
  830|  10.8k|                                                                                             (UWORD8)bit_depth_chroma);
  831|  10.8k|                        }
  832|   167k|                    }
  833|   628k|                    else
  834|   628k|                    {
  835|   628k|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   628k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (835:29): [True: 609k, False: 19.1k]
  ------------------
  836|   609k|                        {
  837|   609k|                            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: 487k, False: 121k]
  ------------------
  838|   609k|                                                                                          pu1_dst,
  839|   609k|                                                                                          func_src_strd,
  840|   609k|                                                                                          func_dst_strd,
  841|   609k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (841:91): [True: 487k, False: 121k]
  ------------------
  842|   609k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (842:91): [True: 487k, False: 121k]
  ------------------
  843|   609k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (843:91): [True: 487k, False: 121k]
  ------------------
  844|   609k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (844:91): [True: 487k, False: 121k]
  ------------------
  845|   609k|                                                                                          shift,
  846|   609k|                                                                                          lvl_shift1,
  847|   609k|                                                                                          pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (847:101): [True: 593k, False: 15.2k]
  ------------------
  848|   609k|                                                                                          pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (848:101): [True: 0, False: 609k]
  ------------------
  849|   609k|                        }
  850|  19.1k|                        else
  851|  19.1k|                        {
  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: 58.4k, False: 18.4E]
  ------------------
  853|  19.1k|                                                                                              (UWORD16 *)pu1_dst,
  854|  19.1k|                                                                                              func_src_strd,
  855|  19.1k|                                                                                              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: 58.4k, 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: 58.4k, 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: 58.4k, 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: 58.3k, False: 18.4E]
  ------------------
  860|  19.1k|                                                                                              shift,
  861|  19.1k|                                                                                              lvl_shift1,
  862|  18.4E|                                                                                              pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (862:105): [True: 30.2k, False: 18.4E]
  ------------------
  863|  19.1k|                                                                                              pu_wd >> (is_yuv444 ? 0 : clr_indx),
  ------------------
  |  Branch (863:105): [True: 0, False: 19.1k]
  ------------------
  864|  19.1k|                                                                                              (UWORD8)bit_depth_chroma);
  865|  19.1k|                        }
  866|   628k|                    }
  867|   795k|                }
  868|  1.66M|            }
  869|       |
  870|  94.8M|            else if((weighted_pred == 0) && (bi_pred != 0))
  ------------------
  |  Branch (870:21): [True: 91.7M, False: 3.12M]
  |  Branch (870:45): [True: 71.5M, False: 20.2M]
  ------------------
  871|  71.5M|            {
  872|  71.5M|                lvl_shift1 = 0;
  873|  71.5M|                lvl_shift2 = 0;
  874|       |
  875|  71.5M|                if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (875:20): [True: 37.2M, False: 34.2M]
  |  Branch (875:40): [True: 6.30M, False: 30.9M]
  |  Branch (875:56): [True: 3.64M, False: 2.65M]
  ------------------
  876|  3.63M|                    lvl_shift1 = (1 << 13);
  877|       |
  878|  71.5M|                if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (878:20): [True: 37.2M, False: 34.2M]
  |  Branch (878:40): [True: 4.33M, False: 32.9M]
  |  Branch (878:56): [True: 1.89M, False: 2.44M]
  ------------------
  879|  1.89M|                    lvl_shift2 = (1 << 13);
  880|       |
  881|  71.5M|                func_src_strd = pu_wd;
  882|  71.5M|                func_dst_strd = ref_strd;
  883|  71.5M|                if (clr_indx != 0)
  ------------------
  |  Branch (883:21): [True: 36.8M, False: 34.7M]
  ------------------
  884|  36.8M|                {
  885|  36.8M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  886|  36.8M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  887|  36.8M|                }
  888|  18.4E|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (888:37): [True: 71.5M, False: 18.4E]
  ------------------
  889|  71.5M|                func_wd = pu_wd << (is_yuv444 ? clr_indx : 0);
  ------------------
  |  Branch (889:37): [True: 0, False: 71.5M]
  ------------------
  890|       |
  891|  71.5M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  71.5M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (891:21): [True: 71.3M, False: 226k]
  ------------------
  892|  71.3M|                {
  893|  71.3M|                    ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr(pi2_tmp1,
  894|  71.3M|                                                                                  pi2_tmp2,
  895|  71.3M|                                                                                  pu1_dst,
  896|  71.3M|                                                                                  func_src_strd,
  897|  71.3M|                                                                                  func_src_strd,
  898|  71.3M|                                                                                  func_dst_strd,
  899|  71.3M|                                                                                  lvl_shift1,
  900|  71.3M|                                                                                  lvl_shift2,
  901|  71.3M|                                                                                  func_ht,
  902|  71.3M|                                                                                  func_wd);
  903|  71.3M|                }
  904|   226k|                else
  905|   226k|                {
  906|   226k|                    ps_codec->s_func_selector.ihevc_hbd_weighted_pred_bi_default_fptr(pi2_tmp1,
  907|   226k|                                                                                      pi2_tmp2,
  908|   226k|                                                                                      (UWORD16 *)pu1_dst,
  909|   226k|                                                                                      func_src_strd,
  910|   226k|                                                                                      func_src_strd,
  911|   226k|                                                                                      func_dst_strd,
  912|   226k|                                                                                      lvl_shift1,
  913|   226k|                                                                                      lvl_shift2,
  914|   226k|                                                                                      func_ht,
  915|   226k|                                                                                      func_wd,
  916|   226k|                                                                                      u1_bit_depth);
  917|   226k|                }
  918|  71.5M|            }
  919|   141M|        }
  920|  72.4M|    }
  921|  3.75M|}

ihevcd_intra_pred_mode_prediction:
  109|  3.77M|{
  110|  3.77M|    WORD32 i, j, num_pred_blocks;
  111|  3.77M|    WORD32 available_l, available_t;
  112|  3.77M|    WORD32 cand_intra_pred_mode_l, cand_intra_pred_mode_t;
  113|  3.77M|    WORD32 cand_mode_list[3];
  114|  3.77M|    WORD32 cb_size, block_offset_in_min_pu;
  115|  3.77M|    UWORD8 *pu1_luma_intra_pred_mode_top;
  116|  3.77M|    UWORD8 *pu1_luma_intra_pred_mode_left;
  117|       |
  118|  3.77M|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
  119|  3.77M|    parse_cu_t *ps_cu = &ps_codec->s_parse.s_cu;
  120|  3.77M|    sps_t *ps_sps = ps_parse->ps_sps;
  121|       |
  122|       |
  123|  3.77M|    available_t = 1;
  124|  3.77M|    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.77M|    pu1_luma_intra_pred_mode_top = ps_parse->pu1_luma_intra_pred_mode_top
  127|  3.77M|                    + (ps_cu->i4_pos_x * 2);
  128|       |
  129|  3.77M|    pu1_luma_intra_pred_mode_left = ps_parse->pu1_luma_intra_pred_mode_left
  130|  3.77M|                    + (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.77M|    if(ps_cu->i4_pos_y)
  ------------------
  |  Branch (143:8): [True: 2.60M, False: 1.17M]
  ------------------
  144|  2.60M|    {
  145|  2.60M|        UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
  146|  2.60M|        WORD32 top_intra_flag;
  147|       |
  148|  2.60M|        WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  149|  2.60M|        pu1_pic_intra_flag += ((y0 - 8) / 8) * numbytes_row;
  150|  2.60M|        pu1_pic_intra_flag += (x0 / 64);
  151|  2.60M|        top_intra_flag = *pu1_pic_intra_flag;
  152|  2.60M|        top_intra_flag &= (1 << ((x0 / 8) % 8));
  153|       |
  154|  2.60M|        if(0 == top_intra_flag)
  ------------------
  |  Branch (154:12): [True: 29.6k, False: 2.57M]
  ------------------
  155|  29.6k|        {
  156|  29.6k|            available_t = 0;
  157|  29.6k|        }
  158|  2.60M|    }
  159|  1.17M|    else
  160|  1.17M|        available_t = 0;
  161|       |
  162|       |
  163|  3.77M|    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.23M, False: 2.53M]
  |  Branch (163:36): [True: 194k, False: 1.04M]
  |  Branch (163:79): [True: 126k, False: 68.1k]
  ------------------
  164|  1.11M|                                  (0 == ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (164:35): [True: 69.4k, False: 1.04M]
  ------------------
  165|   196k|    {
  166|   196k|        available_l = 0;
  167|   196k|    }
  168|       |
  169|  3.77M|    if(available_l)
  ------------------
  |  Branch (169:8): [True: 3.57M, False: 196k]
  ------------------
  170|  3.57M|    {
  171|  3.57M|        UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
  172|  3.57M|        WORD32 left_intra_flag;
  173|  3.57M|        WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  174|  3.57M|        pu1_pic_intra_flag += (y0 / 8) * numbytes_row;
  175|  3.57M|        pu1_pic_intra_flag += ((x0 - 8) / 64);
  176|  3.57M|        left_intra_flag = *pu1_pic_intra_flag;
  177|  3.57M|        left_intra_flag &= (1 << (((x0 - 8) / 8) % 8));
  178|       |
  179|  3.57M|        if(0 == left_intra_flag)
  ------------------
  |  Branch (179:12): [True: 52.0k, False: 3.52M]
  ------------------
  180|  52.0k|        {
  181|  52.0k|            available_l = 0;
  182|  52.0k|        }
  183|  3.57M|    }
  184|       |
  185|  3.77M|    cb_size = (1 << log2_cb_size);
  186|       |
  187|  3.77M|    block_offset_in_min_pu = (cb_size / 2) / MIN_PU_SIZE;
  ------------------
  |  |  367|  3.77M|#define MIN_PU_SIZE         4
  ------------------
  188|       |
  189|  3.77M|    num_pred_blocks = (ps_cu->i4_part_mode == PART_NxN) ? 2 : 1;
  ------------------
  |  Branch (189:23): [True: 778k, False: 2.99M]
  ------------------
  190|       |
  191|  8.32M|    for(i = 0; i < num_pred_blocks; i++)
  ------------------
  |  Branch (191:16): [True: 4.55M, False: 3.77M]
  ------------------
  192|  4.55M|    {
  193|  4.55M|        WORD32 available_l_tmp;
  194|  4.55M|        available_l_tmp = available_l;
  195|  10.6M|        for(j = 0; j < num_pred_blocks; j++)
  ------------------
  |  Branch (195:20): [True: 6.10M, False: 4.55M]
  ------------------
  196|  6.10M|        {
  197|       |            /* Computing Candidate intra pred mode left */
  198|  6.10M|            {
  199|  6.10M|                WORD32 block_offset;
  200|       |
  201|  6.10M|                block_offset = i * block_offset_in_min_pu;
  202|  6.10M|                cand_intra_pred_mode_l = INTRA_DC;
  ------------------
  |  |  514|  6.10M|#define INTRA_DC                 1
  ------------------
  203|  6.10M|                if(available_l_tmp)
  ------------------
  |  Branch (203:20): [True: 5.79M, False: 317k]
  ------------------
  204|  5.79M|                {
  205|  5.79M|                    cand_intra_pred_mode_l =
  206|  5.79M|                                    pu1_luma_intra_pred_mode_left[block_offset];
  207|  5.79M|                }
  208|       |
  209|  6.10M|            }
  210|       |
  211|  6.10M|            {
  212|  6.10M|                WORD32 block_offset;
  213|  6.10M|                block_offset = j * block_offset_in_min_pu;
  214|  6.10M|                cand_intra_pred_mode_t = INTRA_DC;
  ------------------
  |  |  514|  6.10M|#define INTRA_DC                 1
  ------------------
  215|  6.10M|                if(available_t)
  ------------------
  |  Branch (215:20): [True: 4.77M, False: 1.33M]
  ------------------
  216|  4.77M|                {
  217|  4.77M|                    cand_intra_pred_mode_t =
  218|  4.77M|                                    pu1_luma_intra_pred_mode_top[block_offset];
  219|  4.77M|                }
  220|  6.10M|            }
  221|       |
  222|       |            /* Computing Candidate mode list */
  223|  6.10M|            if(cand_intra_pred_mode_l == cand_intra_pred_mode_t)
  ------------------
  |  Branch (223:16): [True: 1.57M, False: 4.52M]
  ------------------
  224|  1.57M|            {
  225|  1.57M|                if(cand_intra_pred_mode_l < 2)
  ------------------
  |  Branch (225:20): [True: 902k, False: 676k]
  ------------------
  226|   902k|                {
  227|   902k|                    cand_mode_list[0] = INTRA_PLANAR;
  ------------------
  |  |  511|   902k|#define INTRA_PLANAR             0
  ------------------
  228|   902k|                    cand_mode_list[1] = INTRA_DC;
  ------------------
  |  |  514|   902k|#define INTRA_DC                 1
  ------------------
  229|   902k|                    cand_mode_list[2] = INTRA_ANGULAR(26); /* angular 26 = Vertical */
  ------------------
  |  |  517|   902k|#define INTRA_ANGULAR(x) (x)
  ------------------
  230|   902k|                }
  231|   676k|                else
  232|   676k|                {
  233|   676k|                    cand_mode_list[0] = cand_intra_pred_mode_l;
  234|   676k|                    cand_mode_list[1] = 2
  235|   676k|                                    + ((cand_intra_pred_mode_l + 29) % 32);
  236|   676k|                    cand_mode_list[2] = 2
  237|   676k|                                    + ((cand_intra_pred_mode_l - 2 + 1) % 32);
  238|   676k|                }
  239|  1.57M|            }
  240|  4.52M|            else
  241|  4.52M|            {
  242|  4.52M|                cand_mode_list[0] = cand_intra_pred_mode_l;
  243|  4.52M|                cand_mode_list[1] = cand_intra_pred_mode_t;
  244|       |
  245|  4.52M|                if((cand_intra_pred_mode_l != INTRA_PLANAR)
  ------------------
  |  |  511|  4.52M|#define INTRA_PLANAR             0
  ------------------
  |  Branch (245:20): [True: 3.57M, False: 956k]
  ------------------
  246|  3.57M|                                && (cand_intra_pred_mode_t != INTRA_PLANAR))
  ------------------
  |  |  511|  3.57M|#define INTRA_PLANAR             0
  ------------------
  |  Branch (246:36): [True: 2.87M, False: 693k]
  ------------------
  247|  2.87M|                {
  248|  2.87M|                    cand_mode_list[2] = INTRA_PLANAR;
  ------------------
  |  |  511|  2.87M|#define INTRA_PLANAR             0
  ------------------
  249|  2.87M|                }
  250|  1.65M|                else if((cand_intra_pred_mode_l != INTRA_DC)
  ------------------
  |  |  514|  1.65M|#define INTRA_DC                 1
  ------------------
  |  Branch (250:25): [True: 1.35M, False: 299k]
  ------------------
  251|  1.35M|                                && (cand_intra_pred_mode_t != INTRA_DC))
  ------------------
  |  |  514|  1.35M|#define INTRA_DC                 1
  ------------------
  |  Branch (251:36): [True: 771k, False: 579k]
  ------------------
  252|   771k|                {
  253|   771k|                    cand_mode_list[2] = INTRA_DC;
  ------------------
  |  |  514|   771k|#define INTRA_DC                 1
  ------------------
  254|   771k|                }
  255|   878k|                else
  256|   878k|                {
  257|   878k|                    cand_mode_list[2] = INTRA_ANGULAR(26);
  ------------------
  |  |  517|   878k|#define INTRA_ANGULAR(x) (x)
  ------------------
  258|   878k|                }
  259|  4.52M|            }
  260|       |
  261|       |            /* Computing Intra pred mode */
  262|  6.10M|            if(ps_cu->ai4_prev_intra_luma_pred_flag[2 * i + j] == 1)
  ------------------
  |  Branch (262:16): [True: 3.43M, False: 2.67M]
  ------------------
  263|  3.43M|            {
  264|  3.43M|                ps_cu->ai4_intra_luma_pred_mode[2 * i + j] =
  265|  3.43M|                                cand_mode_list[ps_cu->ai4_mpm_idx[2 * i + j]];
  266|  3.43M|            }
  267|  2.67M|            else
  268|  2.67M|            {
  269|  2.67M|                WORD32 intra_pred_mode;
  270|       |                /* Arranging cand_mode_list in increasing order */
  271|  2.67M|                if(cand_mode_list[0] > cand_mode_list[1])
  ------------------
  |  Branch (271:20): [True: 1.22M, False: 1.44M]
  ------------------
  272|  1.22M|                {
  273|  1.22M|                    SWAP(cand_mode_list[0], cand_mode_list[1]);
  ------------------
  |  |   87|  1.22M|#define SWAP(X,Y)                   \
  |  |   88|  1.22M|{                                   \
  |  |   89|  1.22M|    (X) = (X) ^ (Y);                \
  |  |   90|  1.22M|    (Y) = (X) ^ (Y);                \
  |  |   91|  1.22M|    (X) = (X) ^ (Y);                \
  |  |   92|  1.22M|}
  ------------------
  274|  1.22M|                }
  275|  2.67M|                if(cand_mode_list[0] > cand_mode_list[2])
  ------------------
  |  Branch (275:20): [True: 1.62M, False: 1.05M]
  ------------------
  276|  1.62M|                {
  277|  1.62M|                    SWAP(cand_mode_list[0], cand_mode_list[2]);
  ------------------
  |  |   87|  1.62M|#define SWAP(X,Y)                   \
  |  |   88|  1.62M|{                                   \
  |  |   89|  1.62M|    (X) = (X) ^ (Y);                \
  |  |   90|  1.62M|    (Y) = (X) ^ (Y);                \
  |  |   91|  1.62M|    (X) = (X) ^ (Y);                \
  |  |   92|  1.62M|}
  ------------------
  278|  1.62M|                }
  279|  2.67M|                if(cand_mode_list[1] > cand_mode_list[2])
  ------------------
  |  Branch (279:20): [True: 2.13M, False: 539k]
  ------------------
  280|  2.13M|                {
  281|  2.13M|                    SWAP(cand_mode_list[1], cand_mode_list[2]);
  ------------------
  |  |   87|  2.13M|#define SWAP(X,Y)                   \
  |  |   88|  2.13M|{                                   \
  |  |   89|  2.13M|    (X) = (X) ^ (Y);                \
  |  |   90|  2.13M|    (Y) = (X) ^ (Y);                \
  |  |   91|  2.13M|    (X) = (X) ^ (Y);                \
  |  |   92|  2.13M|}
  ------------------
  282|  2.13M|                }
  283|       |
  284|  2.67M|                intra_pred_mode = ps_cu->ai4_rem_intra_luma_pred_mode[2 * i + j];
  285|       |
  286|  2.67M|                if(intra_pred_mode >= cand_mode_list[0])
  ------------------
  |  Branch (286:20): [True: 2.33M, False: 335k]
  ------------------
  287|  2.33M|                    intra_pred_mode++;
  288|       |
  289|  2.67M|                if(intra_pred_mode >= cand_mode_list[1])
  ------------------
  |  Branch (289:20): [True: 1.95M, False: 721k]
  ------------------
  290|  1.95M|                    intra_pred_mode++;
  291|       |
  292|  2.67M|                if(intra_pred_mode >= cand_mode_list[2])
  ------------------
  |  Branch (292:20): [True: 778k, False: 1.89M]
  ------------------
  293|   778k|                    intra_pred_mode++;
  294|       |
  295|  2.67M|                ps_cu->ai4_intra_luma_pred_mode[2 * i + j] = intra_pred_mode;
  296|  2.67M|            }
  297|       |            /* Update Top and Left intra pred mode */
  298|  6.10M|            {
  299|  6.10M|                WORD32 intra_pred_mode;
  300|       |
  301|  6.10M|                intra_pred_mode = ps_cu->ai4_intra_luma_pred_mode[2 * i + j];
  302|       |
  303|  6.10M|                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|  6.10M|#define MIN_PU_SIZE         4
  ------------------
  304|  6.10M|                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|  6.10M|#define MIN_PU_SIZE         4
  ------------------
  305|       |
  306|  6.10M|            }
  307|       |            /* If partition is PART_NxN, then left is available for second column always */
  308|  6.10M|            available_l_tmp = 1;
  309|       |
  310|  6.10M|        }
  311|       |        /* If partition is PART_NxN, then top is available for bottom row always */
  312|  4.55M|        available_t = 1;
  313|  4.55M|    }
  314|       |
  315|       |    /* In case it is PART_2Nx2N partition, replicate intra pred mode in other three entries */
  316|  3.77M|    if(ps_cu->i4_part_mode == PART_2Nx2N)
  ------------------
  |  Branch (316:8): [True: 2.99M, False: 778k]
  ------------------
  317|  2.99M|    {
  318|  2.99M|        ps_cu->ai4_intra_luma_pred_mode[1] = ps_cu->ai4_intra_luma_pred_mode[0];
  319|  2.99M|        ps_cu->ai4_intra_luma_pred_mode[2] = ps_cu->ai4_intra_luma_pred_mode[0];
  320|  2.99M|        ps_cu->ai4_intra_luma_pred_mode[3] = ps_cu->ai4_intra_luma_pred_mode[0];
  321|  2.99M|    }
  322|  3.77M|}

ihevcd_unpack_coeffs:
  234|  10.2M|{
  235|       |    /* Generating coeffs from coeff-map */
  236|  10.2M|    WORD32 i;
  237|  10.2M|    WORD16 *pi2_sblk_ptr;
  238|  10.2M|    WORD32 subblk_pos_x, subblk_pos_y;
  239|  10.2M|    WORD32 sblk_scan_idx, coeff_raster_idx;
  240|  10.2M|    WORD32 sblk_non_zero_coeff_idx;
  241|  10.2M|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  242|  10.2M|    UWORD8 u1_num_coded_sblks, u1_scan_type;
  243|  10.2M|    UWORD8 *pu1_new_tu_coeff_data;
  244|  10.2M|    WORD32 trans_size;
  245|  10.2M|    WORD32 xs, ys;
  246|  10.2M|    WORD32 trans_skip;
  247|  10.2M|    WORD16 iquant_out;
  248|  10.2M|    WORD32 shift_iq;
  249|       |
  250|  10.2M|    shift_iq = bit_depth + log2_trans_size - 5;
  251|  10.2M|    trans_size = (1 << log2_trans_size);
  252|       |
  253|       |    /* First byte points to number of coded blocks */
  254|  10.2M|    u1_num_coded_sblks = *pu1_tu_coeff_data++;
  255|       |
  256|       |    /* Next byte points to scan type */
  257|  10.2M|    u1_scan_type = *pu1_tu_coeff_data++;
  258|       |    /* 0th bit has trans_skip */
  259|  10.2M|    trans_skip = u1_scan_type & 1;
  260|  10.2M|#ifdef ENABLE_MAIN_REXT_PROFILE
  261|  10.2M|    u1_scan_type = (u1_scan_type & 0xF) >> 1;
  262|       |#else
  263|       |    u1_scan_type >>= 1;
  264|       |#endif
  265|       |
  266|  10.2M|    pi2_sblk_ptr = pi2_tu_coeff;
  267|       |
  268|       |    /* Initially all columns are assumed to be zero */
  269|  10.2M|    *pu4_zero_cols = 0xFFFFFFFF;
  270|       |    /* Initially all rows are assumed to be zero */
  271|  10.2M|    *pu4_zero_rows = 0xFFFFFFFF;
  272|       |
  273|  10.2M|    ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)(pu1_tu_coeff_data);
  274|       |
  275|  10.2M|    if(trans_skip)
  ------------------
  |  Branch (275:8): [True: 1.26M, False: 8.95M]
  ------------------
  276|  1.26M|        memset(pi2_tu_coeff, 0, trans_size * trans_size * sizeof(WORD16));
  277|       |
  278|  10.2M|    STATS_INIT_SBLK_AND_COEFF_POS();
  ------------------
  |  |  141|  10.2M|#define STATS_INIT_SBLK_AND_COEFF_POS() ;
  ------------------
  279|       |
  280|       |    /* DC only case */
  281|  10.2M|    if((e_trans_type != DST_4x4) && (1 == u1_num_coded_sblks)
  ------------------
  |  Branch (281:8): [True: 7.60M, False: 2.60M]
  |  Branch (281:37): [True: 5.87M, False: 1.73M]
  ------------------
  282|  5.87M|                    && (0 == ps_tu_sblk_coeff_data->u2_subblk_pos)
  ------------------
  |  Branch (282:24): [True: 5.66M, False: 209k]
  ------------------
  283|  5.66M|                    && (1 == ps_tu_sblk_coeff_data->u2_sig_coeff_map))
  ------------------
  |  Branch (283:24): [True: 3.19M, False: 2.46M]
  ------------------
  284|  3.19M|    {
  285|  3.19M|        *pu4_coeff_type = 1;
  286|       |
  287|  3.19M|        if(!trans_quant_bypass)
  ------------------
  |  Branch (287:12): [True: 2.88M, False: 309k]
  ------------------
  288|  2.88M|        {
  289|  2.88M|            WORD32 dequant_coeff = (trans_skip && (trans_size > 4)) ? 16 : pi2_dequant_matrix[0];
  ------------------
  |  Branch (289:37): [True: 323k, False: 2.56M]
  |  Branch (289:51): [True: 514, False: 322k]
  ------------------
  290|  2.88M|            if(4 == trans_size)
  ------------------
  |  Branch (290:16): [True: 1.14M, False: 1.74M]
  ------------------
  291|  1.14M|            {
  292|  1.14M|                IQUANT_4x4(iquant_out,
  ------------------
  |  |  158|  1.14M|#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|  1.14M|{                                                                                                                                              \
  |  |  160|  1.14M|    WORD32 clip_coeff, tmp;                                                                                                                    \
  |  |  161|  1.14M|    WORD32 coeff_min,coeff_max;                                                                                                                \
  |  |  162|  1.14M|    WORD32 coeff_bit_range;                                                                                                                    \
  |  |  163|  1.14M|    WORD32 add_iq;                                                                                                                             \
  |  |  164|  1.14M|    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.14M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 431k, False: 712k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  1.14M|                                                                                                                                               \
  |  |  166|  1.14M|    coeff_bit_range = 16;                                                                                                                      \
  |  |  167|  1.14M|    if(qp_div > shift_iq)                                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 322k, False: 821k]
  |  |  ------------------
  |  |  168|  1.14M|        coeff_bit_range = 10;                                                                                                                  \
  |  |  169|  1.14M|                                                                                                                                               \
  |  |  170|  1.14M|    coeff_min = -(1<<(coeff_bit_range-1));                                                                                                     \
  |  |  171|  1.14M|    coeff_max = (1<<(coeff_bit_range-1)) - 1;                                                                                                  \
  |  |  172|  1.14M|                                                                                                                                               \
  |  |  173|  1.14M|    clip_coeff = CLIP3(coeff,coeff_min,coeff_max);                                                                                             \
  |  |  ------------------
  |  |  |  |   40|  1.14M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 70, False: 1.14M]
  |  |  |  |  |  Branch (40:53): [True: 70, False: 1.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|  1.14M|                                                                                                                                               \
  |  |  175|  1.14M|    tmp = clip_coeff * dequant_coeff ;                                                                                                         \
  |  |  176|  1.14M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  177|  1.14M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  1.14M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 712k, False: 431k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|  1.14M|                                                                                                                                               \
  |  |  179|  1.14M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  1.14M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  1.14M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 9.26k, False: 1.13M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 7.20k, False: 1.12M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|  1.14M|}
  ------------------
  293|  1.14M|                           ps_tu_sblk_coeff_data->ai2_level[0],
  294|  1.14M|                           dequant_coeff
  295|  1.14M|                                           * g_ihevc_iquant_scales[qp_rem],
  296|  1.14M|                           shift_iq, qp_div);
  297|  1.14M|            }
  298|  1.74M|            else
  299|  1.74M|            {
  300|  1.74M|                IQUANT(iquant_out, ps_tu_sblk_coeff_data->ai2_level[0],
  ------------------
  |  |  140|  1.74M|#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.74M|{                                                                                                                                              \
  |  |  142|  1.74M|    WORD32 tmp, add_iq;                                                                                                                        \
  |  |  143|  1.74M|                                                                                                                                               \
  |  |  144|  1.74M|    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.74M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 1.38M, False: 364k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.74M|                                                                                                                                               \
  |  |  146|  1.74M|    tmp = coeff * dequant_coeff ;                                                                                                              \
  |  |  147|  1.74M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  148|  1.74M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  1.74M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 370k, False: 1.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  149|  1.74M|                                                                                                                                               \
  |  |  150|  1.74M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  1.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  1.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 7.15k, False: 1.73M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 4.81k, False: 1.73M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|  1.74M|}
  ------------------
  301|  1.74M|                       dequant_coeff * g_ihevc_iquant_scales[qp_rem],
  302|  1.74M|                       shift_iq, qp_div);
  303|  1.74M|            }
  304|  2.88M|            if(trans_skip)
  ------------------
  |  Branch (304:16): [True: 323k, False: 2.56M]
  ------------------
  305|   323k|            {
  306|   323k|                WORD32 shift_ts = MAX_TR_DYNAMIC_RANGE - bit_depth - log2_trans_size;
  ------------------
  |  |  441|   323k|#define MAX_TR_DYNAMIC_RANGE  15
  ------------------
  307|   323k|                if(shift_ts > 0)
  ------------------
  |  Branch (307:20): [True: 323k, False: 90]
  ------------------
  308|   323k|                {
  309|   323k|                    iquant_out = (iquant_out + (1 << (shift_ts - 1))) >> shift_ts;
  310|   323k|                }
  311|     90|                else if(shift_ts < 0)
  ------------------
  |  Branch (311:25): [True: 0, False: 90]
  ------------------
  312|      0|                {
  313|      0|                    iquant_out = iquant_out << (-shift_ts);
  314|      0|                }
  315|   323k|            }
  316|  2.88M|        }
  317|   309k|        else
  318|   309k|        {
  319|       |            /* setting the column to zero */
  320|  2.89M|            for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (320:24): [True: 2.59M, False: 309k]
  ------------------
  321|  2.59M|                *(pi2_tu_coeff + i * trans_size) = 0;
  322|       |
  323|   309k|            iquant_out = ps_tu_sblk_coeff_data->ai2_level[0];
  324|   309k|        }
  325|  3.19M|        *pi2_coeff_value = iquant_out;
  326|  3.19M|        *pi2_tu_coeff = iquant_out;
  327|  3.19M|        *pu4_zero_cols &= ~0x1;
  328|  3.19M|        *pu4_zero_rows &= ~0x1;
  329|  3.19M|        ps_tu_sblk_coeff_data =
  330|  3.19M|                        (tu_sblk_coeff_data_t *)&ps_tu_sblk_coeff_data->ai2_level[1];
  331|       |
  332|  3.19M|        STATS_UPDATE_COEFF_COUNT();
  ------------------
  |  |  144|  3.19M|#define STATS_UPDATE_COEFF_COUNT() ;
  ------------------
  333|  3.19M|        STATS_LAST_SBLK_POS_UPDATE(e_trans_type, (trans_skip || trans_quant_bypass),  0, 0);
  ------------------
  |  |  142|  3.19M|#define STATS_LAST_SBLK_POS_UPDATE(e_trans_type, t_skip_or_tq_bypass, sblk_x, sblk_y) ;
  ------------------
  334|  3.19M|        STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, (trans_quant_bypass || trans_skip));
  ------------------
  |  |  143|  3.19M|#define STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, t_skip_or_tq_bypass) ;
  ------------------
  335|  3.19M|        return ((UWORD8 *)ps_tu_sblk_coeff_data);
  336|  3.19M|    }
  337|  7.02M|    else
  338|  7.02M|    {
  339|  7.02M|        *pu4_coeff_type = 0;
  340|       |        /* In case of trans skip, memset has already happened */
  341|  7.02M|        if(!trans_skip)
  ------------------
  |  Branch (341:12): [True: 6.11M, False: 908k]
  ------------------
  342|  6.11M|            memset(pi2_tu_coeff, 0, trans_size * trans_size * sizeof(WORD16));
  343|  7.02M|    }
  344|       |
  345|  18.4M|    for(i = 0; i < u1_num_coded_sblks; i++)
  ------------------
  |  Branch (345:16): [True: 11.4M, False: 7.02M]
  ------------------
  346|  11.4M|    {
  347|  11.4M|        UWORD32 u4_sig_coeff_map;
  348|  11.4M|        subblk_pos_x = ps_tu_sblk_coeff_data->u2_subblk_pos & 0x00FF;
  349|  11.4M|        subblk_pos_y = (ps_tu_sblk_coeff_data->u2_subblk_pos & 0xFF00) >> 8;
  350|       |
  351|  11.4M|        STATS_LAST_SBLK_POS_UPDATE(e_trans_type, (trans_skip || trans_quant_bypass), subblk_pos_x, subblk_pos_y);
  ------------------
  |  |  142|  11.4M|#define STATS_LAST_SBLK_POS_UPDATE(e_trans_type, t_skip_or_tq_bypass, sblk_x, sblk_y) ;
  ------------------
  352|       |
  353|  11.4M|        subblk_pos_x = subblk_pos_x * MIN_TU_SIZE;
  ------------------
  |  |  358|  11.4M|#define MIN_TU_SIZE         4
  ------------------
  354|  11.4M|        subblk_pos_y = subblk_pos_y * MIN_TU_SIZE;
  ------------------
  |  |  358|  11.4M|#define MIN_TU_SIZE         4
  ------------------
  355|       |
  356|  11.4M|        pi2_sblk_ptr = pi2_tu_coeff + subblk_pos_y * trans_size
  357|  11.4M|                        + subblk_pos_x;
  358|       |
  359|       |        //*pu4_zero_cols &= ~(0xF << subblk_pos_x);
  360|       |
  361|  11.4M|        sblk_non_zero_coeff_idx = 0;
  362|  11.4M|        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|  11.4M|        sblk_scan_idx = 31;
  365|  11.4M|        do
  366|  58.4M|        {
  367|  58.4M|            WORD32 clz = CLZ(u4_sig_coeff_map);
  368|       |
  369|  58.4M|            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|  58.4M|            u4_sig_coeff_map = u4_sig_coeff_map << clz;
  373|       |            /* Copying coeffs and storing in reverse order */
  374|  58.4M|            {
  375|  58.4M|                STATS_UPDATE_COEFF_COUNT();
  ------------------
  |  |  144|  58.4M|#define STATS_UPDATE_COEFF_COUNT() ;
  ------------------
  376|  58.4M|                coeff_raster_idx =
  377|  58.4M|                                gau1_ihevc_invscan4x4[u1_scan_type][sblk_scan_idx];
  378|       |
  379|  58.4M|                xs = coeff_raster_idx & 0x3;
  380|  58.4M|                ys = coeff_raster_idx >> 2;
  381|       |
  382|  58.4M|                if(!trans_quant_bypass)
  ------------------
  |  Branch (382:20): [True: 52.4M, False: 6.04M]
  ------------------
  383|  52.4M|                {
  384|  52.4M|                    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.48M, False: 46.9M]
  |  Branch (384:59): [True: 35.4k, False: 5.45M]
  ------------------
  385|  52.4M|                    if(4 == trans_size)
  ------------------
  |  Branch (385:24): [True: 18.6M, False: 33.7M]
  ------------------
  386|  18.6M|                    {
  387|  18.6M|                        IQUANT_4x4(iquant_out,
  ------------------
  |  |  158|  18.6M|#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|  18.6M|{                                                                                                                                              \
  |  |  160|  18.6M|    WORD32 clip_coeff, tmp;                                                                                                                    \
  |  |  161|  18.6M|    WORD32 coeff_min,coeff_max;                                                                                                                \
  |  |  162|  18.6M|    WORD32 coeff_bit_range;                                                                                                                    \
  |  |  163|  18.6M|    WORD32 add_iq;                                                                                                                             \
  |  |  164|  18.6M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  18.6M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 7.15M, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  18.6M|                                                                                                                                               \
  |  |  166|  18.6M|    coeff_bit_range = 16;                                                                                                                      \
  |  |  167|  18.6M|    if(qp_div > shift_iq)                                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 4.28M, False: 14.3M]
  |  |  ------------------
  |  |  168|  18.6M|        coeff_bit_range = 10;                                                                                                                  \
  |  |  169|  18.6M|                                                                                                                                               \
  |  |  170|  18.6M|    coeff_min = -(1<<(coeff_bit_range-1));                                                                                                     \
  |  |  171|  18.6M|    coeff_max = (1<<(coeff_bit_range-1)) - 1;                                                                                                  \
  |  |  172|  18.6M|                                                                                                                                               \
  |  |  173|  18.6M|    clip_coeff = CLIP3(coeff,coeff_min,coeff_max);                                                                                             \
  |  |  ------------------
  |  |  |  |   40|  18.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 382, False: 18.6M]
  |  |  |  |  |  Branch (40:53): [True: 256, False: 18.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|  18.6M|                                                                                                                                               \
  |  |  175|  18.6M|    tmp = clip_coeff * dequant_coeff ;                                                                                                         \
  |  |  176|  18.6M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  177|  18.6M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  18.6M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 11.4M, False: 7.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|  18.6M|                                                                                                                                               \
  |  |  179|  18.6M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  18.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  18.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 577k, False: 18.0M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 442k, False: 17.6M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|  18.6M|}
  ------------------
  388|  18.6M|                                   ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx],
  389|  18.6M|                                   dequant_coeff
  390|  18.6M|                                   * g_ihevc_iquant_scales[qp_rem],
  391|  18.6M|                                   shift_iq, qp_div);
  392|  18.6M|                        sblk_non_zero_coeff_idx++;
  393|  18.6M|                    }
  394|  33.7M|                    else
  395|  33.7M|                    {
  396|  33.7M|                        IQUANT(iquant_out,
  ------------------
  |  |  140|  33.7M|#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|  33.7M|{                                                                                                                                              \
  |  |  142|  33.7M|    WORD32 tmp, add_iq;                                                                                                                        \
  |  |  143|  33.7M|                                                                                                                                               \
  |  |  144|  33.7M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  33.7M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 14.9M, False: 18.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  33.7M|                                                                                                                                               \
  |  |  146|  33.7M|    tmp = coeff * dequant_coeff ;                                                                                                              \
  |  |  147|  33.7M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  148|  33.7M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  33.7M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 18.9M, False: 14.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  149|  33.7M|                                                                                                                                               \
  |  |  150|  33.7M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  33.7M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  33.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 456k, False: 33.3M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 362k, False: 32.9M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|  33.7M|}
  ------------------
  397|  33.7M|                               ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx],
  398|  33.7M|                               dequant_coeff * g_ihevc_iquant_scales[qp_rem],
  399|  33.7M|                               shift_iq, qp_div);
  400|  33.7M|                        sblk_non_zero_coeff_idx++;
  401|  33.7M|                    }
  402|       |
  403|  52.4M|                    if(trans_skip)
  ------------------
  |  Branch (403:24): [True: 5.48M, False: 46.9M]
  ------------------
  404|  5.48M|                    {
  405|  5.48M|                        WORD32 shift_ts = MAX_TR_DYNAMIC_RANGE - bit_depth - log2_trans_size;
  ------------------
  |  |  441|  5.48M|#define MAX_TR_DYNAMIC_RANGE  15
  ------------------
  406|  5.48M|                        if(shift_ts > 0)
  ------------------
  |  Branch (406:28): [True: 5.47M, False: 12.2k]
  ------------------
  407|  5.47M|                        {
  408|  5.47M|                            iquant_out = (iquant_out + (1 << (shift_ts - 1))) >> shift_ts;
  409|  5.47M|                        }
  410|  12.2k|                        else if(shift_ts < 0)
  ------------------
  |  Branch (410:33): [True: 0, False: 12.2k]
  ------------------
  411|      0|                        {
  412|      0|                            iquant_out = iquant_out << (-shift_ts);
  413|      0|                        }
  414|  5.48M|                    }
  415|  52.4M|                }
  416|  6.04M|                else
  417|  6.04M|                {
  418|  6.04M|                    iquant_out = ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx++];
  419|  6.04M|                }
  420|  58.4M|                *pu4_zero_cols &= ~(0x1U << (subblk_pos_x + xs));
  421|  58.4M|                *pu4_zero_rows &= ~(0x1U << (subblk_pos_y + ys));
  422|  58.4M|                *(pi2_sblk_ptr + xs + ys * trans_size) = iquant_out;
  423|  58.4M|            }
  424|  58.4M|            sblk_scan_idx--;
  425|  58.4M|            u4_sig_coeff_map <<= 1;
  426|       |
  427|  58.4M|        }while(u4_sig_coeff_map);
  ------------------
  |  Branch (427:16): [True: 47.0M, False: 11.4M]
  ------------------
  428|       |        /* Updating the sblk pointer */
  429|  11.4M|        ps_tu_sblk_coeff_data =
  430|  11.4M|                        (tu_sblk_coeff_data_t *)&ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx];
  431|  11.4M|    }
  432|       |
  433|  7.02M|    STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, (trans_quant_bypass || trans_skip));
  ------------------
  |  |  143|  7.02M|#define STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, t_skip_or_tq_bypass) ;
  ------------------
  434|       |
  435|  7.02M|    pu1_new_tu_coeff_data = (UWORD8 *)ps_tu_sblk_coeff_data;
  436|       |
  437|  7.02M|    return pu1_new_tu_coeff_data;
  438|  10.2M|}
ihevcd_get_intra_nbr_flag:
  447|  8.56M|{
  448|  8.56M|    sps_t *ps_sps;
  449|  8.56M|    UWORD8 u1_bot_lt_avail, u1_left_avail, u1_top_avail, u1_top_rt_avail,
  450|  8.56M|                    u1_top_lt_avail;
  451|  8.56M|    WORD32 x_cur, y_cur, x_nbr, y_nbr;
  452|  8.56M|    UWORD8 *pu1_nbr_intra_flag;
  453|  8.56M|    UWORD8 *pu1_pic_intra_flag;
  454|  8.56M|    UWORD8 top_right, top, top_left, left, bot_left;
  455|  8.56M|    WORD32 intra_pos;
  456|  8.56M|    WORD32 num_8_blks, num_8_blks_in_bits;
  457|  8.56M|    WORD32 numbytes_row = (i2_pic_width_in_luma_samples + 63) / 64;
  458|  8.56M|    WORD32 cur_x, cur_y;
  459|  8.56M|    WORD32 i;
  460|  8.56M|    WORD32 nbr_flags;
  461|       |
  462|  8.56M|    ps_sps = ps_proc->ps_sps;
  463|  8.56M|    cur_x = ps_tu->b4_pos_x;
  464|  8.56M|    cur_y = ps_tu->b4_pos_y;
  465|       |
  466|  8.56M|    u1_bot_lt_avail = (pu4_intra_nbr_avail[1 + cur_y + trans_size / MIN_TU_SIZE]
  ------------------
  |  |  358|  8.56M|#define MIN_TU_SIZE         4
  ------------------
  467|  8.56M|                    >> (31 - (1 + cur_x - 1))) & 1;
  468|  8.56M|    u1_left_avail = (pu4_intra_nbr_avail[1 + cur_y] >> (31 - (1 + cur_x - 1)))
  469|  8.56M|                    & 1;
  470|  8.56M|    u1_top_avail = (pu4_intra_nbr_avail[1 + cur_y - 1] >> (31 - (1 + cur_x)))
  471|  8.56M|                    & 1;
  472|  8.56M|    u1_top_rt_avail = (pu4_intra_nbr_avail[1 + cur_y - 1]
  473|  8.56M|                    >> (31 - (1 + cur_x + trans_size / MIN_TU_SIZE))) & 1;
  ------------------
  |  |  358|  8.56M|#define MIN_TU_SIZE         4
  ------------------
  474|  8.56M|    u1_top_lt_avail = (pu4_intra_nbr_avail[1 + cur_y - 1]
  475|  8.56M|                    >> (31 - (1 + cur_x - 1))) & 1;
  476|       |
  477|  8.56M|    x_cur = ps_proc->i4_ctb_x * ctb_size + cur_x * MIN_TU_SIZE;
  ------------------
  |  |  358|  8.56M|#define MIN_TU_SIZE         4
  ------------------
  478|  8.56M|    y_cur = ps_proc->i4_ctb_y * ctb_size + cur_y * MIN_TU_SIZE;
  ------------------
  |  |  358|  8.56M|#define MIN_TU_SIZE         4
  ------------------
  479|       |
  480|  8.56M|    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|  8.56M|    bot_left = 0;
  487|  8.56M|    left = 0;
  488|  8.56M|    top_right = 0;
  489|  8.56M|    top = 0;
  490|  8.56M|    top_left = 0;
  491|       |
  492|  8.56M|    num_8_blks = trans_size > 4 ? trans_size / 8 : 1;
  ------------------
  |  Branch (492:18): [True: 4.73M, False: 3.83M]
  ------------------
  493|  8.56M|    num_8_blks_in_bits = ((1 << num_8_blks) - 1);
  494|       |
  495|  8.56M|    if(i1_constrained_intra_pred_flag)
  ------------------
  |  Branch (495:8): [True: 4.94M, False: 3.62M]
  ------------------
  496|  4.94M|    {
  497|       |        /* TODO: constrained intra pred not tested */
  498|  4.94M|        if(u1_bot_lt_avail)
  ------------------
  |  Branch (498:12): [True: 1.34M, False: 3.59M]
  ------------------
  499|  1.34M|        {
  500|  1.34M|            x_nbr = x_cur - 1;
  501|  1.34M|            y_nbr = y_cur + trans_size;
  502|       |
  503|  1.34M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  504|  1.34M|                            + x_nbr / 64;
  505|  1.34M|            intra_pos = ((x_nbr / 8) % 8);
  506|  3.86M|            for(i = 0; i < num_8_blks; i++)
  ------------------
  |  Branch (506:24): [True: 2.51M, False: 1.34M]
  ------------------
  507|  2.51M|            {
  508|  2.51M|                bot_left |= ((*(pu1_nbr_intra_flag + i * numbytes_row)
  509|  2.51M|                                >> intra_pos) & 1) << i;
  510|  2.51M|            }
  511|  1.34M|            bot_left &= num_8_blks_in_bits;
  512|  1.34M|        }
  513|  4.94M|        if(u1_left_avail)
  ------------------
  |  Branch (513:12): [True: 4.70M, False: 245k]
  ------------------
  514|  4.70M|        {
  515|  4.70M|            x_nbr = x_cur - 1;
  516|  4.70M|            y_nbr = y_cur;
  517|       |
  518|  4.70M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  519|  4.70M|                            + x_nbr / 64;
  520|  4.70M|            intra_pos = ((x_nbr / 8) % 8);
  521|       |
  522|  14.0M|            for(i = 0; i < num_8_blks; i++)
  ------------------
  |  Branch (522:24): [True: 9.33M, False: 4.70M]
  ------------------
  523|  9.33M|            {
  524|  9.33M|                left |= ((*(pu1_nbr_intra_flag + i * numbytes_row) >> intra_pos)
  525|  9.33M|                                & 1) << i;
  526|  9.33M|            }
  527|  4.70M|            left &= num_8_blks_in_bits;
  528|  4.70M|        }
  529|  4.94M|        if(u1_top_avail)
  ------------------
  |  Branch (529:12): [True: 4.43M, False: 516k]
  ------------------
  530|  4.43M|        {
  531|  4.43M|            x_nbr = x_cur;
  532|  4.43M|            y_nbr = y_cur - 1;
  533|       |
  534|  4.43M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  535|  4.43M|                            + x_nbr / 64;
  536|  4.43M|            intra_pos = ((x_nbr / 8) % 8);
  537|       |
  538|  4.43M|            top = (*pu1_nbr_intra_flag >> intra_pos);
  539|  4.43M|            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.43M|        }
  547|  4.94M|        if(u1_top_rt_avail)
  ------------------
  |  Branch (547:12): [True: 2.88M, False: 2.06M]
  ------------------
  548|  2.88M|        {
  549|  2.88M|            x_nbr = x_cur + trans_size;
  550|  2.88M|            y_nbr = y_cur - 1;
  551|       |
  552|  2.88M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  553|  2.88M|                            + x_nbr / 64;
  554|  2.88M|            intra_pos = ((x_nbr / 8) % 8);
  555|       |
  556|  2.88M|            top_right = (*pu1_nbr_intra_flag >> intra_pos);
  557|  2.88M|            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.88M|        }
  565|  4.94M|        if(u1_top_lt_avail)
  ------------------
  |  Branch (565:12): [True: 4.22M, False: 727k]
  ------------------
  566|  4.22M|        {
  567|  4.22M|            x_nbr = x_cur - 1;
  568|  4.22M|            y_nbr = y_cur - 1;
  569|       |
  570|  4.22M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  571|  4.22M|                            + x_nbr / 64;
  572|  4.22M|            intra_pos = ((x_nbr / 8) % 8);
  573|       |
  574|  4.22M|            top_left = (*pu1_nbr_intra_flag >> intra_pos) & 1;
  575|  4.22M|        }
  576|  4.94M|    }
  577|  3.62M|    else
  578|  3.62M|    {
  579|  3.62M|        if(u1_top_avail)
  ------------------
  |  Branch (579:12): [True: 3.38M, False: 233k]
  ------------------
  580|  3.38M|            top = 0xF;
  581|  3.62M|        if(u1_top_rt_avail)
  ------------------
  |  Branch (581:12): [True: 2.23M, False: 1.38M]
  ------------------
  582|  2.23M|            top_right = 0xF;
  583|  3.62M|        if(u1_bot_lt_avail)
  ------------------
  |  Branch (583:12): [True: 1.07M, False: 2.54M]
  ------------------
  584|  1.07M|            bot_left = 0xF;
  585|  3.62M|        if(u1_left_avail)
  ------------------
  |  Branch (585:12): [True: 3.50M, False: 113k]
  ------------------
  586|  3.50M|            left = 0xF;
  587|  3.62M|        if(u1_top_lt_avail)
  ------------------
  |  Branch (587:12): [True: 3.29M, False: 329k]
  ------------------
  588|  3.29M|            top_left = 0x1;
  589|  3.62M|    }
  590|       |
  591|       |    /* Handling incomplete CTBs */
  592|  8.56M|    {
  593|  8.56M|        WORD32 pu_size_limit = MIN(trans_size, 8);
  ------------------
  |  |   43|  8.56M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.84M, False: 4.71M]
  |  |  ------------------
  ------------------
  594|  8.56M|        WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples
  595|  8.56M|                        - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size)
  596|  8.56M|                        - (ps_tu->b4_pos_x * MIN_TU_SIZE)
  ------------------
  |  |  358|  8.56M|#define MIN_TU_SIZE         4
  ------------------
  597|  8.56M|                        - (1 << (ps_tu->b3_size + 2));
  598|       |        /* ctb_size_top gives number of valid pixels remaining in the current row */
  599|  8.56M|        WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  8.56M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 6.26M, False: 2.30M]
  |  |  ------------------
  ------------------
  600|  8.56M|        WORD32 ctb_size_top_bits = (1 << (ctb_size_top / pu_size_limit)) - 1;
  601|       |
  602|  8.56M|        WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
  603|  8.56M|                        - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size)
  604|  8.56M|                        - (ps_tu->b4_pos_y * MIN_TU_SIZE)
  ------------------
  |  |  358|  8.56M|#define MIN_TU_SIZE         4
  ------------------
  605|  8.56M|                        - (1 << (ps_tu->b3_size + 2));
  606|       |        /* ctb_size_bot gives number of valid pixels remaining in the current column */
  607|  8.56M|        WORD32 ctb_size_bot = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  8.56M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 7.94M, False: 619k]
  |  |  ------------------
  ------------------
  608|  8.56M|        WORD32 ctb_size_bot_bits = (1 << (ctb_size_bot / pu_size_limit)) - 1;
  609|       |
  610|  8.56M|        top_right &= ctb_size_top_bits;
  611|  8.56M|        bot_left &= ctb_size_bot_bits;
  612|  8.56M|    }
  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|  8.56M|    nbr_flags = (top_left << 16) | (top_right << 12) | (top << 8) | (gau4_ihevcd_4_bit_reverse[left] << 4)
  623|  8.56M|                    | gau4_ihevcd_4_bit_reverse[bot_left];
  624|       |
  625|       |
  626|  8.56M|    return nbr_flags;
  627|       |
  628|  8.56M|}
get_iqitrec_func:
  864|   342M|{
  865|   342M|    sps_t *ps_sps = ps_proc->ps_sps;
  866|   342M|    pps_t *ps_pps = ps_proc->ps_pps;
  867|   342M|    WORD8 trans_size = 1 << log2_trans_size;
  868|       |
  869|   342M|    if(1 == ps_pl_tu_ctxt->cbf
  ------------------
  |  Branch (869:8): [True: 10.1M, False: 332M]
  ------------------
  870|  10.1M|                    && (ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag))
  ------------------
  |  Branch (870:25): [True: 1.05M, False: 9.14M]
  |  Branch (870:56): [True: 1.25M, False: 7.88M]
  ------------------
  871|  2.32M|    {
  872|  2.32M|        if(ps_sps->i1_transform_skip_rotation_enabled_flag && trans_size == 4 && intra_flag)
  ------------------
  |  Branch (872:12): [True: 50.4k, False: 2.27M]
  |  Branch (872:63): [True: 43.6k, False: 6.75k]
  |  Branch (872:82): [True: 40.0k, False: 3.64k]
  ------------------
  873|  40.0k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  874|  2.28M|        if(ps_sps->i1_implicit_rdpcm_enabled_flag && intra_flag
  ------------------
  |  Branch (874:12): [True: 33.4k, False: 2.25M]
  |  Branch (874:54): [True: 29.7k, False: 3.69k]
  ------------------
  875|  29.7k|                        && (intra_pred_mode == 10 || intra_pred_mode == 26))
  ------------------
  |  Branch (875:29): [True: 3.33k, False: 26.4k]
  |  Branch (875:54): [True: 5.23k, False: 21.2k]
  ------------------
  876|  8.58k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  877|  2.27M|        if(ps_pl_tu_ctxt->explicit_rdpcm_flag)
  ------------------
  |  Branch (877:12): [True: 1.74k, False: 2.27M]
  ------------------
  878|  1.74k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  879|  2.27M|    }
  880|   342M|    if(ps_pps->i1_cross_component_prediction_enabled_flag)
  ------------------
  |  Branch (880:8): [True: 5.63M, False: 336M]
  ------------------
  881|  5.63M|    {
  882|  5.63M|        if((chroma_plane == NULL_PLANE
  ------------------
  |  Branch (882:13): [True: 4.88M, False: 751k]
  ------------------
  883|  4.88M|                        && (ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0
  ------------------
  |  Branch (883:29): [True: 153k, False: 4.73M]
  ------------------
  884|  4.73M|                                        || ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0))
  ------------------
  |  Branch (884:44): [True: 37.5k, False: 4.69M]
  ------------------
  885|  5.45M|                        || (chroma_plane == V_PLANE && ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0)
  ------------------
  |  Branch (885:29): [True: 381k, False: 5.07M]
  |  Branch (885:56): [True: 182k, False: 199k]
  ------------------
  886|  5.27M|                        || (chroma_plane == U_PLANE && ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0))
  ------------------
  |  Branch (886:29): [True: 381k, False: 4.88M]
  |  Branch (886:56): [True: 194k, False: 187k]
  ------------------
  887|   560k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  888|  5.63M|    }
  889|   341M|    return ihevcd_iquant_itrans_recon_tu_plane;
  890|   342M|}
ihevcd_iquant_itrans_recon_ctb:
  894|  23.3M|{
  895|  23.3M|    WORD16 *pi2_scaling_mat;
  896|  23.3M|    UWORD8 *pu1_y_dst_ctb;
  897|  23.3M|    UWORD8 *pu1_uv_dst_ctb;
  898|  23.3M|    WORD32 ctb_size;
  899|  23.3M|    codec_t *ps_codec;
  900|  23.3M|    slice_header_t *ps_slice_hdr;
  901|  23.3M|    tu_t *ps_tu;
  902|  23.3M|    WORD16 *pi2_ctb_coeff;
  903|  23.3M|    WORD32 tu_cnt;
  904|  23.3M|    WORD16 *pi2_tu_coeff;
  905|  23.3M|    WORD32 pic_strd;
  906|  23.3M|    WORD32 luma_nbr_flags;
  907|  23.3M|    WORD32 luma_nbr_flags_4x4[4] = { 0 };
  908|  23.3M|    WORD32 chroma_nbr_flags = 0;
  909|  23.3M|    WORD32 chroma_nbr_flags_subtu = 0;
  910|  23.3M|    WORD32 disable_boundary_filter = 0;
  911|       |
  912|  23.3M|    UWORD8 u1_luma_pred_mode_first_tu = 0;
  913|       |    /* Pointers for generating 2d coeffs from coeff-map */
  914|  23.3M|    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|  23.3M|    UWORD32 au4_intra_nbr_avail[MAX_CTB_SIZE / MIN_TU_SIZE + 2 /* Top nbr + bot nbr */];
  919|  23.3M|    UWORD32 top_avail_bits;
  920|  23.3M|    sps_t *ps_sps;
  921|  23.3M|    pps_t *ps_pps;
  922|  23.3M|    WORD32 pixel_size_y, pixel_size_uv;
  923|  23.3M|    WORD32 bit_depth_luma, bit_depth_chroma;
  924|  23.3M|    WORD32 intra_flag;
  925|  23.3M|    UWORD8 *pu1_pic_intra_flag;
  926|  23.3M|    WORD32 h_samp_factor, v_samp_factor;
  927|  23.3M|    WORD32 chroma_pixel_strd = 2;
  928|  23.3M|    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|  23.3M|    static const WORD32 scaling_mat_offset[] =
  946|  23.3M|      { 0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992,
  947|  23.3M|        1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136, 0, 0, 0, 0, 0, 0};
  948|       |
  949|  23.3M|    PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED();
  ------------------
  |  |   63|  23.3M|#define PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED() ;
  ------------------
  950|       |
  951|  23.3M|    ps_sps = ps_proc->ps_sps;
  952|  23.3M|    ps_pps = ps_proc->ps_pps;
  953|  23.3M|    ps_slice_hdr = ps_proc->ps_slice_hdr;
  954|  23.3M|    ps_codec = ps_proc->ps_codec;
  955|       |
  956|  23.3M|    pu1_y_dst_ctb = ps_proc->pu1_cur_ctb_luma;
  957|  23.3M|    pu1_uv_dst_ctb = ps_proc->pu1_cur_ctb_chroma;
  958|       |
  959|  23.3M|    pi2_ctb_coeff = ps_proc->pi2_invscan_out;
  960|       |
  961|  23.3M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  962|  23.3M|    pu1_tu_coeff_data = (UWORD8 *)ps_proc->pv_tu_coeff_data;
  963|       |
  964|  23.3M|    pic_strd = ps_codec->i4_strd;
  965|       |
  966|  23.3M|    pixel_size_y     = ps_codec->i4_pixel_size_y;
  967|  23.3M|    pixel_size_uv    = ps_codec->i4_pixel_size_uv;
  968|  23.3M|    bit_depth_luma   = ps_codec->i4_bit_depth_luma;
  969|  23.3M|    bit_depth_chroma = ps_codec->i4_bit_depth_chroma;
  970|  23.3M|    pi2_tu_coeff = pi2_ctb_coeff;
  971|       |
  972|  23.3M|    ps_tu = ps_proc->ps_tu;
  973|       |
  974|  23.3M|    if((1 == ps_sps->i1_scaling_list_enable_flag) && (1 == ps_pps->i1_pps_scaling_list_data_present_flag))
  ------------------
  |  Branch (974:8): [True: 20.6M, False: 2.76M]
  |  Branch (974:54): [True: 1.00M, False: 19.6M]
  ------------------
  975|  1.00M|    {
  976|  1.00M|        pi2_scaling_mat = ps_pps->pi2_scaling_mat;
  977|  1.00M|    }
  978|  22.3M|    else
  979|  22.3M|    {
  980|  22.3M|        pi2_scaling_mat = ps_sps->pi2_scaling_mat;
  981|  22.3M|    }
  982|       |
  983|  23.3M|    {
  984|       |        /* Updating the initial availability map */
  985|  23.3M|        WORD32 i;
  986|  23.3M|        UWORD8 u1_left_ctb_avail, u1_top_lt_ctb_avail, u1_top_rt_ctb_avail,
  987|  23.3M|                        u1_top_ctb_avail;
  988|       |
  989|  23.3M|        u1_left_ctb_avail = ps_proc->u1_left_ctb_avail;
  990|  23.3M|        u1_top_lt_ctb_avail = ps_proc->u1_top_lt_ctb_avail;
  991|  23.3M|        u1_top_ctb_avail = ps_proc->u1_top_ctb_avail;
  992|  23.3M|        u1_top_rt_ctb_avail = ps_proc->u1_top_rt_ctb_avail;
  993|       |
  994|       |        /* Initializing the availability array */
  995|  23.3M|        memset(au4_intra_nbr_avail, 0,
  996|  23.3M|               (MAX_CTB_SIZE / MIN_TU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  351|  23.3M|#define MAX_CTB_SIZE        64
  ------------------
                             (MAX_CTB_SIZE / MIN_TU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  358|  23.3M|#define MIN_TU_SIZE         4
  ------------------
  997|       |        /* Initializing the availability array with CTB level availability flags */
  998|  23.3M|        {
  999|  23.3M|            WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size);
 1000|  23.3M|            WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  23.3M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 22.4M, False: 908k]
  |  |  ------------------
  ------------------
 1001|   185M|            for(i = 0; i < ctb_size_left / MIN_TU_SIZE; i++)
  ------------------
  |  |  358|   185M|#define MIN_TU_SIZE         4
  ------------------
  |  Branch (1001:24): [True: 161M, False: 23.3M]
  ------------------
 1002|   161M|            {
 1003|   161M|                au4_intra_nbr_avail[i + 1] = ((UWORD32)u1_left_ctb_avail << 31);
 1004|   161M|            }
 1005|  23.3M|        }
 1006|  23.3M|        au4_intra_nbr_avail[0] |= (((UWORD32)u1_top_rt_ctb_avail << 31)
 1007|  23.3M|                        >> (1 + ctb_size / MIN_TU_SIZE)); /* 1+ctb_size/4 position bit pos from msb */
  ------------------
  |  |  358|  23.3M|#define MIN_TU_SIZE         4
  ------------------
 1008|       |
 1009|  23.3M|        au4_intra_nbr_avail[0] |= ((UWORD32)u1_top_lt_ctb_avail << 31);
 1010|       |
 1011|  23.3M|        {
 1012|  23.3M|            WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size);
 1013|  23.3M|            WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  23.3M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 22.5M, False: 889k]
  |  |  ------------------
  ------------------
 1014|  23.3M|            WORD32 shift = (31 - (ctb_size / MIN_TU_SIZE));
  ------------------
  |  |  358|  23.3M|#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|  23.3M|            shift += ((ctb_size - ctb_size_top) / MIN_TU_SIZE);
  ------------------
  |  |  358|  23.3M|#define MIN_TU_SIZE         4
  ------------------
 1020|       |
 1021|  23.3M|            top_avail_bits = ((1 << (ctb_size_top / MIN_TU_SIZE)) - 1)
  ------------------
  |  |  358|  23.3M|#define MIN_TU_SIZE         4
  ------------------
 1022|  23.3M|                            << shift;
 1023|  23.3M|        }
 1024|  23.3M|        au4_intra_nbr_avail[0] |= (
 1025|  23.3M|                        (u1_top_ctb_avail == 1) ? top_avail_bits : 0x0);
  ------------------
  |  Branch (1025:25): [True: 22.0M, False: 1.34M]
  ------------------
 1026|       |        /* Starting from msb 2nd bit to (1+ctb_size/4) bit, set 1 if top avail,or 0 */
 1027|       |
 1028|  23.3M|    }
 1029|       |
 1030|  23.3M|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (1030:21): [True: 0, False: 23.3M]
  ------------------
 1031|  23.3M|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (1031:21): [True: 22.0M, False: 1.30M]
  ------------------
 1032|       |
 1033|       |    /* Applying Inverse transform on all the TU's in CTB */
 1034|   336M|    for(tu_cnt = 0; tu_cnt < ps_proc->i4_ctb_tu_cnt; tu_cnt++, ps_tu++)
  ------------------
  |  Branch (1034:21): [True: 312M, False: 23.3M]
  ------------------
 1035|   312M|    {
 1036|       |        /* Reset boundary filter flag for each transform unit (TU) iteration */
 1037|   312M|        disable_boundary_filter = 0;
 1038|   312M|        tu_plane_iq_it_recon_ctxt_t y_cb_tu = { 0 };
 1039|   312M|        tu_plane_iq_it_recon_ctxt_t cr_tu = { 0 };
 1040|   312M|        tu_plane_iq_it_recon_ctxt_t *ps_cb_tu = &y_cb_tu;
 1041|   312M|        tu_plane_iq_it_recon_ctxt_t *ps_cr_tu = &cr_tu;
 1042|   312M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1043|   312M|        tu_plane_iq_it_recon_ctxt_t cb_sub_tu = { 0 };
 1044|   312M|        tu_plane_iq_it_recon_ctxt_t cr_sub_tu = { 0 };
 1045|   312M|#endif
 1046|       |
 1047|   312M|        WORD32 num_comp, c_idx, func_idx;
 1048|       |
 1049|   312M|        WORD32 qp_div = 0, qp_rem = 0;
 1050|   312M|        WORD32 qp_div_v = 0, qp_rem_v = 0;
 1051|   312M|        WORD32 chroma_qp_idx;
 1052|   312M|        WORD8 i1_chroma_pic_qp_offset, i1_chroma_slice_qp_offset;
 1053|   312M|        WORD16 *pi2_dequant_matrix = NULL, *pi2_dequant_matrix_v = NULL;
 1054|       |
 1055|   312M|        WORD32 trans_size = 0;
 1056|   312M|        TRANSFORM_TYPE e_trans_type;
 1057|   312M|        WORD32 log2_y_trans_size_minus_2, log2_uv_trans_size_minus_2;
 1058|   312M|        WORD32 log2_trans_size;
 1059|       |
 1060|   312M|        WORD32 tu_x, tu_y;
 1061|   312M|        WORD32 tu_y_offset, tu_uv_offset;
 1062|   312M|        UWORD8 u1_luma_pred_mode, u1_chroma_pred_mode;
 1063|   312M|        WORD32 offset;
 1064|   312M|        WORD32 pcm_flag;
 1065|   312M|        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|   312M|        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|   312M|        WORD32 chroma_yuv420sp_vu_v_offset = -2 * chroma_yuv420sp_vu;
 1073|       |
 1074|   312M|        tu_x = ps_tu->b4_pos_x * 4; /* Converting minTU unit to pixel unit */
 1075|   312M|        tu_y = ps_tu->b4_pos_y * 4; /* Converting minTU unit to pixel unit */
 1076|   312M|        {
 1077|   312M|            WORD32 tu_abs_x = (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size) + (tu_x);
 1078|   312M|            WORD32 tu_abs_y = (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size) + (tu_y);
 1079|       |
 1080|   312M|            WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1081|       |
 1082|   312M|            pu1_pic_intra_flag = ps_proc->pu1_pic_intra_flag;
 1083|   312M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
 1084|   312M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
 1085|       |
 1086|   312M|            intra_flag = *pu1_pic_intra_flag;
 1087|   312M|            intra_flag &= (1 << ((tu_abs_x >> 3) % 8));
 1088|   312M|        }
 1089|       |
 1090|   312M|        u1_luma_pred_mode = ps_tu->b6_luma_intra_mode;
 1091|   312M|        u1_chroma_pred_mode = ps_tu->b3_chroma_intra_mode_idx;
 1092|       |
 1093|   313M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && u1_chroma_pred_mode != 7)
  ------------------
  |  Branch (1093:12): [True: 313M, False: 18.4E]
  |  Branch (1093:73): [True: 6.18M, False: 306M]
  ------------------
 1094|  6.19M|            num_comp = 2; /* Y and UV */
 1095|   306M|        else
 1096|   306M|            num_comp = 1; /* Y */
 1097|       |
 1098|   312M|        pcm_flag = 0;
 1099|       |
 1100|   312M|        if((intra_flag) && (u1_luma_pred_mode == INTRA_PRED_NONE))
  ------------------
  |  |  521|  8.52M|#define INTRA_PRED_NONE  63
  ------------------
  |  Branch (1100:12): [True: 8.52M, False: 304M]
  |  Branch (1100:28): [True: 2.47k, False: 8.52M]
  ------------------
 1101|  2.47k|        {
 1102|  2.47k|            UWORD8 *pu1_buf;
 1103|  2.47k|            UWORD8 *pu1_y_dst = pu1_y_dst_ctb;
 1104|  2.47k|            UWORD8 *pu1_uv_dst = pu1_uv_dst_ctb;
 1105|  2.47k|            WORD32 i, j;
 1106|  2.47k|            tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
 1107|  2.47k|            WORD32 cb_size = 1 << (ps_tu->b3_size + 2);
 1108|       |
 1109|       |            /* trans_size is used to update availability after reconstruction */
 1110|  2.47k|            trans_size = cb_size;
 1111|       |
 1112|  2.47k|            pcm_flag = 1;
 1113|       |
 1114|  2.47k|            tu_y_offset = tu_x + tu_y * pic_strd;
 1115|  2.47k|            pu1_y_dst += (tu_x + tu_y * pic_strd) * pixel_size_y;
 1116|       |
 1117|       |            /* First byte points to number of coded blocks */
 1118|  2.47k|            pu1_tu_coeff_data++;
 1119|       |
 1120|       |            /* Next byte points to scan type */
 1121|  2.47k|            pu1_tu_coeff_data++;
 1122|       |
 1123|  2.47k|            ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)pu1_tu_coeff_data;
 1124|       |
 1125|  2.47k|            pu1_buf = (UWORD8 *)&ps_tu_sblk_coeff_data->ai2_level[0];
 1126|  2.47k|            {
 1127|       |
 1128|  31.1k|                for(i = 0; i < cb_size; i++)
  ------------------
  |  Branch (1128:28): [True: 28.7k, False: 2.47k]
  ------------------
 1129|  28.7k|                {
 1130|  28.7k|                    memcpy(&pu1_y_dst[i * pic_strd * pixel_size_y], pu1_buf, (cb_size * pixel_size_y));
 1131|  28.7k|                    pu1_buf += cb_size * pixel_size_y;
 1132|  28.7k|                }
 1133|       |
 1134|  2.47k|                if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1134:20): [True: 2.41k, False: 67]
  ------------------
 1135|  2.41k|                {
 1136|  2.41k|                    WORD32 chroma_strd = (pic_strd * chroma_pixel_strd) / h_samp_factor;
 1137|       |
 1138|  2.41k|                    pu1_uv_dst += ((tu_x * chroma_pixel_strd / h_samp_factor)
 1139|  2.41k|                                    + (tu_y * chroma_pixel_strd * pic_strd / (h_samp_factor * v_samp_factor))) * pixel_size_uv;
 1140|  2.41k|                    pu1_uv_dst = pu1_uv_dst + chroma_yuv420sp_vu_u_offset * pixel_size_uv;
 1141|       |
 1142|       |                    /* U */
 1143|  16.7k|                    for(i = 0; i < cb_size / v_samp_factor; i++)
  ------------------
  |  Branch (1143:32): [True: 14.3k, False: 2.41k]
  ------------------
 1144|  14.3k|                    {
 1145|   108k|                        for(j = 0; j < cb_size / h_samp_factor; j++)
  ------------------
  |  Branch (1145:36): [True: 94.6k, False: 14.3k]
  ------------------
 1146|  94.6k|                        {
 1147|  94.6k|                            if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  94.6k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1147:32): [True: 91.8k, False: 2.76k]
  ------------------
 1148|  91.8k|                            {
 1149|  91.8k|                                pu1_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *pu1_buf++;
 1150|  91.8k|                            }
 1151|  2.76k|                            else
 1152|  2.76k|                            {
 1153|  2.76k|                                UWORD16 *pu2_uv_dst = (UWORD16 *)pu1_uv_dst;
 1154|  2.76k|                                pu2_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *(UWORD16 *)pu1_buf;
 1155|  2.76k|                                pu1_buf += 2;
 1156|  2.76k|                            }
 1157|  94.6k|                        }
 1158|  14.3k|                    }
 1159|       |
 1160|  2.41k|                    pu1_uv_dst = pu1_uv_dst + (1 + chroma_yuv420sp_vu_v_offset) * pixel_size_uv;
 1161|       |
 1162|       |                    /* V */
 1163|  16.7k|                    for(i = 0; i < cb_size / v_samp_factor; i++)
  ------------------
  |  Branch (1163:32): [True: 14.3k, False: 2.41k]
  ------------------
 1164|  14.3k|                    {
 1165|   108k|                        for(j = 0; j < cb_size / h_samp_factor; j++)
  ------------------
  |  Branch (1165:36): [True: 94.6k, False: 14.3k]
  ------------------
 1166|  94.6k|                        {
 1167|  94.6k|                            if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  94.6k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1167:32): [True: 91.8k, False: 2.76k]
  ------------------
 1168|  91.8k|                            {
 1169|  91.8k|                                pu1_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *pu1_buf++;
 1170|  91.8k|                            }
 1171|  2.76k|                            else
 1172|  2.76k|                            {
 1173|  2.76k|                                UWORD16 *pu2_uv_dst = (UWORD16 *)pu1_uv_dst;
 1174|  2.76k|                                pu2_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *(UWORD16 *)pu1_buf;
 1175|  2.76k|                                pu1_buf += 2;
 1176|  2.76k|                            }
 1177|  94.6k|                        }
 1178|  14.3k|                    }
 1179|  2.41k|                }
 1180|  2.47k|            }
 1181|       |
 1182|  2.47k|            pu1_tu_coeff_data = pu1_buf;
 1183|       |
 1184|  2.47k|        }
 1185|       |
 1186|       |
 1187|       |
 1188|       |
 1189|       |
 1190|   633M|        for(c_idx = 0; c_idx < num_comp; c_idx++)
  ------------------
  |  Branch (1190:24): [True: 321M, False: 312M]
  ------------------
 1191|   321M|        {
 1192|   321M|            if(0 == pcm_flag)
  ------------------
  |  Branch (1192:16): [True: 321M, False: 18.4E]
  ------------------
 1193|   321M|            {
 1194|       |
 1195|   321M|                if(c_idx == 0) /* Y */
  ------------------
  |  Branch (1195:20): [True: 315M, False: 5.62M]
  ------------------
 1196|   315M|                {
 1197|   315M|                    WORD32 qp_bd_offset_y = ps_codec->i4_qp_bd_offset_y;
 1198|       |
 1199|   315M|                    log2_y_trans_size_minus_2 = ps_tu->b3_size;
 1200|   315M|                    trans_size = 1 << (log2_y_trans_size_minus_2 + 2);
 1201|   315M|                    log2_trans_size = log2_y_trans_size_minus_2 + 2;
 1202|       |
 1203|   315M|                    tu_y_offset = tu_x + tu_y * pic_strd;
 1204|       |
 1205|       |                    /* Calculating scaling matrix offset */
 1206|   315M|                    offset = log2_y_trans_size_minus_2 * 6 + (!intra_flag) * 3 + c_idx;
 1207|   315M|                    pi2_dequant_matrix = pi2_scaling_mat + scaling_mat_offset[offset];
 1208|       |
 1209|       |                    /* 4x4 transform Luma in INTRA mode is DST */
 1210|   315M|                    if(log2_y_trans_size_minus_2 == 0 && intra_flag)
  ------------------
  |  Branch (1210:24): [True: 4.81M, False: 310M]
  |  Branch (1210:58): [True: 3.83M, False: 978k]
  ------------------
 1211|  3.84M|                    {
 1212|  3.84M|                        func_idx = log2_y_trans_size_minus_2;
 1213|  3.84M|                        e_trans_type = DST_4x4;
 1214|  3.84M|                    }
 1215|   311M|                    else
 1216|   311M|                    {
 1217|   311M|                        func_idx = log2_y_trans_size_minus_2 + 1;
 1218|   311M|                        e_trans_type = (TRANSFORM_TYPE)(log2_y_trans_size_minus_2 + 1);
 1219|   311M|                    }
 1220|       |
 1221|   315M|                    qp_div = (ps_tu->b7_qp + qp_bd_offset_y) / 6;
 1222|   315M|                    qp_rem = (ps_tu->b7_qp + qp_bd_offset_y) % 6;
 1223|       |
 1224|   315M|                    y_cb_tu.pi2_tu_coeff = pi2_tu_coeff;
 1225|   315M|                    y_cb_tu.pu1_pred = pu1_y_dst_ctb + tu_y_offset * pixel_size_y;
 1226|   315M|                    y_cb_tu.pu1_dst = pu1_y_dst_ctb + tu_y_offset * pixel_size_y;
 1227|   315M|                    y_cb_tu.tu_coeff_stride = trans_size;
 1228|   315M|                    y_cb_tu.pred_strd = pic_strd;
 1229|   315M|                    y_cb_tu.dst_strd = pic_strd;
 1230|   315M|                    y_cb_tu.cbf = ps_tu->b1_y_cbf;
 1231|   315M|                    y_cb_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1232|   315M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1233|   315M|                    y_cb_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1234|   315M|                    y_cb_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1235|   315M|#endif
 1236|       |                    /* Unpacking coeffs */
 1237|   315M|                    if(1 == y_cb_tu.cbf)
  ------------------
  |  Branch (1237:24): [True: 5.85M, False: 309M]
  ------------------
 1238|  5.85M|                    {
 1239|  5.85M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1240|  5.85M|                                        y_cb_tu.pi2_tu_coeff, log2_y_trans_size_minus_2 + 2,
 1241|  5.85M|                                        pu1_tu_coeff_data, pi2_dequant_matrix,
 1242|  5.85M|                                        qp_rem, qp_div, e_trans_type,
 1243|  5.85M|                                        ps_tu->b1_transquant_bypass, &y_cb_tu.zero_cols,
 1244|  5.85M|                                        &y_cb_tu.zero_rows, &y_cb_tu.coeff_type,
 1245|  5.85M|                                        &y_cb_tu.coeff_value, bit_depth_luma);
 1246|  5.85M|                    }
 1247|   315M|                }
 1248|  5.62M|                else /* UV interleaved */
 1249|  5.62M|                {
 1250|       |                    /* Initializing variables */
 1251|  5.62M|                    const WORD16 *pi2_ihevcd_chroma_qp =
 1252|  5.62M|                                    CHROMA_FMT_IDC_YUV420 != ps_sps->i1_chroma_format_idc ?
  ------------------
  |  Branch (1252:37): [True: 1.72M, False: 3.90M]
  ------------------
 1253|  1.72M|                                                    gai2_ihevcd_chroma_qp_clip :
 1254|  5.62M|                                                    gai2_ihevcd_chroma_qp_420;
 1255|  5.62M|                    WORD32  qp_bd_offset_uv = ps_codec->i4_qp_bd_offset_uv;
 1256|  5.62M|                    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.62M|                    if(ps_tu->b3_size == 0)
  ------------------
  |  Branch (1259:24): [True: 1.19M, False: 4.43M]
  ------------------
 1260|  1.19M|                    {
 1261|  1.19M|                        log2_uv_trans_size_minus_2 = ps_tu->b3_size;
 1262|  1.19M|                        if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1262:28): [True: 0, False: 1.19M]
  ------------------
 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.19M|                        else
 1268|  1.19M|                        {
 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.19M|                            tu_uv_offset = (tu_x - 4) + ((tu_y - 4) / v_samp_factor) * pic_strd;
 1271|  1.19M|                        }
 1272|  1.19M|                    }
 1273|  4.43M|                    else
 1274|  4.43M|                    {
 1275|  4.43M|                        if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1275:28): [True: 0, False: 4.43M]
  ------------------
 1276|      0|                        {
 1277|      0|                            log2_uv_trans_size_minus_2 = ps_tu->b3_size;
 1278|      0|                        }
 1279|  4.43M|                        else
 1280|  4.43M|                        {
 1281|  4.43M|                            log2_uv_trans_size_minus_2 = ps_tu->b3_size - 1;
 1282|  4.43M|                        }
 1283|  4.43M|                        tu_uv_offset = (tu_x * chroma_pixel_strd / h_samp_factor)
 1284|  4.43M|                                        + (tu_y * chroma_pixel_strd * pic_strd / (h_samp_factor * v_samp_factor));
 1285|  4.43M|                    }
 1286|  5.62M|                    trans_size = 1 << (log2_uv_trans_size_minus_2 + 2);
 1287|  5.62M|                    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.62M|                    offset = log2_uv_trans_size_minus_2 * 6 + (!intra_flag) * 3 + c_idx;
 1297|  5.62M|                    pi2_dequant_matrix = pi2_scaling_mat + scaling_mat_offset[offset];
 1298|  5.62M|                    pi2_dequant_matrix_v = pi2_scaling_mat + scaling_mat_offset[offset + 1];
 1299|       |
 1300|  5.62M|                    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.62M|                    func_idx = MIN(func_idx, (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 8 : 7);
  ------------------
  |  |   43|  11.2M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 4.42M, False: 1.20M]
  |  |  |  Branch (43:30): [True: 0, False: 5.62M]
  |  |  |  Branch (43:42): [True: 0, False: 1.20M]
  |  |  ------------------
  ------------------
 1305|       |
 1306|  5.62M|                    e_trans_type = (TRANSFORM_TYPE)(log2_uv_trans_size_minus_2 + 1);
 1307|       |                    /* QP for U */
 1308|  5.62M|                    i1_chroma_pic_qp_offset = ps_pps->i1_pic_cb_qp_offset;
 1309|  5.62M|                    i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cb_qp_offset;
 1310|       |
 1311|  5.62M|                    chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + i1_chroma_slice_qp_offset;
 1312|  5.62M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1313|  5.62M|                    if(ps_tu->b1_cu_chroma_qp_offset_flag)
  ------------------
  |  Branch (1313:24): [True: 16.4k, False: 5.61M]
  ------------------
 1314|  16.4k|                    {
 1315|  16.4k|                        chroma_qp_idx += ps_pps->i4_cb_qp_offset_list[ps_tu->b3_cu_chroma_qp_offset_idx];
 1316|  16.4k|                    }
 1317|  5.62M|#endif
 1318|  5.62M|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  5.62M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1318:24): [True: 4.10M, False: 1.52M]
  ------------------
 1319|  4.10M|                    {
 1320|  4.10M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57);
  ------------------
  |  |   40|  4.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.92k, False: 4.09M]
  |  |  |  Branch (40:53): [True: 8.81k, False: 4.08M]
  |  |  ------------------
  ------------------
 1321|  4.10M|                        qp_div = pi2_ihevcd_chroma_qp[chroma_qp_idx] / 6;
 1322|  4.10M|                        qp_rem = pi2_ihevcd_chroma_qp[chroma_qp_idx] % 6;
 1323|  4.10M|                    }
 1324|  1.52M|                    else
 1325|  1.52M|                    {
 1326|  1.52M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, (-qp_bd_offset_uv), 57);
  ------------------
  |  |   40|  1.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.7k, False: 1.51M]
  |  |  |  Branch (40:53): [True: 1.31k, False: 1.51M]
  |  |  ------------------
  ------------------
 1327|  1.52M|                        if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1327:28): [True: 497k, False: 1.02M]
  ------------------
 1328|   497k|                        {
 1329|   497k|                            if (chroma_qp_idx < 30)
  ------------------
  |  Branch (1329:33): [True: 127k, False: 370k]
  ------------------
 1330|   127k|                            {
 1331|   127k|                                qp_u = chroma_qp_idx;
 1332|   127k|                            }
 1333|   370k|                            else if (chroma_qp_idx > 43)
  ------------------
  |  Branch (1333:38): [True: 339k, False: 30.6k]
  ------------------
 1334|   339k|                            {
 1335|   339k|                                qp_u = chroma_qp_idx - 6;
 1336|   339k|                            }
 1337|  30.6k|                            else
 1338|  30.6k|                            {
 1339|  30.6k|                                qp_u = gai2_ihevcd_chroma_qp_420[chroma_qp_idx];
 1340|  30.6k|                            }
 1341|   497k|                        }
 1342|  1.02M|                        else
 1343|  1.02M|                        {
 1344|  1.02M|                            qp_u = MIN(chroma_qp_idx, 51);
  ------------------
  |  |   43|  1.02M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 721k, False: 307k]
  |  |  ------------------
  ------------------
 1345|  1.02M|                        }
 1346|  1.52M|                        qp_u += qp_bd_offset_uv;
 1347|  1.52M|                        qp_div = qp_u / 6;
 1348|  1.52M|                        qp_rem = qp_u % 6;
 1349|  1.52M|                    }
 1350|       |
 1351|       |                    /* QP for V */
 1352|  5.62M|                    i1_chroma_pic_qp_offset = ps_pps->i1_pic_cr_qp_offset;
 1353|  5.62M|                    i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cr_qp_offset;
 1354|       |
 1355|  5.62M|                    chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + i1_chroma_slice_qp_offset;
 1356|  5.62M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1357|  5.62M|                    if(ps_tu->b1_cu_chroma_qp_offset_flag)
  ------------------
  |  Branch (1357:24): [True: 16.4k, False: 5.61M]
  ------------------
 1358|  16.4k|                    {
 1359|  16.4k|                        chroma_qp_idx += ps_pps->i4_cr_qp_offset_list[ps_tu->b3_cu_chroma_qp_offset_idx];
 1360|  16.4k|                    }
 1361|  5.62M|#endif
 1362|  5.62M|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  5.62M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1362:24): [True: 4.10M, False: 1.52M]
  ------------------
 1363|  4.10M|                    {
 1364|  4.10M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57);
  ------------------
  |  |   40|  4.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.20k, False: 4.09M]
  |  |  |  Branch (40:53): [True: 24.9k, False: 4.07M]
  |  |  ------------------
  ------------------
 1365|  4.10M|                        qp_div_v = pi2_ihevcd_chroma_qp[chroma_qp_idx] / 6;
 1366|  4.10M|                        qp_rem_v = pi2_ihevcd_chroma_qp[chroma_qp_idx] % 6;
 1367|  4.10M|                    }
 1368|  1.52M|                    else
 1369|  1.52M|                    {
 1370|  1.52M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, (-qp_bd_offset_uv), 57);
  ------------------
  |  |   40|  1.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 837, False: 1.52M]
  |  |  |  Branch (40:53): [True: 1.76k, False: 1.52M]
  |  |  ------------------
  ------------------
 1371|  1.52M|                        if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1371:28): [True: 498k, False: 1.02M]
  ------------------
 1372|   498k|                        {
 1373|   498k|                            if (chroma_qp_idx < 30)
  ------------------
  |  Branch (1373:33): [True: 138k, False: 359k]
  ------------------
 1374|   138k|                            {
 1375|   138k|                                qp_v = chroma_qp_idx;
 1376|   138k|                            }
 1377|   359k|                            else if (chroma_qp_idx > 43)
  ------------------
  |  Branch (1377:38): [True: 333k, False: 26.5k]
  ------------------
 1378|   333k|                            {
 1379|   333k|                                qp_v = chroma_qp_idx - 6;
 1380|   333k|                            }
 1381|  26.5k|                            else
 1382|  26.5k|                            {
 1383|  26.5k|                                qp_v = gai2_ihevcd_chroma_qp_420[chroma_qp_idx];
 1384|  26.5k|                            }
 1385|   498k|                        }
 1386|  1.02M|                        else
 1387|  1.02M|                        {
 1388|  1.02M|                            qp_v = MIN(chroma_qp_idx, 51);
  ------------------
  |  |   43|  1.02M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 823k, False: 205k]
  |  |  ------------------
  ------------------
 1389|  1.02M|                        }
 1390|  1.52M|                        qp_v += qp_bd_offset_uv;
 1391|  1.52M|                        qp_div_v = qp_v / 6;
 1392|  1.52M|                        qp_rem_v = qp_v % 6;
 1393|  1.52M|                    }
 1394|       |
 1395|  5.62M|                    y_cb_tu.pi2_tu_coeff = pi2_tu_coeff;
 1396|  5.62M|                    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.62M|                    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.62M|                    y_cb_tu.tu_coeff_stride = trans_size;
 1399|  5.62M|                    y_cb_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1400|  5.62M|                    y_cb_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1401|  5.62M|                    y_cb_tu.cbf = ps_tu->b1_cb_cbf;
 1402|       |
 1403|  5.62M|                    cr_tu.pi2_tu_coeff = pi2_tu_coeff + trans_size * trans_size;
 1404|  5.62M|                    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.62M|                    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.62M|                    cr_tu.tu_coeff_stride = trans_size;
 1407|  5.62M|                    cr_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1408|  5.62M|                    cr_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1409|  5.62M|                    cr_tu.cbf = ps_tu->b1_cr_cbf;
 1410|       |
 1411|       |                    /* Unpacking coeffs */
 1412|  5.62M|                    y_cb_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1413|  5.62M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1414|  5.62M|                    y_cb_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1415|  5.62M|                    y_cb_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1416|  5.62M|#endif
 1417|  5.62M|                    if(1 == y_cb_tu.cbf)
  ------------------
  |  Branch (1417:24): [True: 1.72M, False: 3.90M]
  ------------------
 1418|  1.72M|                    {
 1419|  1.72M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1420|  1.72M|                                        y_cb_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1421|  1.72M|                                        pu1_tu_coeff_data, pi2_dequant_matrix,
 1422|  1.72M|                                        qp_rem, qp_div, e_trans_type,
 1423|  1.72M|                                        ps_tu->b1_transquant_bypass, &y_cb_tu.zero_cols,
 1424|  1.72M|                                        &y_cb_tu.zero_rows, &y_cb_tu.coeff_type,
 1425|  1.72M|                                        &y_cb_tu.coeff_value, bit_depth_chroma);
 1426|  1.72M|                    }
 1427|  5.62M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1428|  5.62M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1428:24): [True: 1.72M, False: 3.90M]
  ------------------
 1429|  1.72M|                    {
 1430|  1.72M|                        cb_sub_tu.pi2_tu_coeff = ps_proc->pi2_invscan_out_subtu;
 1431|  1.72M|                        cb_sub_tu.pu1_pred = y_cb_tu.pu1_pred + trans_size * y_cb_tu.pred_strd * pixel_size_uv;
 1432|  1.72M|                        cb_sub_tu.pu1_dst = y_cb_tu.pu1_dst + trans_size * y_cb_tu.dst_strd * pixel_size_uv;
 1433|  1.72M|                        cb_sub_tu.tu_coeff_stride = trans_size;
 1434|  1.72M|                        cb_sub_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1435|  1.72M|                        cb_sub_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1436|  1.72M|                        cb_sub_tu.cbf = ps_tu->b1_cb_cbf_subtu1;
 1437|  1.72M|                        cb_sub_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1438|  1.72M|                        cb_sub_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1439|  1.72M|                        cb_sub_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1440|  1.72M|                        if(1 == cb_sub_tu.cbf)
  ------------------
  |  Branch (1440:28): [True: 475k, False: 1.25M]
  ------------------
 1441|   475k|                        {
 1442|   475k|                            pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1443|   475k|                                            cb_sub_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1444|   475k|                                            pu1_tu_coeff_data, pi2_dequant_matrix,
 1445|   475k|                                            qp_rem, qp_div, e_trans_type,
 1446|   475k|                                            ps_tu->b1_transquant_bypass, &cb_sub_tu.zero_cols,
 1447|   475k|                                            &cb_sub_tu.zero_rows, &cb_sub_tu.coeff_type,
 1448|   475k|                                            &cb_sub_tu.coeff_value, bit_depth_chroma);
 1449|   475k|                        }
 1450|  1.72M|                    }
 1451|  5.62M|#endif
 1452|       |
 1453|  5.62M|                    cr_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1454|  5.62M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1455|  5.62M|                    cr_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1456|  5.62M|                    cr_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1457|  5.62M|#endif
 1458|  5.62M|                    if(1 == cr_tu.cbf)
  ------------------
  |  Branch (1458:24): [True: 1.75M, False: 3.87M]
  ------------------
 1459|  1.75M|                    {
 1460|  1.75M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1461|  1.75M|                                        cr_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1462|  1.75M|                                        pu1_tu_coeff_data, pi2_dequant_matrix_v,
 1463|  1.75M|                                        qp_rem_v, qp_div_v, e_trans_type,
 1464|  1.75M|                                        ps_tu->b1_transquant_bypass, &cr_tu.zero_cols,
 1465|  1.75M|                                        &cr_tu.zero_rows, &cr_tu.coeff_type,
 1466|  1.75M|                                        &cr_tu.coeff_value, bit_depth_chroma);
 1467|  1.75M|                    }
 1468|  5.62M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1469|  5.62M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1469:24): [True: 1.72M, False: 3.90M]
  ------------------
 1470|  1.72M|                    {
 1471|  1.72M|                        cr_sub_tu.pi2_tu_coeff = ps_proc->pi2_invscan_out_subtu + trans_size * trans_size;
 1472|  1.72M|                        cr_sub_tu.pu1_pred = cr_tu.pu1_pred + trans_size * cr_tu.pred_strd * pixel_size_uv;
 1473|  1.72M|                        cr_sub_tu.pu1_dst = cr_tu.pu1_dst + trans_size * cr_tu.dst_strd * pixel_size_uv;
 1474|  1.72M|                        cr_sub_tu.tu_coeff_stride = trans_size;
 1475|  1.72M|                        cr_sub_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1476|  1.72M|                        cr_sub_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1477|  1.72M|                        cr_sub_tu.cbf = ps_tu->b1_cr_cbf_subtu1;
 1478|  1.72M|                        cr_sub_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1479|  1.72M|                        cr_sub_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1480|  1.72M|                        cr_sub_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1481|  1.72M|                        if(1 == cr_sub_tu.cbf)
  ------------------
  |  Branch (1481:28): [True: 486k, False: 1.24M]
  ------------------
 1482|   486k|                        {
 1483|   486k|                            pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1484|   486k|                                            cr_sub_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1485|   486k|                                            pu1_tu_coeff_data, pi2_dequant_matrix_v,
 1486|   486k|                                            qp_rem_v, qp_div_v, e_trans_type,
 1487|   486k|                                            ps_tu->b1_transquant_bypass, &cr_sub_tu.zero_cols,
 1488|   486k|                                            &cr_sub_tu.zero_rows, &cr_sub_tu.coeff_type,
 1489|   486k|                                            &cr_sub_tu.coeff_value, bit_depth_chroma);
 1490|   486k|                        }
 1491|  1.72M|                    }
 1492|  5.62M|#endif
 1493|  5.62M|                }
 1494|   321M|                WORD8 subtu_idx = 0;
 1495|   321M|                do
 1496|   322M|                {
 1497|   322M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1498|   322M|                    if(subtu_idx != 0 && c_idx != 0)
  ------------------
  |  Branch (1498:24): [True: 1.72M, False: 321M]
  |  Branch (1498:42): [True: 1.72M, False: 18.4E]
  ------------------
 1499|  1.72M|                    {
 1500|  1.72M|                        ps_cb_tu = &cb_sub_tu;
 1501|  1.72M|                        ps_cr_tu = &cr_sub_tu;
 1502|  1.72M|                        chroma_nbr_flags = chroma_nbr_flags_subtu;
 1503|  1.72M|                    }
 1504|   322M|#endif
 1505|       |                    /***************************************************************/
 1506|       |                    /******************  Intra Prediction **************************/
 1507|       |                    /***************************************************************/
 1508|   322M|                    if(intra_flag) /* Intra */
  ------------------
  |  Branch (1508:24): [True: 15.7M, False: 307M]
  ------------------
 1509|  15.7M|                    {
 1510|  15.7M|                        WORD32 pixel_size = (c_idx == 0) ? pixel_size_y : pixel_size_uv;
  ------------------
  |  Branch (1510:45): [True: 8.56M, False: 7.17M]
  ------------------
 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|  15.7M|                        UWORD8 au1_ref_sub_out[(16 + (MAX_TU_SIZE * 2 * 2 * 2) + 8) * 2];
 1518|  15.7M|                        memset(au1_ref_sub_out, 0, (16 + (MAX_TU_SIZE * 2 * 2 * 2) + 8) * pixel_size);
  ------------------
  |  |  357|  15.7M|#define MAX_TU_SIZE         32
  ------------------
 1519|  15.7M|                        UWORD8 *pu1_ref_sub_out = &au1_ref_sub_out[16 * pixel_size];
 1520|  15.7M|                        UWORD8 *pu1_top_left, *pu1_top, *pu1_left;
 1521|  15.7M|                        WORD32 luma_pred_func_idx, chroma_pred_func_idx;
 1522|       |
 1523|       |                        /* Get the neighbour availability flags */
 1524|       |                        /* Done for only Y */
 1525|  15.7M|                        if(c_idx == 0)
  ------------------
  |  Branch (1525:28): [True: 8.57M, False: 7.16M]
  ------------------
 1526|  8.57M|                        {
 1527|       |                            /* Get neighbor availability for Y only */
 1528|  8.57M|                            luma_nbr_flags = ihevcd_get_intra_nbr_flag(ps_proc,
 1529|  8.57M|                                                                    ps_tu,
 1530|  8.57M|                                                                    au4_intra_nbr_avail,
 1531|  8.57M|                                                                    ps_sps->i2_pic_width_in_luma_samples,
 1532|  8.57M|                                                                    ps_pps->i1_constrained_intra_pred_flag,
 1533|  8.57M|                                                                    trans_size,
 1534|  8.57M|                                                                    ctb_size);
 1535|       |
 1536|  8.57M|                            if(trans_size == 4)
  ------------------
  |  Branch (1536:32): [True: 3.84M, False: 4.73M]
  ------------------
 1537|  3.84M|                                luma_nbr_flags_4x4[(ps_tu->b4_pos_x % 2) + (ps_tu->b4_pos_y % 2) * 2] = luma_nbr_flags;
 1538|       |
 1539|  8.57M|                            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1539:32): [True: 0, False: 8.57M]
  ------------------
 1540|      0|                            {
 1541|      0|                                chroma_nbr_flags = luma_nbr_flags;
 1542|      0|                            }
 1543|  8.57M|                            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1543:37): [True: 2.64M, False: 5.93M]
  ------------------
 1544|  2.64M|                            {
 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|  2.64M|                                WORD32 tp_left = (luma_nbr_flags & 0x10000);
 1565|       |
 1566|  2.64M|                                switch (trans_size)
 1567|  2.64M|                                {
 1568|   584k|                                case 8:
  ------------------
  |  Branch (1568:33): [True: 584k, False: 2.06M]
  ------------------
 1569|   584k|                                    {
 1570|       |                                        /* Luma 8x8 -> Two 4x4 Chroma Sub-TUs (1 chunk of 4/8px per edge) */
 1571|   584k|                                        WORD32 chroma_Left = (luma_nbr_flags & 0x80);
 1572|   584k|                                        WORD32 chroma_BL = (luma_nbr_flags & 0x80) ? 0x8 : 0;
  ------------------
  |  Branch (1572:60): [True: 562k, False: 22.5k]
  ------------------
 1573|   584k|                                        chroma_nbr_flags = tp_left | (luma_nbr_flags & 0x1000) | (luma_nbr_flags & 0x100) | chroma_Left | chroma_BL;
 1574|       |
 1575|   584k|                                        WORD32 tp_left_subtu1 = (luma_nbr_flags & 0x80) ? 0x10000 : 0;
  ------------------
  |  Branch (1575:65): [True: 562k, False: 22.5k]
  ------------------
 1576|   584k|                                        WORD32 chroma_Left_subtu = (luma_nbr_flags & 0x80);
 1577|   584k|                                        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|   584k|                                        chroma_nbr_flags_subtu = tp_left_subtu1 | 0x100 | chroma_Left_subtu | chroma_BL_subtu;
 1580|   584k|                                    }
 1581|   584k|                                    break;
 1582|   264k|                                case 16:
  ------------------
  |  Branch (1582:33): [True: 264k, False: 2.38M]
  ------------------
 1583|   264k|                                    {
 1584|       |                                        /* Luma 16x16 -> Two 8x8 Chroma Sub-TUs (1 chunk of 8px per edge) */
 1585|   264k|                                        WORD32 chroma_Left = (luma_nbr_flags & 0x80) ? 0xC0 : 0;
  ------------------
  |  Branch (1585:62): [True: 235k, False: 28.1k]
  ------------------
 1586|   264k|                                        WORD32 chroma_BL = (luma_nbr_flags & 0x40) ? 0xC : 0;
  ------------------
  |  Branch (1586:60): [True: 235k, False: 28.1k]
  ------------------
 1587|   264k|                                        chroma_nbr_flags = tp_left | (luma_nbr_flags & 0x3000) | (luma_nbr_flags & 0x300) | chroma_Left | chroma_BL;
 1588|       |
 1589|   264k|                                        WORD32 tp_left_subtu1 = (luma_nbr_flags & 0x80) ? 0x10000 : 0;
  ------------------
  |  Branch (1589:65): [True: 235k, False: 28.1k]
  ------------------
 1590|   264k|                                        WORD32 chroma_Left_subtu = (luma_nbr_flags & 0x40) ? 0xC0 : 0;
  ------------------
  |  Branch (1590:68): [True: 235k, False: 28.1k]
  ------------------
 1591|   264k|                                        WORD32 chroma_BL_subtu = (luma_nbr_flags & 0x8) ? 0xC : 0;
  ------------------
  |  Branch (1591:66): [True: 62.4k, False: 201k]
  ------------------
 1592|       |                                        /* Top of Sub-TU 1 is 2 chunks (Bits 8,9 = 0x300) from reconstructed Sub-TU 0 */
 1593|   264k|                                        chroma_nbr_flags_subtu = tp_left_subtu1 | 0x300 | chroma_Left_subtu | chroma_BL_subtu;
 1594|   264k|                                    }
 1595|   264k|                                    break;
 1596|   566k|                                case 32:
  ------------------
  |  Branch (1596:33): [True: 566k, False: 2.08M]
  ------------------
 1597|   566k|                                    {
 1598|       |                                        /* Luma 32x32 -> Two 16x16 Chroma Sub-TUs (2 chunks of 8px per edge) */
 1599|   566k|                                        WORD32 chroma_Left = ((luma_nbr_flags & 0x80) ? 0xC0 : 0) | ((luma_nbr_flags & 0x40) ? 0x30 : 0);
  ------------------
  |  Branch (1599:63): [True: 537k, False: 28.4k]
  |  Branch (1599:102): [True: 537k, False: 28.4k]
  ------------------
 1600|   566k|                                        WORD32 chroma_BL = ((luma_nbr_flags & 0x20) ? 0xC : 0) | ((luma_nbr_flags & 0x10) ? 0x3 : 0);
  ------------------
  |  Branch (1600:61): [True: 537k, False: 28.4k]
  |  Branch (1600:99): [True: 537k, False: 28.4k]
  ------------------
 1601|   566k|                                        chroma_nbr_flags = tp_left | (luma_nbr_flags & 0xF000) | (luma_nbr_flags & 0xF00) | chroma_Left | chroma_BL;
 1602|       |
 1603|   566k|                                        WORD32 tp_left_subtu1 = (luma_nbr_flags & 0x40) ? 0x10000 : 0;
  ------------------
  |  Branch (1603:65): [True: 537k, False: 28.4k]
  ------------------
 1604|   566k|                                        WORD32 chroma_Left_subtu = ((luma_nbr_flags & 0x20) ? 0xC0 : 0) | ((luma_nbr_flags & 0x10) ? 0x30 : 0);
  ------------------
  |  Branch (1604:69): [True: 537k, False: 28.4k]
  |  Branch (1604:108): [True: 537k, False: 28.4k]
  ------------------
 1605|   566k|                                        WORD32 chroma_BL_subtu = ((luma_nbr_flags & 0x8) ? 0xC : 0) | ((luma_nbr_flags & 0x4) ? 0x3 : 0);
  ------------------
  |  Branch (1605:67): [True: 131k, False: 434k]
  |  Branch (1605:104): [True: 131k, False: 434k]
  ------------------
 1606|       |                                        /* Top of Sub-TU 1 is 4 chunks (Bits 8..11 = 0xF00) from reconstructed Sub-TU 0 */
 1607|   566k|                                        chroma_nbr_flags_subtu = tp_left_subtu1 | 0xF00 | chroma_Left_subtu | chroma_BL_subtu;
 1608|   566k|                                    }
 1609|   566k|                                    break;
 1610|  1.23M|                                default:
  ------------------
  |  Branch (1610:33): [True: 1.23M, False: 1.41M]
  ------------------
 1611|  1.23M|                                    chroma_nbr_flags = (luma_nbr_flags & 0x1ff00) | (luma_nbr_flags & 0xf0) | ((luma_nbr_flags & 0xf0) >> 4);
 1612|  1.23M|                                    chroma_nbr_flags_subtu = (((luma_nbr_flags & 0xf0) != 0 ? 1 : 0) << 16) | (0xf << 8) | (luma_nbr_flags & 0xff);
  ------------------
  |  Branch (1612:64): [True: 1.18M, False: 47.7k]
  ------------------
 1613|  1.23M|                                    break;
 1614|  2.64M|                                }
 1615|  2.64M|                            }
 1616|  5.93M|                            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1616:37): [True: 5.85M, False: 78.4k]
  ------------------
 1617|  5.85M|                            {
 1618|  5.85M|                                if(((ps_tu->b4_pos_x % 2 == 0) && (ps_tu->b4_pos_y % 2 == 0)))
  ------------------
  |  Branch (1618:37): [True: 4.58M, False: 1.26M]
  |  Branch (1618:67): [True: 3.95M, False: 636k]
  ------------------
 1619|  3.95M|                                    chroma_nbr_flags = luma_nbr_flags;
 1620|  5.85M|                            }
 1621|       |
 1622|       |                            /* Initializing nbr pointers */
 1623|  8.57M|                            pu1_top = y_cb_tu.pu1_pred - pic_strd * pixel_size_y;
 1624|  8.57M|                            pu1_left = y_cb_tu.pu1_pred - pixel_size_y;
 1625|  8.57M|                            pu1_top_left = y_cb_tu.pu1_pred - (pic_strd + 1) * pixel_size_y;
 1626|       |
 1627|       |                            /* call reference array substitution */
 1628|  8.57M|                            if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  8.57M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1628:32): [True: 5.37M, False: 3.20M]
  ------------------
 1629|  5.37M|                            {
 1630|  5.37M|                                if(luma_nbr_flags == 0x1ffff)
  ------------------
  |  Branch (1630:36): [True: 853k, False: 4.51M]
  ------------------
 1631|   853k|                                {
 1632|   853k|                                    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr(
 1633|   853k|                                                    pu1_top_left,
 1634|   853k|                                                    pu1_top, pu1_left, y_cb_tu.pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1);
 1635|   853k|                                }
 1636|  4.51M|                                else
 1637|  4.51M|                                {
 1638|  4.51M|                                    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr(
 1639|  4.51M|                                                    pu1_top_left,
 1640|  4.51M|                                                    pu1_top, pu1_left, y_cb_tu.pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1);
 1641|  4.51M|                                }
 1642|       |
 1643|       |                                /* call reference filtering */
 1644|  5.37M|                                ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr(
 1645|  5.37M|                                                pu1_ref_sub_out,
 1646|  5.37M|                                                trans_size,
 1647|  5.37M|                                                pu1_ref_sub_out,
 1648|  5.37M|                                                u1_luma_pred_mode,
 1649|  5.37M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1650|  5.37M|                                                (ps_sps->i1_intra_smoothing_disabled_flag << 3
 1651|  5.37M|                                                                | ps_sps->i1_strong_intra_smoothing_enable_flag)
 1652|       |#else
 1653|       |                                                ps_sps->i1_strong_intra_smoothing_enable_flag
 1654|       |#endif
 1655|  5.37M|                                                );
 1656|  5.37M|                            }
 1657|  3.20M|                            else
 1658|  3.20M|                            {
 1659|  3.20M|                                ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_ref_substitution_fptr(
 1660|  3.20M|                                                (UWORD16 *)pu1_top_left, (UWORD16 *)pu1_top, (UWORD16 *)pu1_left,
 1661|  3.20M|                                                y_cb_tu.pred_strd, trans_size, luma_nbr_flags,
 1662|  3.20M|                                                (UWORD16 *)pu1_ref_sub_out, 1, bit_depth_luma);
 1663|       |
 1664|       |                                /* call reference filtering */
 1665|  3.20M|                                ps_codec->s_func_selector.ihevc_hbd_intra_pred_ref_filtering_fptr(
 1666|  3.20M|                                                (UWORD16 *)pu1_ref_sub_out, trans_size,
 1667|  3.20M|                                                (UWORD16 *)pu1_ref_sub_out, u1_luma_pred_mode,
 1668|  3.20M|                                                (ps_sps->i1_intra_smoothing_disabled_flag << 3
 1669|  3.20M|                                                                | ps_sps->i1_strong_intra_smoothing_enable_flag),
 1670|  3.20M|                                                (UWORD8)bit_depth_luma);
 1671|  3.20M|                            }
 1672|       |
 1673|       |                            /* use the look up to get the function idx */
 1674|  8.57M|                            luma_pred_func_idx = g_i4_ip_funcs[u1_luma_pred_mode];
 1675|       |
 1676|  8.57M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1677|  8.57M|                            if(ps_sps->i1_implicit_rdpcm_enabled_flag && ps_tu->b1_transquant_bypass
  ------------------
  |  Branch (1677:32): [True: 105k, False: 8.47M]
  |  Branch (1677:74): [True: 39.3k, False: 65.9k]
  ------------------
 1678|  39.3k|                                            && (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26))
  ------------------
  |  Branch (1678:49): [True: 8.15k, False: 31.2k]
  |  Branch (1678:76): [True: 6.72k, False: 24.5k]
  ------------------
 1679|  14.8k|                                disable_boundary_filter = 1;
 1680|  8.57M|#endif
 1681|       |                            /* call the intra prediction function */
 1682|  8.57M|                            if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  8.57M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1682:32): [True: 5.39M, False: 3.18M]
  ------------------
 1683|  5.39M|                            {
 1684|  5.39M|                                ps_codec->apf_intra_pred_luma[luma_pred_func_idx](
 1685|  5.39M|                                                pu1_ref_sub_out, 1,
 1686|  5.39M|                                                y_cb_tu.pu1_pred,
 1687|  5.39M|                                                y_cb_tu.pred_strd,
 1688|  5.39M|                                                trans_size,
 1689|  5.39M|                                                (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26) ?
  ------------------
  |  Branch (1689:50): [True: 102k, False: 5.29M]
  |  Branch (1689:77): [True: 481k, False: 4.80M]
  ------------------
 1690|   596k|                                                                disable_boundary_filter :
 1691|  5.39M|                                                                u1_luma_pred_mode
 1692|  5.39M|                                                );
 1693|  5.39M|                            }
 1694|  3.18M|                            else
 1695|  3.18M|                            {
 1696|  3.18M|                                ps_codec->apf_hbd_intra_pred_luma[luma_pred_func_idx](
 1697|  3.18M|                                                (UWORD16 *)pu1_ref_sub_out, 1,
 1698|  3.18M|                                                (UWORD16 *)y_cb_tu.pu1_pred,
 1699|  3.18M|                                                y_cb_tu.pred_strd,
 1700|  3.18M|                                                trans_size,
 1701|  3.18M|                                                (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26) ?
  ------------------
  |  Branch (1701:50): [True: 26.7k, False: 3.15M]
  |  Branch (1701:77): [True: 405k, False: 2.75M]
  ------------------
 1702|   447k|                                                                disable_boundary_filter :
 1703|  3.18M|                                                                u1_luma_pred_mode,
 1704|  3.18M|                                                (UWORD8)bit_depth_luma);
 1705|  3.18M|                            }
 1706|  8.57M|                        }
 1707|  7.16M|                        else
 1708|  7.16M|                        {
 1709|       |                            /* In case of yuv420sp_vu, prediction happens as usual.         */
 1710|       |                            /* So point the pu1_pred pointer to original prediction pointer */
 1711|  7.16M|                            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|  7.16M|                            if(ps_tu->b3_size == 0)
  ------------------
  |  Branch (1717:32): [True: 1.26M, False: 5.90M]
  ------------------
 1718|  1.26M|                            {
 1719|  1.26M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1719:36): [True: 642k, False: 618k]
  ------------------
 1720|   642k|                                {
 1721|       |                                    /* Take TL,T,L flags of First luma 4x4 block */
 1722|   642k|                                    chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0);
 1723|       |                                    /* Take TR flags of Second luma 4x4 block */
 1724|   642k|                                    chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000);
 1725|       |                                    /* Take BL flags of Third luma 4x4 block */
 1726|   642k|                                    chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F);
 1727|   642k|                                }
 1728|   618k|                                else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1728:41): [True: 618k, False: 18.4E]
  ------------------
 1729|   618k|                                {
 1730|   618k|                                    if(subtu_idx == 0)
  ------------------
  |  Branch (1730:40): [True: 310k, False: 308k]
  ------------------
 1731|   310k|                                    {
 1732|       |                                        /* Take TL,T,L flags of First luma 4x4 block */
 1733|   310k|                                        chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0);
 1734|       |                                        /* Take TR flags of Second luma 4x4 block */
 1735|   310k|                                        chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000);
 1736|       |                                        /* Take BL flags of first luma 4x4 block */
 1737|   310k|                                        chroma_nbr_flags |= (luma_nbr_flags_4x4[0] & 0x0000F);
 1738|   310k|                                    }
 1739|   308k|                                    else
 1740|   308k|                                    {
 1741|       |                                        /* Take TL,T,L flags of Third luma 4x4 block */
 1742|   308k|                                        chroma_nbr_flags = (luma_nbr_flags_4x4[2] & 0x10FF0);
 1743|       |                                        /* Take BL flags of Third luma 4x4 block */
 1744|   308k|                                        chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F);
 1745|   308k|                                    }
 1746|   618k|                                }
 1747|  1.26M|                            }
 1748|       |
 1749|       |                            /* Initializing nbr pointers */
 1750|  7.16M|                            pu1_top = pu1_pred_orig - (pic_strd * chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
 1751|  7.16M|                            pu1_left = pu1_pred_orig - 2 * pixel_size_uv;
 1752|  7.16M|                            pu1_top_left = pu1_pred_orig - (pic_strd * chroma_pixel_strd / h_samp_factor + 2) * pixel_size_uv;
 1753|       |
 1754|  7.16M|                            if(subtu_idx == 0)
  ------------------
  |  Branch (1754:32): [True: 5.65M, False: 1.50M]
  ------------------
 1755|  5.65M|                            {
 1756|       |                                /* Chroma pred  mode derivation from luma pred mode */
 1757|  5.65M|                                {
 1758|  5.65M|                                    tu_t *ps_tu_tmp = ps_tu;
 1759|  5.65M|                                    if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1759:40): [True: 5.65M, False: 18.4E]
  ------------------
 1760|  5.65M|                                    {
 1761|  25.2M|                                        while(!ps_tu_tmp->b1_first_tu_in_cu)
  ------------------
  |  Branch (1761:47): [True: 19.6M, False: 5.65M]
  ------------------
 1762|  19.6M|                                        {
 1763|  19.6M|                                            ps_tu_tmp--;
 1764|  19.6M|                                        }
 1765|  5.65M|                                    }
 1766|  5.65M|                                    u1_luma_pred_mode_first_tu = ps_tu_tmp->b6_luma_intra_mode;
 1767|  5.65M|                                }
 1768|  5.65M|                                if(4 == u1_chroma_pred_mode)
  ------------------
  |  Branch (1768:36): [True: 4.89M, False: 763k]
  ------------------
 1769|  4.89M|                                    u1_chroma_pred_mode = u1_luma_pred_mode_first_tu;
 1770|   763k|                                else
 1771|   763k|                                {
 1772|   763k|                                    u1_chroma_pred_mode = gau1_intra_pred_chroma_modes[u1_chroma_pred_mode];
 1773|       |
 1774|   763k|                                    if(u1_chroma_pred_mode == u1_luma_pred_mode_first_tu)
  ------------------
  |  Branch (1774:40): [True: 122k, False: 641k]
  ------------------
 1775|   122k|                                    {
 1776|   122k|                                        u1_chroma_pred_mode = INTRA_ANGULAR(34);
  ------------------
  |  |  517|   122k|#define INTRA_ANGULAR(x) (x)
  ------------------
 1777|   122k|                                    }
 1778|   763k|                                }
 1779|  5.65M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1779:36): [True: 1.72M, False: 3.93M]
  ------------------
 1780|  1.72M|                                {
 1781|  1.72M|                                    u1_chroma_pred_mode = gau1_intra_pred_chroma_modes_422[u1_chroma_pred_mode];
 1782|  1.72M|                                }
 1783|  5.65M|                            }
 1784|       |
 1785|       |                            /* call the chroma reference array substitution */
 1786|  7.16M|                            if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  7.16M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1786:32): [True: 3.71M, False: 3.44M]
  ------------------
 1787|  3.71M|                            {
 1788|  3.71M|                                ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr(
 1789|  3.71M|                                                pu1_top_left,
 1790|  3.71M|                                                pu1_top, pu1_left,
 1791|  3.71M|                                                ps_cb_tu->pred_strd,
 1792|  3.71M|                                                trans_size, chroma_nbr_flags, pu1_ref_sub_out, 1,
 1793|  3.71M|                                                ps_sps->i1_chroma_format_idc);
 1794|       |
 1795|  3.71M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1796|       |                                /* call reference filtering */
 1797|  3.71M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1797:36): [True: 0, False: 3.71M]
  ------------------
 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.71M|#endif
 1808|       |
 1809|       |                                /* use the look up to get the function idx */
 1810|  3.71M|                                chroma_pred_func_idx = g_i4_ip_funcs[u1_chroma_pred_mode];
 1811|       |
 1812|       |                                /* call the intra prediction function */
 1813|  3.71M|                                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.71M|                            }
 1815|  3.44M|                            else
 1816|  3.44M|                            {
 1817|  3.44M|                                ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_ref_substitution_fptr((UWORD16 *)pu1_top_left,
 1818|  3.44M|                                                (UWORD16 *)pu1_top, (UWORD16 *)pu1_left, ps_cb_tu->pred_strd, trans_size,
 1819|  3.44M|                                                chroma_nbr_flags, (UWORD16 *)pu1_ref_sub_out, 1, ps_sps->i1_chroma_format_idc,
 1820|  3.44M|                                                (UWORD8) bit_depth_chroma);
 1821|       |
 1822|  3.44M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1823|       |                                /* call reference filtering */
 1824|  3.44M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1824:36): [True: 0, False: 3.44M]
  ------------------
 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|  3.44M|#endif
 1835|       |
 1836|       |                                /* use the look up to get the function idx */
 1837|  3.44M|                                chroma_pred_func_idx = g_i4_ip_funcs[u1_chroma_pred_mode];
 1838|       |
 1839|       |                                /* call the intra prediction function */
 1840|  3.44M|                                ps_codec->apf_hbd_intra_pred_chroma[chroma_pred_func_idx]((UWORD16 *)pu1_ref_sub_out,
 1841|  3.44M|                                            1, (UWORD16 *)pu1_pred_orig, ps_cb_tu->pred_strd, trans_size, u1_chroma_pred_mode);
 1842|  3.44M|                            }
 1843|  7.16M|                        }
 1844|  15.7M|                    }
 1845|       |
 1846|       |                    /* Updating number of transform types */
 1847|   322M|                    STATS_UPDATE_ALL_TRANS(e_trans_type, c_idx);
  ------------------
  |  |  138|   322M|#define STATS_UPDATE_ALL_TRANS(e_trans_type, c_idx) ;
  ------------------
 1848|       |
 1849|   322M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1850|   322M|                    iqitrecon_fptr = get_iqitrec_func(
 1851|   322M|                                    ps_proc, ps_tu, ps_cb_tu, log2_trans_size,
 1852|   322M|                                    c_idx != 0 ? U_PLANE : NULL_PLANE, intra_flag,
  ------------------
  |  Branch (1852:37): [True: 7.68M, False: 315M]
  ------------------
 1853|  18.4E|                                    c_idx == 0 ? u1_luma_pred_mode : u1_chroma_pred_mode);
  ------------------
  |  Branch (1853:37): [True: 329M, False: 18.4E]
  ------------------
 1854|   322M|#endif
 1855|       |                    /* IQ, IT and Recon for Y if c_idx == 0, and U if c_idx !=0 */
 1856|   322M|                    iqitrecon_fptr(ps_proc, ps_tu, ps_cb_tu, func_idx, log2_trans_size,
 1857|   322M|                                c_idx != 0 ? U_PLANE : NULL_PLANE, intra_flag,
  ------------------
  |  Branch (1857:33): [True: 7.59M, False: 315M]
  ------------------
 1858|   322M|                                c_idx == 0 ? u1_luma_pred_mode : u1_chroma_pred_mode);
  ------------------
  |  Branch (1858:33): [True: 321M, False: 1.36M]
  ------------------
 1859|       |                    /* IQ, IT and Recon for V */
 1860|   322M|                    if(c_idx != 0)
  ------------------
  |  Branch (1860:24): [True: 7.90M, False: 314M]
  ------------------
 1861|  7.90M|                    {
 1862|  7.90M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1863|  7.90M|                        iqitrecon_fptr = get_iqitrec_func(ps_proc, ps_tu, ps_cr_tu, log2_trans_size,
 1864|  7.90M|                                                        V_PLANE, intra_flag, u1_chroma_pred_mode);
 1865|  7.90M|#endif
 1866|  7.90M|                        iqitrecon_fptr(ps_proc, ps_tu, ps_cr_tu, func_idx, log2_trans_size, V_PLANE,
 1867|  7.90M|                                    intra_flag, u1_chroma_pred_mode);
 1868|  7.90M|                    }
 1869|   322M|                }
 1870|   322M|                while(c_idx != 0 && ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422
  ------------------
  |  Branch (1870:23): [True: 7.88M, False: 314M]
  |  Branch (1870:37): [True: 3.42M, False: 4.45M]
  ------------------
 1871|  3.42M|                                && ++subtu_idx < 2);
  ------------------
  |  Branch (1871:36): [True: 1.72M, False: 1.70M]
  ------------------
 1872|   321M|            }
 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|   321M|            if(c_idx == 0)
  ------------------
  |  Branch (1877:16): [True: 316M, False: 4.90M]
  ------------------
 1878|   316M|            {
 1879|   316M|                WORD32 i;
 1880|   316M|                WORD32 trans_in_min_tu;
 1881|   316M|                UWORD32 cur_tu_in_bits;
 1882|   316M|                UWORD32 cur_tu_avail_flag;
 1883|       |
 1884|   316M|                trans_in_min_tu = trans_size / MIN_TU_SIZE;
  ------------------
  |  |  358|   316M|#define MIN_TU_SIZE         4
  ------------------
 1885|   316M|                cur_tu_in_bits = (1 << trans_in_min_tu) - 1;
 1886|   316M|                cur_tu_in_bits = cur_tu_in_bits << (32 - trans_in_min_tu);
 1887|       |
 1888|   316M|                cur_tu_avail_flag = cur_tu_in_bits >> (ps_tu->b4_pos_x + 1);
 1889|       |
 1890|   960M|                for(i = 0; i < trans_in_min_tu; i++)
  ------------------
  |  Branch (1890:28): [True: 644M, False: 316M]
  ------------------
 1891|   644M|                    au4_intra_nbr_avail[1 + ps_tu->b4_pos_y + i] |=
 1892|   644M|                                    cur_tu_avail_flag;
 1893|   316M|            }
 1894|   321M|        }
 1895|   312M|    }
 1896|  23.3M|    ps_proc->pv_tu_coeff_data = pu1_tu_coeff_data;
 1897|       |
 1898|  23.3M|    return ps_proc->i4_ctb_tu_cnt;
 1899|  23.3M|}
ihevcd_iquant_itrans_recon_ctb.c:ihevcd_iquant_itrans_resi_recon_tu_plane:
  727|   610k|{
  728|   610k|    sps_t *ps_sps = ps_proc->ps_sps;
  729|   610k|    pps_t *ps_pps = ps_proc->ps_pps;
  730|   610k|    codec_t *ps_codec = ps_proc->ps_codec;
  731|   610k|    WORD8 trans_size = 1 << log2_trans_size;
  732|   610k|    WORD16 *pi2_res = ps_proc->pi2_res_luma_buf;
  733|   610k|    WORD16 *pi2_res_uv = ps_proc->pi2_res_chroma_buf;
  734|   610k|    WORD32 alpha = 0;
  735|   610k|    WORD16 *residue_out_base = chroma_plane == NULL_PLANE ? pi2_res : pi2_res_uv;
  ------------------
  |  Branch (735:32): [True: 232k, False: 377k]
  ------------------
  736|   610k|    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|   610k|    WORD16 *residue_out_intrmdt = residue_out_base + (TRANS_SIZE_4 * TRANS_SIZE_4);
  ------------------
  |  |  429|   610k|#define TRANS_SIZE_4   4
  ------------------
                  WORD16 *residue_out_intrmdt = residue_out_base + (TRANS_SIZE_4 * TRANS_SIZE_4);
  ------------------
  |  |  429|   610k|#define TRANS_SIZE_4   4
  ------------------
  740|       |
  741|   610k|    WORD32 bit_depth = chroma_plane == NULL_PLANE ? ps_codec->i4_bit_depth_luma : ps_codec->i4_bit_depth_chroma;
  ------------------
  |  Branch (741:24): [True: 232k, False: 377k]
  ------------------
  742|   610k|    if(chroma_plane == U_PLANE && ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0)
  ------------------
  |  Branch (742:8): [True: 198k, False: 412k]
  |  Branch (742:35): [True: 193k, False: 4.44k]
  ------------------
  743|   193k|    {
  744|   193k|        alpha = (1 << (ps_tu->b3_cb_log2_res_scale_abs_plus1 - 1))
  745|   193k|                        * (1 - 2 * ps_tu->b1_cb_log2_res_sign);
  746|   193k|    }
  747|   416k|    else if(chroma_plane == V_PLANE && ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0)
  ------------------
  |  Branch (747:13): [True: 186k, False: 229k]
  |  Branch (747:40): [True: 182k, False: 4.41k]
  ------------------
  748|   182k|    {
  749|   182k|        alpha = (1 << (ps_tu->b3_cr_log2_res_scale_abs_plus1 - 1))
  750|   182k|                        * (1 - 2 * ps_tu->b1_cr_log2_res_sign);
  751|   182k|    }
  752|   610k|    if(1 == ps_pl_tu_ctxt->cbf)
  ------------------
  |  Branch (752:8): [True: 311k, False: 298k]
  ------------------
  753|   311k|    {
  754|   311k|        if(ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag)
  ------------------
  |  Branch (754:12): [True: 18.5k, False: 293k]
  |  Branch (754:43): [True: 42.4k, False: 250k]
  ------------------
  755|  61.1k|        {
  756|  61.1k|            WORD8 rotate = ps_sps->i1_transform_skip_rotation_enabled_flag && trans_size == 4
  ------------------
  |  Branch (756:28): [True: 43.6k, False: 17.4k]
  |  Branch (756:79): [True: 41.3k, False: 2.30k]
  ------------------
  757|  41.3k|                            && intra_flag;
  ------------------
  |  Branch (757:32): [True: 40.0k, False: 1.36k]
  ------------------
  758|  61.1k|            WORD8 rdpcm = (ps_sps->i1_implicit_rdpcm_enabled_flag && intra_flag
  ------------------
  |  Branch (758:28): [True: 23.1k, False: 37.9k]
  |  Branch (758:70): [True: 21.4k, False: 1.74k]
  ------------------
  759|  21.4k|                            && (intra_pred_mode == 10 || intra_pred_mode == 26))
  ------------------
  |  Branch (759:33): [True: 7.21k, False: 14.2k]
  |  Branch (759:58): [True: 6.13k, False: 8.10k]
  ------------------
  760|  47.8k|                            || ps_pl_tu_ctxt->explicit_rdpcm_flag;
  ------------------
  |  Branch (760:32): [True: 1.75k, False: 46.0k]
  ------------------
  761|  61.1k|            WORD16 *src_residue = ps_pl_tu_ctxt->pi2_tu_coeff;
  762|  61.1k|            WORD16 src_residue_strd = ps_pl_tu_ctxt->tu_coeff_stride;
  763|       |
  764|  61.1k|            if(rotate)
  ------------------
  |  Branch (764:16): [True: 40.0k, False: 21.1k]
  ------------------
  765|  40.0k|            {
  766|  40.0k|                ihevc_res_4x4_rotate(src_residue, rdpcm ? residue_out_intrmdt : residue_out,
  ------------------
  |  Branch (766:51): [True: 4.76k, False: 35.2k]
  ------------------
  767|  40.0k|                                     src_residue_strd, trans_size, ps_pl_tu_ctxt->zero_cols);
  768|  40.0k|                ps_pl_tu_ctxt->zero_cols =
  769|  40.0k|                                gau4_ihevcd_4_bit_reverse[ps_pl_tu_ctxt->zero_cols & 0xF];
  770|  40.0k|                src_residue = residue_out_intrmdt;
  771|  40.0k|                src_residue_strd = trans_size;
  772|  40.0k|            }
  773|       |
  774|  61.1k|            if(rdpcm)
  ------------------
  |  Branch (774:16): [True: 15.0k, False: 46.0k]
  ------------------
  775|  15.0k|            {
  776|  15.0k|                WORD8 rdpcm_dir =
  777|  15.0k|                                ps_pl_tu_ctxt->explicit_rdpcm_flag ?
  ------------------
  |  Branch (777:33): [True: 1.75k, False: 13.3k]
  ------------------
  778|  1.75k|                                                ps_pl_tu_ctxt->explicit_rdpcm_dir :
  779|  15.0k|                                                intra_pred_mode != 10;
  780|  15.0k|                if(rdpcm_dir == 0)
  ------------------
  |  Branch (780:20): [True: 8.41k, False: 6.67k]
  ------------------
  781|  8.41k|                {
  782|  8.41k|                    ihevc_res_nxn_rdpcm_horz(src_residue, residue_out, src_residue_strd, trans_size,
  783|  8.41k|                                             trans_size, ps_pl_tu_ctxt->zero_cols);
  784|  8.41k|                    ps_pl_tu_ctxt->zero_cols = (1 << CTZ(~ps_pl_tu_ctxt->zero_cols)) - 1;
  785|  8.41k|                }
  786|  6.67k|                else
  787|  6.67k|                {
  788|  6.67k|                    ihevc_res_nxn_rdpcm_vert(src_residue, residue_out, src_residue_strd, trans_size,
  789|  6.67k|                                             trans_size, ps_pl_tu_ctxt->zero_cols);
  790|  6.67k|                }
  791|  15.0k|            }
  792|       |
  793|  61.1k|            if(!rdpcm && !rotate)
  ------------------
  |  Branch (793:16): [True: 46.0k, False: 15.0k]
  |  Branch (793:26): [True: 10.7k, False: 35.2k]
  ------------------
  794|  10.7k|            {
  795|  10.7k|                ihevc_res_nxn_copy(src_residue, residue_out, src_residue_strd, trans_size,
  796|  10.7k|                                   trans_size, ps_pl_tu_ctxt->zero_cols);
  797|  10.7k|            }
  798|  61.1k|        }
  799|   250k|        else
  800|   250k|        {
  801|       |            /* iQuant, iTrans */
  802|   250k|            if(0 == ps_pl_tu_ctxt->coeff_type)
  ------------------
  |  Branch (802:16): [True: 194k, False: 55.7k]
  ------------------
  803|   194k|            {
  804|   194k|                WORD32 func_tmp_idx = chroma_plane != NULL_PLANE ? func_idx - 4 : func_idx;
  ------------------
  |  Branch (804:39): [True: 30.4k, False: 164k]
  ------------------
  805|   194k|                ps_codec->apf_itrans_res[func_tmp_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
  806|   194k|                                                       ps_proc->pi2_itrans_intrmd_buf, residue_out,
  807|   194k|                                                       ps_pl_tu_ctxt->tu_coeff_stride, trans_size,
  808|   194k|                                                       ps_pl_tu_ctxt->zero_cols,
  809|   194k|                                                       ps_pl_tu_ctxt->zero_rows, (UWORD8)bit_depth);
  810|   194k|            }
  811|  55.7k|            else /* DC only */
  812|  55.7k|            {
  813|  55.7k|                ps_codec->apf_itrans_res_dc(residue_out, trans_size, log2_trans_size,
  814|  55.7k|                                            ps_pl_tu_ctxt->coeff_value, (UWORD8)bit_depth);
  815|  55.7k|            }
  816|   250k|            ps_pl_tu_ctxt->zero_cols = 0;
  817|   250k|        }
  818|   311k|        if(!alpha)
  ------------------
  |  Branch (818:12): [True: 241k, False: 69.9k]
  ------------------
  819|   241k|        {
  820|   241k|            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   241k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (820:16): [True: 211k, False: 29.9k]
  ------------------
  821|   211k|            {
  822|   211k|                ps_codec->apf_recon[func_idx](residue_out, ps_pl_tu_ctxt->pu1_pred,
  823|   211k|                                              ps_pl_tu_ctxt->pu1_dst, trans_size,
  824|   211k|                                              ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  825|   211k|                                              ps_pl_tu_ctxt->zero_cols);
  826|   211k|            }
  827|  29.9k|            else
  828|  29.9k|            {
  829|  29.9k|                ps_codec->apf_hbd_recon[func_idx](residue_out, (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  830|  29.9k|                                                  (UWORD16 *)ps_pl_tu_ctxt->pu1_dst, trans_size,
  831|  29.9k|                                                  ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  832|  29.9k|                                                  ps_pl_tu_ctxt->zero_cols, (UWORD8)bit_depth);
  833|  29.9k|            }
  834|   241k|        }
  835|   311k|    }
  836|   610k|    if(alpha)
  ------------------
  |  Branch (836:8): [True: 375k, False: 235k]
  ------------------
  837|   375k|    {
  838|   375k|        if(0 == ps_pl_tu_ctxt->cbf)
  ------------------
  |  Branch (838:12): [True: 304k, False: 70.6k]
  ------------------
  839|   304k|        {
  840|   304k|            memset(residue_out, 0, trans_size * trans_size * sizeof(WORD16));
  841|   304k|        }
  842|   375k|        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|   375k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (842:12): [True: 351k, False: 24.3k]
  ------------------
  843|   351k|        {
  844|   351k|            ihevc_chroma_recon_nxn_ccp(pi2_res, pi2_res_uv, ps_pl_tu_ctxt->pu1_pred,
  845|   351k|                                       ps_pl_tu_ctxt->pu1_dst, alpha, trans_size, trans_size,
  846|   351k|                                       trans_size, ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd);
  847|   351k|        }
  848|  24.3k|        else
  849|  24.3k|        {
  850|  24.3k|            ihevc_hbd_chroma_recon_nxn_ccp(pi2_res, pi2_res_uv, (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  851|  24.3k|                                           (UWORD16 *)ps_pl_tu_ctxt->pu1_dst, alpha, trans_size, trans_size,
  852|  24.3k|                                           trans_size, ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, (UWORD8)bit_depth);
  853|  24.3k|        }
  854|   375k|    }
  855|   610k|}
ihevcd_iquant_itrans_recon_ctb.c:ihevcd_iquant_itrans_recon_tu_plane:
  638|   331M|{
  639|   331M|    sps_t *ps_sps = ps_proc->ps_sps;
  640|   331M|    pps_t *ps_pps = ps_proc->ps_pps;
  641|   331M|    codec_t *ps_codec = ps_proc->ps_codec;
  642|   331M|    WORD32 is_chroma = (chroma_plane != NULL_PLANE);
  643|   331M|    WORD32 pixel_size = is_chroma ? ps_codec->i4_pixel_size_uv : ps_codec->i4_pixel_size_y;
  ------------------
  |  Branch (643:25): [True: 15.3M, False: 316M]
  ------------------
  644|   331M|    WORD32 bit_depth = is_chroma ? ps_codec->i4_bit_depth_chroma : ps_codec->i4_bit_depth_luma;
  ------------------
  |  Branch (644:24): [True: 15.3M, False: 316M]
  ------------------
  645|       |
  646|   331M|    if(1 == ps_pl_tu_ctxt->cbf)
  ------------------
  |  Branch (646:8): [True: 9.86M, False: 321M]
  ------------------
  647|  9.86M|    {
  648|  9.86M|        if(ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag)
  ------------------
  |  Branch (648:12): [True: 1.03M, False: 8.82M]
  |  Branch (648:43): [True: 1.20M, False: 7.61M]
  ------------------
  649|  2.26M|        {
  650|       |            /* Recon */
  651|  2.26M|            if(PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  2.26M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (651:16): [True: 1.07M, False: 1.19M]
  ------------------
  652|  1.07M|            {
  653|  1.07M|                ps_codec->apf_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff, ps_pl_tu_ctxt->pu1_pred,
  654|  1.07M|                                              ps_pl_tu_ctxt->pu1_dst, ps_pl_tu_ctxt->tu_coeff_stride,
  655|  1.07M|                                              ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  656|  1.07M|                                              ps_pl_tu_ctxt->zero_cols);
  657|  1.07M|            }
  658|  1.19M|            else
  659|  1.19M|            {
  660|  1.19M|                ps_codec->apf_hbd_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff, (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  661|  1.19M|                                                  (UWORD16 *)ps_pl_tu_ctxt->pu1_dst, ps_pl_tu_ctxt->tu_coeff_stride,
  662|  1.19M|                                                  ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  663|  1.19M|                                                  ps_pl_tu_ctxt->zero_cols, (UWORD8)bit_depth);
  664|  1.19M|            }
  665|  2.26M|        }
  666|  7.59M|        else
  667|  7.59M|        {
  668|       |            /* iQuant , iTrans and Recon */
  669|  7.59M|            if((0 == ps_pl_tu_ctxt->coeff_type))
  ------------------
  |  Branch (669:16): [True: 5.15M, False: 2.43M]
  ------------------
  670|  5.15M|            {
  671|  5.15M|                if(PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  5.15M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (671:20): [True: 3.42M, False: 1.73M]
  ------------------
  672|  3.42M|                {
  673|  3.42M|                    ps_codec->apf_itrans_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
  674|  3.42M|                                                        ps_proc->pi2_itrans_intrmd_buf,
  675|  3.42M|                                                        ps_pl_tu_ctxt->pu1_pred,
  676|  3.42M|                                                        ps_pl_tu_ctxt->pu1_dst,
  677|  3.42M|                                                        ps_pl_tu_ctxt->tu_coeff_stride,
  678|  3.42M|                                                        ps_pl_tu_ctxt->pred_strd,
  679|  3.42M|                                                        ps_pl_tu_ctxt->dst_strd,
  680|  3.42M|                                                        ps_pl_tu_ctxt->zero_cols,
  681|  3.42M|                                                        ps_pl_tu_ctxt->zero_rows);
  682|  3.42M|                }
  683|  1.73M|                else
  684|  1.73M|                {
  685|  1.73M|                    ps_codec->apf_hbd_itrans_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
  686|  1.73M|                                                           ps_proc->pi2_itrans_intrmd_buf,
  687|  1.73M|                                                           (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  688|  1.73M|                                                           (UWORD16 *)ps_pl_tu_ctxt->pu1_dst,
  689|  1.73M|                                                           ps_pl_tu_ctxt->tu_coeff_stride,
  690|  1.73M|                                                           ps_pl_tu_ctxt->pred_strd,
  691|  1.73M|                                                           ps_pl_tu_ctxt->dst_strd,
  692|  1.73M|                                                           ps_pl_tu_ctxt->zero_cols,
  693|  1.73M|                                                           ps_pl_tu_ctxt->zero_rows,
  694|  1.73M|                                                           (UWORD8)bit_depth);
  695|  1.73M|                }
  696|  5.15M|            }
  697|  2.43M|            else /* DC only */
  698|  2.43M|            {
  699|  2.43M|                if(PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  2.43M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (699:20): [True: 1.44M, False: 992k]
  ------------------
  700|  1.44M|                {
  701|  1.44M|                    ps_codec->apf_itrans_recon_dc[is_chroma](
  702|  1.44M|                                ps_pl_tu_ctxt->pu1_pred, ps_pl_tu_ctxt->pu1_dst,
  703|  1.44M|                                ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, log2_trans_size,
  704|  1.44M|                                ps_pl_tu_ctxt->coeff_value);
  705|  1.44M|                }
  706|   992k|                else
  707|   992k|                {
  708|   992k|                    ps_codec->apf_hbd_itrans_recon_dc[is_chroma](
  709|   992k|                                (UWORD16 *)ps_pl_tu_ctxt->pu1_pred, (UWORD16 *)ps_pl_tu_ctxt->pu1_dst,
  710|   992k|                                ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, log2_trans_size,
  711|   992k|                                ps_pl_tu_ctxt->coeff_value, bit_depth);
  712|   992k|                }
  713|  2.43M|            }
  714|  7.59M|        }
  715|  9.86M|    }
  716|   331M|}

ihevcd_itrans_recon_dc_luma:
   92|   132k|{
   93|   132k|    WORD32 row, col;
   94|   132k|    WORD32 add, shift;
   95|   132k|    WORD32 dc_value, quant_out;
   96|   132k|    WORD32 trans_size;
   97|       |
   98|   132k|    trans_size = (1 << log2_trans_size);
   99|       |
  100|   132k|    quant_out = i2_coeff_value;
  101|       |
  102|   132k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   132k|#define IT_SHIFT_STAGE_1 7
  ------------------
  103|   132k|    add = 1 << (shift - 1);
  104|   132k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   132k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   132k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 132k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 132k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|   132k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   132k|#define IT_SHIFT_STAGE_2 12
  ------------------
  106|   132k|    add = 1 << (shift - 1);
  107|   132k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   132k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   132k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 132k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 132k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|       |
  109|  2.09M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (109:18): [True: 1.96M, False: 132k]
  ------------------
  110|  39.6M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (110:22): [True: 37.6M, False: 1.96M]
  ------------------
  111|  37.6M|            pu1_dst[row * dst_strd + col] = CLIP_U8((pu1_pred[row * pred_strd + col] + dc_value));
  ------------------
  |  |   40|  37.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  37.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.06M, False: 31.6M]
  |  |  |  |  |  Branch (40:53): [True: 1.42M, False: 30.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|       |
  113|   132k|}
ihevcd_hbd_itrans_recon_dc_luma:
  122|   270k|{
  123|   270k|    WORD32 row, col;
  124|   270k|    WORD32 add, shift;
  125|   270k|    WORD32 dc_value, quant_out;
  126|   270k|    WORD32 trans_size;
  127|       |
  128|   270k|    trans_size = (1 << log2_trans_size);
  129|       |
  130|   270k|    quant_out = i2_coeff_value;
  131|       |
  132|   270k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   270k|#define IT_SHIFT_STAGE_1 7
  ------------------
  133|   270k|    add = 1 << (shift - 1);
  134|   270k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   270k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   270k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 270k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 270k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|   270k|    shift = 20 - bit_depth;
  136|   270k|    add = 1 << (shift - 1);
  137|   270k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   270k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   270k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 270k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 270k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|       |
  139|  4.28M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (139:18): [True: 4.01M, False: 270k]
  ------------------
  140|  86.9M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (140:22): [True: 82.9M, False: 4.01M]
  ------------------
  141|  82.9M|            pu2_dst[row * dst_strd + col] = CLIP3((pu2_pred[row * pred_strd + col] + dc_value),
  ------------------
  |  |   40|  82.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.37M, False: 77.5M]
  |  |  |  Branch (40:53): [True: 504k, False: 77.0M]
  |  |  ------------------
  ------------------
  142|   270k|                                                  0, ((1 << bit_depth) - 1));
  143|       |
  144|   270k|}
ihevcd_itrans_recon_dc_chroma:
  152|   113k|{
  153|   113k|    WORD32 row, col;
  154|   113k|    WORD32 add, shift;
  155|   113k|    WORD32 dc_value, quant_out;
  156|   113k|    WORD32 trans_size;
  157|       |
  158|       |
  159|   113k|    trans_size = (1 << log2_trans_size);
  160|       |
  161|   113k|    quant_out = i2_coeff_value;
  162|       |
  163|   113k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   113k|#define IT_SHIFT_STAGE_1 7
  ------------------
  164|   113k|    add = 1 << (shift - 1);
  165|   113k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   113k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   113k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 113k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 113k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|   113k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   113k|#define IT_SHIFT_STAGE_2 12
  ------------------
  167|   113k|    add = 1 << (shift - 1);
  168|   113k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   113k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   113k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 113k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 113k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|       |
  170|   971k|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (170:18): [True: 858k, False: 113k]
  ------------------
  171|  9.72M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (171:22): [True: 8.86M, False: 858k]
  ------------------
  172|  8.86M|            pu1_dst[row * dst_strd + (col << 1)] = CLIP_U8((pu1_pred[row * pred_strd + (col << 1)] + dc_value));
  ------------------
  |  |   40|  8.86M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 460k, False: 8.40M]
  |  |  |  |  |  Branch (40:53): [True: 551k, False: 7.85M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|       |
  174|   113k|}
ihevcd_hbd_itrans_recon_dc_chroma:
  183|   785k|{
  184|   785k|    WORD32 row, col;
  185|   785k|    WORD32 add, shift;
  186|   785k|    WORD32 dc_value, quant_out;
  187|   785k|    WORD32 trans_size;
  188|       |
  189|   785k|    trans_size = (1 << log2_trans_size);
  190|       |
  191|   785k|    quant_out = i2_coeff_value;
  192|       |
  193|   785k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   785k|#define IT_SHIFT_STAGE_1 7
  ------------------
  194|   785k|    add = 1 << (shift - 1);
  195|   785k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   785k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   785k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 785k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 785k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|   785k|    shift = 20 - bit_depth;
  197|   785k|    add = 1 << (shift - 1);
  198|   785k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   785k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   785k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 785k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 785k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|       |
  200|  5.45M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (200:18): [True: 4.67M, False: 785k]
  ------------------
  201|  43.6M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (201:22): [True: 38.9M, False: 4.67M]
  ------------------
  202|  38.9M|            pu2_dst[row * dst_strd + (col << 1)] = CLIP3((pu2_pred[row * pred_strd + (col << 1)] + dc_value),
  ------------------
  |  |   40|  38.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.04M, False: 36.9M]
  |  |  |  Branch (40:53): [True: 673k, False: 36.2M]
  |  |  ------------------
  ------------------
  203|   785k|                                                         0, ((1 << bit_depth) - 1));
  204|       |
  205|   785k|}

ihevcd_jobq_ctxt_size:
   74|  25.3k|{
   75|  25.3k|    WORD32 size;
   76|  25.3k|    size = sizeof(jobq_t);
   77|  25.3k|    size += ithread_get_mutex_lock_size();
   78|  25.3k|    return size;
   79|  25.3k|}
ihevcd_jobq_lock:
  100|  7.43M|{
  101|  7.43M|    WORD32 retval;
  102|  7.43M|    retval = ithread_mutex_lock(ps_jobq->pv_mutex);
  103|  7.43M|    if(retval)
  ------------------
  |  Branch (103:8): [True: 0, False: 7.43M]
  ------------------
  104|      0|    {
  105|      0|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
  106|      0|    }
  107|  7.43M|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  108|  7.43M|}
ihevcd_jobq_unlock:
  130|  7.48M|{
  131|  7.48M|    WORD32 retval;
  132|  7.48M|    retval = ithread_mutex_unlock(ps_jobq->pv_mutex);
  133|  7.48M|    if(retval)
  ------------------
  |  Branch (133:8): [True: 0, False: 7.48M]
  ------------------
  134|      0|    {
  135|      0|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
  136|      0|    }
  137|  7.48M|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  138|       |
  139|  7.48M|}
ihevcd_jobq_yield:
  163|  3.06M|{
  164|       |
  165|  3.06M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  166|       |
  167|  3.06M|    IHEVCD_ERROR_T rettmp;
  168|  3.06M|    rettmp = ihevcd_jobq_unlock(ps_jobq);
  169|  3.06M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  3.06M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 3.06M]
  |  |  ------------------
  ------------------
  170|       |
  171|       |    //NOP(1024 * 8);
  172|  3.06M|    ithread_yield();
  173|       |
  174|  3.06M|    rettmp = ihevcd_jobq_lock(ps_jobq);
  175|  3.06M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  3.06M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 3.06M]
  |  |  ------------------
  ------------------
  176|  3.06M|    return ret;
  177|  3.06M|}
ihevcd_jobq_init:
  232|  25.3k|{
  233|  25.3k|    jobq_t *ps_jobq;
  234|  25.3k|    UWORD8 *pu1_buf;
  235|  25.3k|    pu1_buf = (UWORD8 *)pv_buf;
  236|       |
  237|  25.3k|    ps_jobq = (jobq_t *)pu1_buf;
  238|  25.3k|    pu1_buf += sizeof(jobq_t);
  239|  25.3k|    buf_size -= sizeof(jobq_t);
  240|       |
  241|  25.3k|    ps_jobq->pv_mutex = pu1_buf;
  242|  25.3k|    pu1_buf += ithread_get_mutex_lock_size();
  243|  25.3k|    buf_size -= ithread_get_mutex_lock_size();
  244|       |
  245|  25.3k|    if(buf_size <= 0)
  ------------------
  |  Branch (245:8): [True: 0, False: 25.3k]
  ------------------
  246|      0|        return NULL;
  247|       |
  248|  25.3k|    ithread_mutex_init(ps_jobq->pv_mutex);
  249|       |
  250|  25.3k|    ps_jobq->pv_buf_base = pu1_buf;
  251|  25.3k|    ps_jobq->pv_buf_wr = pu1_buf;
  252|  25.3k|    ps_jobq->pv_buf_rd = pu1_buf;
  253|  25.3k|    ps_jobq->pv_buf_end = pu1_buf + buf_size;
  254|  25.3k|    ps_jobq->i4_terminate = 0;
  255|       |
  256|       |
  257|  25.3k|    return ps_jobq;
  258|  25.3k|}
ihevcd_jobq_reset:
  278|  98.3k|{
  279|  98.3k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  280|  98.3k|    ret = ihevcd_jobq_lock(ps_jobq);
  281|  98.3k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  98.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 98.3k]
  |  |  ------------------
  ------------------
  282|       |
  283|  98.3k|    ps_jobq->pv_buf_wr      = ps_jobq->pv_buf_base;
  284|  98.3k|    ps_jobq->pv_buf_rd      = ps_jobq->pv_buf_base;
  285|  98.3k|    ps_jobq->i4_terminate   = 0;
  286|  98.3k|    ret = ihevcd_jobq_unlock(ps_jobq);
  287|  98.3k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  98.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 98.3k]
  |  |  ------------------
  ------------------
  288|       |
  289|  98.3k|    return ret;
  290|  98.3k|}
ihevcd_jobq_deinit:
  312|  25.3k|{
  313|  25.3k|    WORD32 retval;
  314|  25.3k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  315|       |
  316|  25.3k|    ret = ihevcd_jobq_reset(ps_jobq);
  317|  25.3k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  25.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 25.3k]
  |  |  ------------------
  ------------------
  318|       |
  319|  25.3k|    retval = ithread_mutex_destroy(ps_jobq->pv_mutex);
  320|  25.3k|    if(retval)
  ------------------
  |  Branch (320:8): [True: 0, False: 25.3k]
  ------------------
  321|      0|    {
  322|      0|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
  323|      0|    }
  324|       |
  325|  25.3k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  326|  25.3k|}
ihevcd_jobq_terminate:
  349|  51.2k|{
  350|  51.2k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  351|  51.2k|    ret = ihevcd_jobq_lock(ps_jobq);
  352|  51.2k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  51.2k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 51.2k]
  |  |  ------------------
  ------------------
  353|       |
  354|  51.2k|    ps_jobq->i4_terminate = 1;
  355|       |
  356|  51.2k|    ret = ihevcd_jobq_unlock(ps_jobq);
  357|  51.2k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  51.2k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 51.2k]
  |  |  ------------------
  ------------------
  358|  51.2k|    return ret;
  359|  51.2k|}
ihevcd_jobq_queue:
  393|  2.05M|{
  394|  2.05M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  395|  2.05M|    IHEVCD_ERROR_T rettmp;
  396|  2.05M|    UWORD8 *pu1_buf;
  397|  2.05M|    UNUSED(blocking);
  ------------------
  |  |   38|  2.05M|#define UNUSED(x) ((void)(x))
  ------------------
  398|       |
  399|  2.05M|    rettmp = ihevcd_jobq_lock(ps_jobq);
  400|  2.05M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  2.05M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.05M]
  |  |  ------------------
  ------------------
  401|       |
  402|  2.05M|    pu1_buf = (UWORD8 *)ps_jobq->pv_buf_wr;
  403|  2.05M|    if((UWORD8 *)ps_jobq->pv_buf_end >= (pu1_buf + job_size))
  ------------------
  |  Branch (403:8): [True: 2.05M, False: 0]
  ------------------
  404|  2.05M|    {
  405|  2.05M|        memcpy(ps_jobq->pv_buf_wr, pv_job, job_size);
  406|  2.05M|        ps_jobq->pv_buf_wr = (UWORD8 *)ps_jobq->pv_buf_wr + job_size;
  407|  2.05M|        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  408|  2.05M|    }
  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|  2.05M|    ps_jobq->i4_terminate = 0;
  419|       |
  420|  2.05M|    rettmp = ihevcd_jobq_unlock(ps_jobq);
  421|  2.05M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  2.05M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.05M]
  |  |  ------------------
  ------------------
  422|       |
  423|  2.05M|    return ret;
  424|  2.05M|}
ihevcd_jobq_dequeue:
  458|  2.18M|{
  459|  2.18M|    IHEVCD_ERROR_T ret;
  460|  2.18M|    IHEVCD_ERROR_T rettmp;
  461|  2.18M|    volatile UWORD8 *pu1_buf;
  462|       |
  463|  2.18M|    rettmp = ihevcd_jobq_lock(ps_jobq);
  464|  2.18M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  2.18M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.18M]
  |  |  ------------------
  ------------------
  465|  2.18M|    pu1_buf = (UWORD8 *)ps_jobq->pv_buf_rd;
  466|       |
  467|       |
  468|  2.18M|    if((UWORD8 *)ps_jobq->pv_buf_end >= (pu1_buf + job_size))
  ------------------
  |  Branch (468:8): [True: 2.20M, False: 18.4E]
  ------------------
  469|  2.20M|    {
  470|  5.27M|        while(1)
  ------------------
  |  Branch (470:15): [True: 5.27M, Folded]
  ------------------
  471|  5.27M|        {
  472|  5.27M|            pu1_buf = (UWORD8 *)ps_jobq->pv_buf_rd;
  473|  5.27M|            if((UWORD8 *)ps_jobq->pv_buf_wr >= (pu1_buf + job_size))
  ------------------
  |  Branch (473:16): [True: 2.05M, False: 3.21M]
  ------------------
  474|  2.05M|            {
  475|  2.05M|                memcpy(pv_job, ps_jobq->pv_buf_rd, job_size);
  476|  2.05M|                ps_jobq->pv_buf_rd = (UWORD8 *)ps_jobq->pv_buf_rd + job_size;
  477|  2.05M|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  478|  2.05M|                break;
  479|  2.05M|            }
  480|  3.21M|            else
  481|  3.21M|            {
  482|       |                /* If all the entries have been dequeued, then break and return */
  483|  3.21M|                if(1 == ps_jobq->i4_terminate)
  ------------------
  |  Branch (483:20): [True: 150k, False: 3.06M]
  ------------------
  484|   150k|                {
  485|   150k|                    ret = (IHEVCD_ERROR_T)IHEVCD_FAIL;
  486|   150k|                    break;
  487|   150k|                }
  488|       |
  489|  3.06M|                if(1 == blocking)
  ------------------
  |  Branch (489:20): [True: 3.06M, False: 0]
  ------------------
  490|  3.06M|                {
  491|  3.06M|                    ihevcd_jobq_yield(ps_jobq);
  492|       |
  493|  3.06M|                }
  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|  3.06M|            }
  501|  5.27M|        }
  502|  2.20M|    }
  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|  2.18M|    rettmp = ihevcd_jobq_unlock(ps_jobq);
  512|  2.18M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  2.18M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.18M]
  |  |  ------------------
  ------------------
  513|       |
  514|  2.18M|    return ret;
  515|  2.18M|}

ihevcd_compare_pu_t:
   95|   936k|{
   96|   936k|    WORD32 l0_match = 0, l1_match = 0;
   97|   936k|    pu_mv_t *ps_mv_1, *ps_mv_2;
   98|   936k|    WORD32 pred_mode_1, pred_mode_2;
   99|       |
  100|   936k|    ps_mv_1 = &ps_pu_1->mv;
  101|   936k|    ps_mv_2 = &ps_pu_2->mv;
  102|       |
  103|   936k|    pred_mode_1 = ps_pu_1->b2_pred_mode;
  104|   936k|    pred_mode_2 = ps_pu_2->b2_pred_mode;
  105|       |
  106|   936k|    if(pred_mode_1 == pred_mode_2)
  ------------------
  |  Branch (106:8): [True: 658k, False: 278k]
  ------------------
  107|   658k|    {
  108|   658k|        if(pred_mode_1 != PRED_L1)
  ------------------
  |  Branch (108:12): [True: 611k, False: 47.3k]
  ------------------
  109|   611k|        {
  110|   611k|            if(ps_mv_1->i1_l0_ref_idx == ps_mv_2->i1_l0_ref_idx)
  ------------------
  |  Branch (110:16): [True: 530k, False: 80.1k]
  ------------------
  111|   530k|            {
  112|   530k|                if(0 == memcmp(&ps_mv_1->s_l0_mv, &ps_mv_2->s_l0_mv, sizeof(mv_t)))
  ------------------
  |  Branch (112:20): [True: 398k, False: 132k]
  ------------------
  113|   398k|                {
  114|   398k|                    l0_match = 1;
  115|   398k|                }
  116|   530k|            }
  117|   611k|        }
  118|   658k|        if(pred_mode_1 != PRED_L0)
  ------------------
  |  Branch (118:12): [True: 399k, False: 258k]
  ------------------
  119|   399k|        {
  120|   399k|            if(ps_mv_1->i1_l1_ref_idx == ps_mv_2->i1_l1_ref_idx)
  ------------------
  |  Branch (120:16): [True: 355k, False: 44.3k]
  ------------------
  121|   355k|            {
  122|   355k|                if(0 == memcmp(&ps_mv_1->s_l1_mv, &ps_mv_2->s_l1_mv, sizeof(mv_t)))
  ------------------
  |  Branch (122:20): [True: 302k, False: 52.3k]
  ------------------
  123|   302k|                {
  124|   302k|                    l1_match = 1;
  125|   302k|                }
  126|   355k|            }
  127|   399k|        }
  128|   658k|        if(pred_mode_1 == PRED_BI)
  ------------------
  |  Branch (128:12): [True: 351k, False: 306k]
  ------------------
  129|   351k|            return (l1_match && l0_match);
  ------------------
  |  Branch (129:21): [True: 268k, False: 82.9k]
  |  Branch (129:33): [True: 239k, False: 29.4k]
  ------------------
  130|   306k|        else if(pred_mode_1 == PRED_L0)
  ------------------
  |  Branch (130:17): [True: 263k, False: 43.1k]
  ------------------
  131|   263k|            return l0_match;
  132|  43.1k|        else
  133|  43.1k|            return l1_match;
  134|   658k|    }
  135|       |
  136|   278k|    return 0;
  137|   936k|}
ihevcd_collocated_mvp:
  146|  5.35M|{
  147|  5.35M|    sps_t *ps_sps = ps_mv_ctxt->ps_sps;
  148|  5.35M|    slice_header_t *ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  149|  5.35M|    ref_list_t *ps_ref_list[2];
  150|  5.35M|    mv_buf_t *ps_mv_buf_col;
  151|  5.35M|    WORD32 xp_col, yp_col;
  152|  5.35M|    WORD32 col_ctb_x, col_ctb_y;
  153|  5.35M|    mv_t as_mv_col[2];
  154|  5.35M|    WORD32 log2_ctb_size;
  155|  5.35M|    WORD32 ctb_size;
  156|  5.35M|    WORD32 avail_col;
  157|  5.35M|    WORD32 col_ctb_idx, pu_cnt;
  158|  5.35M|    WORD32 au4_list_col[2];
  159|  5.35M|    WORD32 num_minpu_in_ctb;
  160|  5.35M|    UWORD8 *pu1_pic_pu_map_ctb;
  161|  5.35M|    pu_t *ps_col_pu;
  162|  5.35M|    WORD32 part_pos_y;
  163|       |
  164|       |
  165|  5.35M|    part_pos_y = ps_pu->b4_pos_y << 2;
  166|       |
  167|  5.35M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  168|  5.35M|    ctb_size = (1 << log2_ctb_size);
  169|       |
  170|  5.35M|    avail_col = 1;
  171|       |
  172|       |    /* Initializing reference list */
  173|  5.35M|    ps_ref_list[0] = ps_slice_hdr->as_ref_pic_list0;
  174|  5.35M|    ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list1;
  175|  5.35M|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (175:8): [True: 115k, False: 5.24M]
  ------------------
  176|   115k|        ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list0;
  177|       |
  178|  5.35M|    if((ps_slice_hdr->i1_slice_type == BSLICE) && (ps_slice_hdr->i1_collocated_from_l0_flag == 0))
  ------------------
  |  Branch (178:8): [True: 5.23M, False: 118k]
  |  Branch (178:51): [True: 881k, False: 4.35M]
  ------------------
  179|   881k|    {
  180|       |        /* L1 */
  181|   881k|        ps_mv_buf_col = (mv_buf_t *)ps_ref_list[1][ps_slice_hdr->i1_collocated_ref_idx].pv_mv_buf;
  182|       |
  183|   881k|    }
  184|  4.47M|    else
  185|  4.47M|    {
  186|       |        /* L0 */
  187|  4.47M|        ps_mv_buf_col = (mv_buf_t *)ps_ref_list[0][ps_slice_hdr->i1_collocated_ref_idx].pv_mv_buf;
  188|       |
  189|  4.47M|    }
  190|  5.35M|    num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.35M|#define MIN_PU_SIZE         4
  ------------------
                  num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.35M|#define MIN_PU_SIZE         4
  ------------------
  191|       |
  192|  5.35M|    if(((part_pos_y >> log2_ctb_size) == (y_col >> log2_ctb_size))
  ------------------
  |  Branch (192:8): [True: 4.20M, False: 1.15M]
  ------------------
  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: 43.4k]
  ------------------
  194|  4.16M|                    && (((y_col + (ps_mv_ctxt->i4_ctb_y << log2_ctb_size))
  ------------------
  |  Branch (194:24): [True: 4.12M, False: 36.5k]
  ------------------
  195|  4.16M|                                    < ps_sps->i2_pic_height_in_luma_samples)))
  196|  4.12M|    {
  197|  4.12M|        xp_col = ((x_col >> 4) << 4);
  198|  4.12M|        yp_col = ((y_col >> 4) << 4);
  199|  4.12M|        col_ctb_x = ps_mv_ctxt->i4_ctb_x + (xp_col >> log2_ctb_size);
  200|  4.12M|        col_ctb_y = ps_mv_ctxt->i4_ctb_y + (yp_col >> log2_ctb_size);
  201|  4.12M|        col_ctb_idx = col_ctb_x + (col_ctb_y)*(ps_sps->i2_pic_wd_in_ctb);
  202|  4.12M|        pu_cnt = ps_mv_buf_col->pu4_pic_pu_idx[col_ctb_idx];
  203|  4.12M|        pu1_pic_pu_map_ctb = ps_mv_buf_col->pu1_pic_pu_map
  204|  4.12M|                        + col_ctb_idx * num_minpu_in_ctb;
  205|  4.12M|        if(xp_col == ctb_size)
  ------------------
  |  Branch (205:12): [True: 830k, False: 3.29M]
  ------------------
  206|   830k|            xp_col = 0;
  207|  4.12M|        pu_cnt += pu1_pic_pu_map_ctb[(yp_col >> 2)
  208|  4.12M|                        * (ctb_size / MIN_PU_SIZE) + (xp_col >> 2)];
  ------------------
  |  |  367|  4.12M|#define MIN_PU_SIZE         4
  ------------------
  209|  4.12M|        ps_col_pu = &ps_mv_buf_col->ps_pic_pu[pu_cnt];
  210|  4.12M|    }
  211|  1.23M|    else
  212|  1.23M|        avail_col = 0;
  213|       |
  214|  5.35M|    if((avail_col == 0) || (ps_col_pu->b1_intra_flag == 1)
  ------------------
  |  Branch (214:8): [True: 1.22M, False: 4.12M]
  |  Branch (214:28): [True: 141k, False: 3.98M]
  ------------------
  215|  3.98M|                    || (ps_slice_hdr->i1_slice_temporal_mvp_enable_flag == 0))
  ------------------
  |  Branch (215:24): [True: 2.70M, False: 1.28M]
  ------------------
  216|  4.08M|    {
  217|  4.08M|        pu4_avail_col_flag[0] = 0;
  218|  4.08M|        pu4_avail_col_flag[1] = 0;
  219|  4.08M|        ps_mv_col[0].i2_mvx = 0;
  220|  4.08M|        ps_mv_col[0].i2_mvy = 0;
  221|  4.08M|        ps_mv_col[1].i2_mvx = 0;
  222|  4.08M|        ps_mv_col[1].i2_mvy = 0;
  223|  4.08M|    }
  224|  1.27M|    else
  225|  1.27M|    {
  226|  1.27M|        WORD32 au4_ref_idx_col[2];
  227|  1.27M|        WORD32 pred_flag_l0, pred_flag_l1;
  228|  1.27M|        pred_flag_l0 = (ps_col_pu->b2_pred_mode != PRED_L1);
  229|  1.27M|        pred_flag_l1 = (ps_col_pu->b2_pred_mode != PRED_L0);
  230|       |
  231|  1.27M|        if(pred_flag_l0 == 0)
  ------------------
  |  Branch (231:12): [True: 18.5k, False: 1.25M]
  ------------------
  232|  18.5k|        {
  233|  18.5k|            as_mv_col[0] = ps_col_pu->mv.s_l1_mv;
  234|  18.5k|            au4_ref_idx_col[0] = ps_col_pu->mv.i1_l1_ref_idx;
  235|  18.5k|            au4_list_col[0] = 1; /* L1 */
  236|       |
  237|  18.5k|            as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  238|  18.5k|            au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  239|  18.5k|            au4_list_col[1] = 1; /* L1 */
  240|  18.5k|        }
  241|  1.25M|        else
  242|  1.25M|        {
  243|  1.25M|            if(pred_flag_l1 == 0)
  ------------------
  |  Branch (243:16): [True: 271k, False: 983k]
  ------------------
  244|   271k|            {
  245|   271k|                as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  246|   271k|                au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  247|   271k|                au4_list_col[0] = 0; /* L1 */
  248|       |
  249|   271k|                as_mv_col[1] = ps_col_pu->mv.s_l0_mv;
  250|   271k|                au4_ref_idx_col[1] = ps_col_pu->mv.i1_l0_ref_idx;
  251|   271k|                au4_list_col[1] = 0; /* L1 */
  252|   271k|            }
  253|   983k|            else
  254|   983k|            {
  255|   983k|                if(1 == ps_slice_hdr->i1_low_delay_flag)
  ------------------
  |  Branch (255:20): [True: 582k, False: 401k]
  ------------------
  256|   582k|                {
  257|   582k|                    as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  258|   582k|                    au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  259|   582k|                    au4_list_col[0] = 0; /* L0 */
  260|       |
  261|   582k|                    as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  262|   582k|                    au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  263|   582k|                    au4_list_col[1] = 1; /* L1 */
  264|   582k|                }
  265|   401k|                else
  266|   401k|                {
  267|   401k|                    if(0 == ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (267:24): [True: 49.2k, False: 352k]
  ------------------
  268|  49.2k|                    {
  269|  49.2k|                        as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  270|  49.2k|                        au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  271|       |
  272|  49.2k|                        as_mv_col[1] = ps_col_pu->mv.s_l0_mv;
  273|  49.2k|                        au4_ref_idx_col[1] = ps_col_pu->mv.i1_l0_ref_idx;
  274|  49.2k|                    }
  275|   352k|                    else
  276|   352k|                    {
  277|   352k|                        as_mv_col[0] = ps_col_pu->mv.s_l1_mv;
  278|   352k|                        au4_ref_idx_col[0] = ps_col_pu->mv.i1_l1_ref_idx;
  279|       |
  280|   352k|                        as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  281|   352k|                        au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  282|   352k|                    }
  283|       |
  284|   401k|                    au4_list_col[0] = ps_slice_hdr->i1_collocated_from_l0_flag; /* L"collocated_from_l0_flag" */
  285|   401k|                    au4_list_col[1] = ps_slice_hdr->i1_collocated_from_l0_flag; /* L"collocated_from_l0_flag" */
  286|   401k|                }
  287|   983k|            }
  288|  1.25M|        }
  289|  1.27M|        avail_col = 1;
  290|  1.27M|        {
  291|  1.27M|            WORD32 cur_poc, col_poc, col_ref_poc_l0, cur_ref_poc;
  292|  1.27M|            WORD32 col_ref_poc_l0_lt, cur_ref_poc_lt;
  293|  1.27M|            WORD32 ref_idx_l0, ref_idx_l1;
  294|  1.27M|            WORD32 slice_idx;
  295|  1.27M|            pic_buf_t *ps_pic_buf;
  296|       |
  297|  1.27M|            if(use_pu_ref_idx)
  ------------------
  |  Branch (297:16): [True: 149k, False: 1.12M]
  ------------------
  298|   149k|            {
  299|   149k|                ref_idx_l0 = ps_pu->mv.i1_l0_ref_idx;
  300|   149k|                ref_idx_l1 = ps_pu->mv.i1_l1_ref_idx;
  301|   149k|            }
  302|  1.12M|            else
  303|  1.12M|            {
  304|  1.12M|                ref_idx_l0 = 0;
  305|  1.12M|                ref_idx_l1 = 0;
  306|  1.12M|            }
  307|       |
  308|  1.27M|            col_poc = ps_mv_buf_col->i4_abs_poc;
  309|  1.27M|            cur_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
  310|       |
  311|  1.27M|            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.27M|            slice_idx &= (MAX_SLICE_HDR_CNT - 1);
  ------------------
  |  |  153|  1.27M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  1.27M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  313|  1.27M|            if(au4_list_col[0] == 0)
  ------------------
  |  Branch (313:16): [True: 899k, False: 374k]
  ------------------
  314|   899k|            {
  315|   899k|                col_ref_poc_l0 =
  316|   899k|                                ps_mv_buf_col->ai4_l0_collocated_poc[slice_idx][au4_ref_idx_col[0]];
  317|   899k|                col_ref_poc_l0_lt =
  318|   899k|                                (ps_mv_buf_col->ai1_l0_collocated_poc_lt[slice_idx][au4_ref_idx_col[0]] == LONG_TERM_REF);
  319|   899k|            }
  320|   374k|            else
  321|   374k|            {
  322|   374k|                col_ref_poc_l0 =
  323|   374k|                                ps_mv_buf_col->ai4_l1_collocated_poc[slice_idx][au4_ref_idx_col[0]];
  324|   374k|                col_ref_poc_l0_lt =
  325|   374k|                                (ps_mv_buf_col->ai1_l1_collocated_poc_lt[slice_idx][au4_ref_idx_col[0]] == LONG_TERM_REF);
  326|   374k|            }
  327|       |            /* L0 collocated mv */
  328|  1.27M|            ps_pic_buf = (pic_buf_t *)((ps_ref_list[0][ref_idx_l0].pv_pic_buf));
  329|  1.27M|            cur_ref_poc = ps_pic_buf->i4_abs_poc;
  330|  1.27M|            cur_ref_poc_lt = (ps_pic_buf->u1_used_as_ref == LONG_TERM_REF);
  331|       |
  332|  1.27M|            if(cur_ref_poc_lt == col_ref_poc_l0_lt)
  ------------------
  |  Branch (332:16): [True: 1.24M, False: 27.0k]
  ------------------
  333|  1.24M|            {
  334|  1.24M|                pu4_avail_col_flag[0] = 1;
  335|       |
  336|  1.24M|                if(cur_ref_poc_lt || ((col_poc - col_ref_poc_l0) == (cur_poc - cur_ref_poc)))
  ------------------
  |  Branch (336:20): [True: 1.42k, False: 1.24M]
  |  Branch (336:38): [True: 316k, False: 929k]
  ------------------
  337|   317k|                {
  338|   317k|                    ps_mv_col[0] = as_mv_col[0];
  339|   317k|                }
  340|   929k|                else
  341|   929k|                {
  342|   929k|                    ps_mv_col[0] = as_mv_col[0];
  343|   929k|                    if(col_ref_poc_l0 != col_poc)
  ------------------
  |  Branch (343:24): [True: 492k, False: 437k]
  ------------------
  344|   492k|                        ihevcd_scale_collocated_mv((mv_t *)(&ps_mv_col[0]), cur_ref_poc,
  345|   492k|                                                   col_ref_poc_l0, col_poc, cur_poc);
  346|   929k|                }
  347|  1.24M|            }
  348|  27.0k|            else
  349|  27.0k|            {
  350|  27.0k|                pu4_avail_col_flag[0] = 0;
  351|  27.0k|                ps_mv_col[0].i2_mvx = 0;
  352|  27.0k|                ps_mv_col[0].i2_mvy = 0;
  353|  27.0k|            }
  354|  1.27M|            if((BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (354:16): [True: 1.26M, False: 13.2k]
  ------------------
  355|  1.26M|            {
  356|  1.26M|                WORD32 col_ref_poc_l1_lt, col_ref_poc_l1;
  357|       |
  358|  1.26M|                if(au4_list_col[1] == 0)
  ------------------
  |  Branch (358:20): [True: 302k, False: 958k]
  ------------------
  359|   302k|                {
  360|   302k|                    col_ref_poc_l1 =
  361|   302k|                                    ps_mv_buf_col->ai4_l0_collocated_poc[slice_idx][au4_ref_idx_col[1]];
  362|   302k|                    col_ref_poc_l1_lt =
  363|   302k|                                    (ps_mv_buf_col->ai1_l0_collocated_poc_lt[slice_idx][au4_ref_idx_col[1]] == LONG_TERM_REF);
  364|   302k|                }
  365|   958k|                else
  366|   958k|                {
  367|   958k|                    col_ref_poc_l1 =
  368|   958k|                                    ps_mv_buf_col->ai4_l1_collocated_poc[slice_idx][au4_ref_idx_col[1]];
  369|   958k|                    col_ref_poc_l1_lt =
  370|   958k|                                    (ps_mv_buf_col->ai1_l1_collocated_poc_lt[slice_idx][au4_ref_idx_col[1]] == LONG_TERM_REF);
  371|   958k|                }
  372|       |
  373|       |                /* L1 collocated mv */
  374|  1.26M|                ps_pic_buf = (pic_buf_t *)((ps_ref_list[1][ref_idx_l1].pv_pic_buf));
  375|  1.26M|                cur_ref_poc = ps_pic_buf->i4_abs_poc;
  376|  1.26M|                cur_ref_poc_lt = (ps_pic_buf->u1_used_as_ref == LONG_TERM_REF);
  377|       |
  378|  1.26M|                if(cur_ref_poc_lt == col_ref_poc_l1_lt)
  ------------------
  |  Branch (378:20): [True: 1.24M, False: 19.2k]
  ------------------
  379|  1.24M|                {
  380|  1.24M|                    pu4_avail_col_flag[1] = 1;
  381|       |
  382|  1.24M|                    if(cur_ref_poc_lt || ((col_poc - col_ref_poc_l1) == (cur_poc - cur_ref_poc)))
  ------------------
  |  Branch (382:24): [True: 2.47k, False: 1.23M]
  |  Branch (382:42): [True: 366k, False: 872k]
  ------------------
  383|   368k|                    {
  384|   368k|                        ps_mv_col[1] = as_mv_col[1];
  385|   368k|                    }
  386|   872k|                    else
  387|   872k|                    {
  388|   872k|                        ps_mv_col[1] = as_mv_col[1];
  389|   872k|                        if(col_ref_poc_l1 != col_poc)
  ------------------
  |  Branch (389:28): [True: 494k, False: 378k]
  ------------------
  390|   494k|                            ihevcd_scale_collocated_mv((mv_t *)&ps_mv_col[1], cur_ref_poc,
  391|   494k|                                                       col_ref_poc_l1, col_poc, cur_poc);
  392|   872k|                    }
  393|  1.24M|                }
  394|  19.2k|                else
  395|  19.2k|                {
  396|  19.2k|                    pu4_avail_col_flag[1] = 0;
  397|  19.2k|                    ps_mv_col[1].i2_mvx = 0;
  398|  19.2k|                    ps_mv_col[1].i2_mvy = 0;
  399|  19.2k|                }
  400|  1.26M|            }
  401|  13.2k|            else
  402|  13.2k|            {
  403|  13.2k|                pu4_avail_col_flag[1] = 0;
  404|  13.2k|            }
  405|  1.27M|        }
  406|  1.27M|    }
  407|  5.35M|}
ihevcd_mv_merge:
  479|  71.4M|{
  480|       |    /******************************************************/
  481|       |    /*      Spatial Merge Candidates                      */
  482|       |    /******************************************************/
  483|  71.4M|    slice_header_t *ps_slice_hdr;
  484|  71.4M|    pu_t as_pu_merge_list[MAX_NUM_MERGE_CAND];
  485|  71.4M|    pps_t *ps_pps;
  486|  71.4M|    ref_list_t *ps_ref_list[2];
  487|  71.4M|    WORD32 sum_avail_a0_a1_b0_b1 = 0; /*Sum of availability of A0, A1, B0, B1*/
  488|  71.4M|    WORD32 nbr_x, nbr_y;
  489|  71.4M|    WORD32 nbr_avail[MAX_NUM_MV_NBR];
  490|  71.4M|    WORD32 merge_shift;
  491|  71.4M|    WORD32 nbr_pu_idx;
  492|  71.4M|    pu_t *ps_nbr_pu[MAX_NUM_MV_NBR];
  493|  71.4M|    WORD32 max_num_merge_cand;
  494|  71.4M|    WORD32 candidate_cnt;
  495|  71.4M|    WORD32 pos_x_merge_shift, pos_y_merge_shift;
  496|       |
  497|  71.4M|    ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  498|  71.4M|    ps_pps = ps_mv_ctxt->ps_pps;
  499|       |    /* Initializing reference list */
  500|  71.4M|    ps_ref_list[0] = ps_slice_hdr->as_ref_pic_list0;
  501|  71.4M|    ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list1;
  502|  71.4M|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (502:8): [True: 441k, False: 71.0M]
  ------------------
  503|   441k|        ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list0;
  504|       |
  505|  71.4M|    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.4M|    merge_shift = ps_pps->i1_log2_parallel_merge_level;
  522|       |
  523|       |    /* Availability check */
  524|       |    /* A1 */
  525|  71.4M|    nbr_x = part_pos_x - 1;
  526|  71.4M|    nbr_y = part_pos_y + part_ht - 1; /* A1 */
  527|       |
  528|  71.4M|    nbr_pu_idx = *(pu4_left_pu_idx + ((nbr_y - part_pos_y) >> 2) * left_nbr_4x4_strd);
  529|  71.4M|    ps_nbr_pu[NBR_A1] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  530|       |
  531|  71.4M|    nbr_avail[NBR_A1] = l_avail
  ------------------
  |  Branch (531:25): [True: 70.2M, False: 1.18M]
  ------------------
  532|  70.2M|                    && (!ps_nbr_pu[NBR_A1]->b1_intra_flag); /* A1 */
  ------------------
  |  Branch (532:24): [True: 70.3M, False: 18.4E]
  ------------------
  533|       |
  534|  71.4M|    pos_x_merge_shift = (part_pos_x >> merge_shift);
  535|  71.4M|    pos_y_merge_shift = (part_pos_y >> merge_shift);
  536|  71.4M|    max_num_merge_cand = ps_pu->b3_merge_idx + 1;
  537|       |
  538|  71.4M|    {
  539|  71.4M|        if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (539:12): [True: 70.3M, False: 1.11M]
  ------------------
  540|  70.3M|        {
  541|       |            /* if at same merge level */
  542|  70.3M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (542:16): [True: 6.54M, False: 63.8M]
  ------------------
  543|  6.54M|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (543:16): [True: 6.56M, False: 18.4E]
  ------------------
  544|  6.56M|            {
  545|  6.56M|                nbr_avail[NBR_A1] = 0;
  546|  6.56M|            }
  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|  64.3M|            else if((single_mcl_flag == 0) && (part_idx == 1) &&
  ------------------
  |  Branch (554:21): [True: 64.3M, False: 18.4E]
  |  Branch (554:47): [True: 181k, False: 64.1M]
  ------------------
  555|   181k|                            ((part_mode == PART_Nx2N) || (part_mode == PART_nLx2N) ||
  ------------------
  |  Branch (555:30): [True: 86.0k, False: 95.7k]
  |  Branch (555:58): [True: 12.2k, False: 83.4k]
  ------------------
  556|  83.4k|                                            (part_mode == PART_nRx2N)))
  ------------------
  |  Branch (556:45): [True: 5.92k, False: 77.5k]
  ------------------
  557|   104k|            {
  558|   104k|                nbr_avail[NBR_A1] = 0;
  559|   104k|            }
  560|  70.3M|            sum_avail_a0_a1_b0_b1 += nbr_avail[NBR_A1];
  561|  70.3M|            if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (561:16): [True: 64.2M, False: 6.08M]
  ------------------
  562|  64.2M|            {
  563|  64.2M|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_A1];
  564|  64.2M|                candidate_cnt++;
  565|  64.2M|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (565:20): [True: 63.9M, False: 320k]
  ------------------
  566|  63.9M|                {
  567|  63.9M|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  568|  63.9M|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  569|  63.9M|                    return;
  570|  63.9M|                }
  571|  64.2M|            }
  572|  70.3M|        }
  573|  71.4M|    }
  574|       |
  575|       |    /* B1 */
  576|  7.51M|    nbr_x = part_pos_x + part_wd - 1;
  577|  7.51M|    nbr_y = part_pos_y - 1;
  578|       |
  579|  7.51M|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  580|  7.51M|    ps_nbr_pu[NBR_B1] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  581|       |
  582|  7.51M|    nbr_avail[NBR_B1] = t_avail
  ------------------
  |  Branch (582:25): [True: 8.51M, False: 18.4E]
  ------------------
  583|  8.51M|                    && (!ps_nbr_pu[NBR_B1]->b1_intra_flag); /* B1 */
  ------------------
  |  Branch (583:24): [True: 8.50M, False: 5.31k]
  ------------------
  584|       |
  585|  7.51M|    {
  586|  7.51M|        WORD32 avail_flag;
  587|  7.51M|        avail_flag = nbr_avail[NBR_B1];
  588|       |
  589|  7.51M|        if(nbr_avail[NBR_B1])
  ------------------
  |  Branch (589:12): [True: 8.52M, False: 18.4E]
  ------------------
  590|  8.52M|        {
  591|       |            /* if at same merge level */
  592|  8.52M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (592:16): [True: 7.03M, False: 1.48M]
  ------------------
  593|  7.03M|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (593:16): [True: 3.88M, False: 3.15M]
  ------------------
  594|  3.88M|            {
  595|  3.88M|                nbr_avail[NBR_B1] = 0;
  596|  3.88M|                avail_flag = 0;
  597|  3.88M|            }
  598|       |
  599|       |            /* if single MCL is 0 , second part of 2 part in CU */
  600|  4.73M|            else if((single_mcl_flag == 0) && (part_idx == 1) &&
  ------------------
  |  Branch (600:21): [True: 4.73M, False: 18.4E]
  |  Branch (600:47): [True: 128k, False: 4.60M]
  ------------------
  601|   128k|                            ((part_mode == PART_2NxN) || (part_mode == PART_2NxnU) ||
  ------------------
  |  Branch (601:30): [True: 31.2k, False: 96.8k]
  |  Branch (601:58): [True: 2.73k, False: 94.1k]
  ------------------
  602|  94.1k|                                            (part_mode == PART_2NxnD)))
  ------------------
  |  Branch (602:45): [True: 2.85k, False: 91.3k]
  ------------------
  603|  37.0k|            {
  604|  37.0k|                nbr_avail[NBR_B1] = 0;
  605|  37.0k|                avail_flag = 0;
  606|  37.0k|            }
  607|       |
  608|  4.60M|            else if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (608:21): [True: 359k, False: 4.24M]
  ------------------
  609|   359k|            {
  610|   359k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_B1]);
  611|   359k|            }
  612|       |
  613|  8.52M|            sum_avail_a0_a1_b0_b1 += avail_flag;
  614|  8.52M|            if(avail_flag)
  ------------------
  |  Branch (614:16): [True: 4.59M, False: 3.93M]
  ------------------
  615|  4.59M|            {
  616|  4.59M|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B1];
  617|  4.59M|                candidate_cnt++;
  618|  4.59M|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (618:20): [True: 4.43M, False: 159k]
  ------------------
  619|  4.43M|                {
  620|  4.43M|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  621|  4.43M|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  622|  4.43M|                    return;
  623|  4.43M|                }
  624|  4.59M|            }
  625|  8.52M|        }
  626|  7.51M|    }
  627|       |    /* B0 */
  628|  3.08M|    nbr_x = part_pos_x + part_wd;
  629|  3.08M|    nbr_y = part_pos_y - 1;
  630|       |
  631|  3.08M|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  632|  3.08M|    ps_nbr_pu[NBR_B0] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  633|       |
  634|  3.08M|    nbr_avail[NBR_B0] = tr_avail
  ------------------
  |  Branch (634:25): [True: 2.58M, False: 503k]
  ------------------
  635|  2.58M|                    && (!ps_nbr_pu[NBR_B0]->b1_intra_flag); /* B0 */
  ------------------
  |  Branch (635:24): [True: 2.57M, False: 7.72k]
  ------------------
  636|       |
  637|  3.08M|    {
  638|  3.08M|        WORD32 avail_flag;
  639|  3.08M|        avail_flag = nbr_avail[NBR_B0];
  640|       |
  641|       |        /* if at same merge level */
  642|  3.08M|        if(nbr_avail[NBR_B0])
  ------------------
  |  Branch (642:12): [True: 2.57M, False: 511k]
  ------------------
  643|  2.57M|        {
  644|  2.57M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (644:16): [True: 914k, False: 1.66M]
  ------------------
  645|   914k|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (645:16): [True: 910k, False: 3.80k]
  ------------------
  646|   910k|            {
  647|   910k|                nbr_avail[NBR_B0] = 0;
  648|   910k|                avail_flag = 0;
  649|   910k|            }
  650|  1.66M|            else if(nbr_avail[NBR_B1])
  ------------------
  |  Branch (650:21): [True: 189k, False: 1.47M]
  ------------------
  651|   189k|            {
  652|   189k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_B1], ps_nbr_pu[NBR_B0]);
  653|   189k|            }
  654|       |
  655|  2.57M|            sum_avail_a0_a1_b0_b1 += avail_flag;
  656|  2.57M|            if(avail_flag)
  ------------------
  |  Branch (656:16): [True: 1.58M, False: 992k]
  ------------------
  657|  1.58M|            {
  658|  1.58M|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B0];
  659|  1.58M|                candidate_cnt++;
  660|  1.58M|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (660:20): [True: 1.53M, False: 42.4k]
  ------------------
  661|  1.53M|                {
  662|  1.53M|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  663|  1.53M|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  664|  1.53M|                    return;
  665|  1.53M|                }
  666|  1.58M|            }
  667|  2.57M|        }
  668|  3.08M|    }
  669|       |    /* A0 */
  670|  1.54M|    nbr_x = part_pos_x - 1;
  671|  1.54M|    nbr_y = part_pos_y + part_ht; /* A0 */
  672|       |
  673|  1.54M|    nbr_pu_idx = *(pu4_left_pu_idx + ((nbr_y - part_pos_y) >> 2) * left_nbr_4x4_strd);
  674|  1.54M|    ps_nbr_pu[NBR_A0] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  675|       |
  676|  1.54M|    nbr_avail[NBR_A0] = lb_avail
  ------------------
  |  Branch (676:25): [True: 89.5k, False: 1.45M]
  ------------------
  677|  89.5k|                    && (!ps_nbr_pu[NBR_A0]->b1_intra_flag); /* A0 */
  ------------------
  |  Branch (677:24): [True: 85.6k, False: 3.82k]
  ------------------
  678|  1.54M|    {
  679|  1.54M|        WORD32 avail_flag;
  680|  1.54M|        avail_flag = nbr_avail[NBR_A0];
  681|       |
  682|  1.54M|        if(nbr_avail[NBR_A0])
  ------------------
  |  Branch (682:12): [True: 85.6k, False: 1.46M]
  ------------------
  683|  85.6k|        {
  684|       |            /* if at same merge level */
  685|  85.6k|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (685:16): [True: 517, False: 85.1k]
  ------------------
  686|    517|                            (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (686:29): [True: 517, False: 0]
  ------------------
  687|    517|            {
  688|    517|                nbr_avail[NBR_A0] = 0;
  689|    517|                avail_flag = 0;
  690|    517|            }
  691|  85.1k|            else if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (691:21): [True: 83.4k, False: 1.68k]
  ------------------
  692|  83.4k|            {
  693|  83.4k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_A0]);
  694|  83.4k|            }
  695|       |
  696|  85.6k|            sum_avail_a0_a1_b0_b1 += avail_flag;
  697|  85.6k|            if(avail_flag)
  ------------------
  |  Branch (697:16): [True: 34.1k, False: 51.5k]
  ------------------
  698|  34.1k|            {
  699|  34.1k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_A0];
  700|  34.1k|                candidate_cnt++;
  701|  34.1k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (701:20): [True: 19.2k, False: 14.8k]
  ------------------
  702|  19.2k|                {
  703|  19.2k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  704|  19.2k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  705|  19.2k|                    return;
  706|  19.2k|                }
  707|  34.1k|            }
  708|  85.6k|        }
  709|  1.54M|    }
  710|       |    /* B2 */
  711|       |
  712|  1.52M|    nbr_x = part_pos_x - 1;
  713|  1.52M|    nbr_y = part_pos_y - 1; /* B2 */
  714|       |
  715|  1.52M|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  716|  1.52M|    ps_nbr_pu[NBR_B2] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  717|       |
  718|  1.52M|    nbr_avail[NBR_B2] = tl_avail
  ------------------
  |  Branch (718:25): [True: 2.41M, False: 18.4E]
  ------------------
  719|  2.41M|                    && (!ps_nbr_pu[NBR_B2]->b1_intra_flag); /* B2 */
  ------------------
  |  Branch (719:24): [True: 2.40M, False: 9.23k]
  ------------------
  720|       |
  721|  1.52M|    {
  722|  1.52M|        WORD32 avail_flag;
  723|  1.52M|        avail_flag = nbr_avail[NBR_B2];
  724|       |
  725|  1.52M|        if(nbr_avail[NBR_B2])
  ------------------
  |  Branch (725:12): [True: 2.40M, False: 18.4E]
  ------------------
  726|  2.40M|        {
  727|       |            /* if at same merge level */
  728|  2.40M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (728:16): [True: 2.17M, False: 234k]
  ------------------
  729|  2.17M|                            (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (729:29): [True: 2.17M, False: 3.15k]
  ------------------
  730|  2.17M|            {
  731|  2.17M|                nbr_avail[NBR_B2] = 0;
  732|  2.17M|                avail_flag = 0;
  733|  2.17M|            }
  734|   238k|            else if(4 == sum_avail_a0_a1_b0_b1)
  ------------------
  |  Branch (734:21): [True: 2.13k, False: 236k]
  ------------------
  735|  2.13k|            {
  736|  2.13k|                avail_flag = 0;
  737|  2.13k|            }
  738|       |
  739|   236k|            else
  740|   236k|            {
  741|   236k|                if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (741:20): [True: 203k, False: 32.3k]
  ------------------
  742|   203k|                {
  743|   203k|                    avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_B2]);
  744|   203k|                }
  745|       |
  746|   236k|                if(avail_flag && nbr_avail[NBR_B1])
  ------------------
  |  Branch (746:20): [True: 127k, False: 108k]
  |  Branch (746:34): [True: 113k, False: 14.0k]
  ------------------
  747|   113k|                {
  748|   113k|                    avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_B1], ps_nbr_pu[NBR_B2]);
  749|   113k|                }
  750|   236k|            }
  751|       |
  752|  2.40M|            if(avail_flag)
  ------------------
  |  Branch (752:16): [True: 81.1k, False: 2.32M]
  ------------------
  753|  81.1k|            {
  754|  81.1k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B2];
  755|  81.1k|                candidate_cnt++;
  756|  81.1k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (756:20): [True: 46.8k, False: 34.3k]
  ------------------
  757|  46.8k|                {
  758|  46.8k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  759|  46.8k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  760|  46.8k|                    return;
  761|  46.8k|                }
  762|  81.1k|            }
  763|  2.40M|        }
  764|  1.52M|    }
  765|       |
  766|       |    /***********************************************************/
  767|       |    /*          Collocated MV prediction                       */
  768|       |    /***********************************************************/
  769|  1.48M|    {
  770|  1.48M|        mv_t as_mv_col[2];
  771|  1.48M|        WORD32 avail_col_flag[2] = { 0 }, x_col, y_col;
  772|  1.48M|        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.48M|        x_col = part_pos_x + part_wd;
  777|  1.48M|        y_col = part_pos_y + part_ht;
  778|  1.48M|        ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 0, x_col, y_col);
  779|       |
  780|  1.48M|        avail_col_l0 = avail_col_flag[0];
  781|  1.48M|        avail_col_l1 = avail_col_flag[1];
  782|       |
  783|  2.24M|        if(avail_col_l0 || avail_col_l1)
  ------------------
  |  Branch (783:12): [True: 18.4E, False: 2.24M]
  |  Branch (783:28): [True: 705, False: 2.24M]
  ------------------
  784|   595k|        {
  785|   595k|            as_pu_merge_list[candidate_cnt].mv.s_l0_mv = as_mv_col[0];
  786|   595k|            as_pu_merge_list[candidate_cnt].mv.s_l1_mv = as_mv_col[1];
  787|   595k|        }
  788|       |
  789|  1.48M|        if(avail_col_l0 == 0 || avail_col_l1 == 0)
  ------------------
  |  Branch (789:12): [True: 874k, False: 605k]
  |  Branch (789:33): [True: 3.13k, False: 602k]
  ------------------
  790|  2.24M|        {
  791|       |            /* Checking Collocated MV availability at Center of PU */
  792|  2.24M|            x_col = part_pos_x + (part_wd >> 1);
  793|  2.24M|            y_col = part_pos_y + (part_ht >> 1);
  794|  2.24M|            ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 0, x_col, y_col);
  795|       |
  796|  2.24M|            if(avail_col_l0 == 0)
  ------------------
  |  Branch (796:16): [True: 2.23M, False: 13.3k]
  ------------------
  797|  2.23M|            {
  798|  2.23M|                as_pu_merge_list[candidate_cnt].mv.s_l0_mv = as_mv_col[0];
  799|  2.23M|            }
  800|  2.24M|            if(avail_col_l1 == 0)
  ------------------
  |  Branch (800:16): [True: 2.24M, False: 9.68k]
  ------------------
  801|  2.24M|            {
  802|  2.24M|                as_pu_merge_list[candidate_cnt].mv.s_l1_mv = as_mv_col[1];
  803|  2.24M|            }
  804|       |
  805|  2.24M|            avail_col_l0 |= avail_col_flag[0];
  806|  2.24M|            avail_col_l1 |= avail_col_flag[1];
  807|  2.24M|        }
  808|       |
  809|  1.48M|        as_pu_merge_list[candidate_cnt].mv.i1_l0_ref_idx = 0;
  810|  1.48M|        as_pu_merge_list[candidate_cnt].mv.i1_l1_ref_idx = 0;
  811|  1.48M|        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.11M, False: 369k]
  |  Branch (811:72): [True: 1.10M, False: 5.43k]
  ------------------
  812|       |
  813|  1.73M|        candidate_cnt += (avail_col_l0 || avail_col_l1);
  ------------------
  |  Branch (813:27): [True: 18.4E, False: 1.73M]
  |  Branch (813:43): [True: 2.90k, False: 1.72M]
  ------------------
  814|       |
  815|  1.48M|        if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (815:12): [True: 1.04M, False: 434k]
  ------------------
  816|  1.04M|        {
  817|  1.04M|            ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  818|  1.04M|            ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  819|  1.04M|            return;
  820|  1.04M|        }
  821|       |
  822|  1.48M|    }
  823|   434k|    {
  824|   434k|        WORD32 slice_type;
  825|       |
  826|   434k|        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|   434k|        if(slice_type == BSLICE)
  ------------------
  |  Branch (832:12): [True: 1.74M, False: 18.4E]
  ------------------
  833|  1.74M|        {
  834|  1.74M|            if((candidate_cnt > 1) && (candidate_cnt < MAX_NUM_MERGE_CAND))
  ------------------
  |  |  455|  94.9k|#define MAX_NUM_MERGE_CAND 5
  ------------------
  |  Branch (834:16): [True: 94.9k, False: 1.65M]
  |  Branch (834:39): [True: 94.9k, False: 18.4E]
  ------------------
  835|  94.8k|            {
  836|  94.8k|                WORD32 priority_list0[12] =
  837|  94.8k|                    { 0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3 };
  838|  94.8k|                WORD32 priority_list1[12] =
  839|  94.8k|                    { 1, 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2 };
  840|  94.8k|                WORD32 l0_cand, l1_cand;
  841|  94.8k|                WORD32 bi_pred_idx = 0;
  842|  94.8k|                WORD32 total_bi_pred_cand =
  843|  94.8k|                                candidate_cnt * (candidate_cnt - 1);
  844|       |
  845|   228k|                while(bi_pred_idx < total_bi_pred_cand)
  ------------------
  |  Branch (845:23): [True: 228k, False: 18.4E]
  ------------------
  846|   228k|                {
  847|   228k|                    l0_cand = priority_list0[bi_pred_idx];
  848|   228k|                    l1_cand = priority_list1[bi_pred_idx];
  849|       |
  850|   228k|                    if((as_pu_merge_list[l0_cand].b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (850:24): [True: 214k, False: 14.1k]
  ------------------
  851|   214k|                                    && (as_pu_merge_list[l1_cand].b2_pred_mode
  ------------------
  |  Branch (851:40): [True: 136k, False: 78.1k]
  ------------------
  852|   214k|                                                    != PRED_L0))
  853|   136k|                    {
  854|   136k|                        WORD8 i1_l0_ref_idx, i1_l1_ref_idx;
  855|   136k|                        mv_t s_l0_mv, s_l1_mv;
  856|   136k|                        pic_buf_t *ps_pic_buf_l0, *ps_pic_buf_l1;
  857|       |
  858|   136k|                        i1_l0_ref_idx = as_pu_merge_list[l0_cand].mv.i1_l0_ref_idx;
  859|   136k|                        i1_l1_ref_idx = as_pu_merge_list[l1_cand].mv.i1_l1_ref_idx;
  860|   136k|                        ps_pic_buf_l0 = (pic_buf_t *)((ps_ref_list[0][i1_l0_ref_idx].pv_pic_buf));
  861|   136k|                        ps_pic_buf_l1 = (pic_buf_t *)((ps_ref_list[1][i1_l1_ref_idx].pv_pic_buf));
  862|   136k|                        s_l0_mv = as_pu_merge_list[l0_cand].mv.s_l0_mv;
  863|   136k|                        s_l1_mv = as_pu_merge_list[l1_cand].mv.s_l1_mv;
  864|       |
  865|   136k|                        if((ps_pic_buf_l0->i4_abs_poc != ps_pic_buf_l1->i4_abs_poc)
  ------------------
  |  Branch (865:28): [True: 34.0k, False: 102k]
  ------------------
  866|   102k|                                        || (s_l0_mv.i2_mvx != s_l1_mv.i2_mvx)
  ------------------
  |  Branch (866:44): [True: 40.8k, False: 61.7k]
  ------------------
  867|  61.7k|                                        || (s_l0_mv.i2_mvy != s_l1_mv.i2_mvy))
  ------------------
  |  Branch (867:44): [True: 10.6k, False: 51.1k]
  ------------------
  868|  85.7k|                        {
  869|  85.7k|                            candidate_cnt++;
  870|  85.7k|                            if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (870:32): [True: 54.5k, False: 31.2k]
  ------------------
  871|  54.5k|                            {
  872|  54.5k|                                ps_pu[0].mv.s_l0_mv = s_l0_mv;
  873|  54.5k|                                ps_pu[0].mv.s_l1_mv = s_l1_mv;
  874|  54.5k|                                ps_pu[0].mv.i1_l0_ref_idx = i1_l0_ref_idx;
  875|  54.5k|                                ps_pu[0].mv.i1_l1_ref_idx = i1_l1_ref_idx;
  876|  54.5k|                                ps_pu[0].b2_pred_mode = PRED_BI;
  877|  54.5k|                                return;
  878|  54.5k|                            }
  879|  85.7k|                        }
  880|   136k|                    }
  881|       |
  882|   174k|                    bi_pred_idx++;
  883|       |
  884|   174k|                    if((bi_pred_idx == total_bi_pred_cand)
  ------------------
  |  Branch (884:24): [True: 40.0k, False: 134k]
  ------------------
  885|   134k|                                    || (candidate_cnt == MAX_NUM_MERGE_CAND))
  ------------------
  |  |  455|   134k|#define MAX_NUM_MERGE_CAND 5
  ------------------
  |  Branch (885:40): [True: 18.4E, False: 134k]
  ------------------
  886|  40.6k|                    {
  887|  40.6k|                        break;
  888|  40.6k|                    }
  889|   174k|                }
  890|  94.8k|            }
  891|  1.74M|        }
  892|       |
  893|       |        /******************************************************/
  894|       |        /*      Zero merge candidates                         */
  895|       |        /******************************************************/
  896|       |//        if(candidate_cnt < max_num_merge_cand)
  897|   380k|        {
  898|   380k|            WORD32 num_ref_idx;
  899|   380k|            WORD32 zero_idx;
  900|       |
  901|   380k|            zero_idx = max_num_merge_cand - candidate_cnt - 1;
  902|       |
  903|   380k|            if(slice_type == PSLICE)
  ------------------
  |  Branch (903:16): [True: 52.0k, False: 328k]
  ------------------
  904|  52.0k|                num_ref_idx = ps_slice_hdr->i1_num_ref_idx_l0_active;
  905|   328k|            else
  906|       |                /* Slice type B */
  907|   328k|                num_ref_idx = MIN(ps_slice_hdr->i1_num_ref_idx_l0_active, ps_slice_hdr->i1_num_ref_idx_l1_active);
  ------------------
  |  |   43|   328k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 109k, False: 219k]
  |  |  ------------------
  ------------------
  908|       |
  909|   380k|            if(zero_idx >= num_ref_idx)
  ------------------
  |  Branch (909:16): [True: 25.3k, False: 355k]
  ------------------
  910|  25.3k|                zero_idx = 0;
  911|       |
  912|   380k|            ps_pu[0].mv.i1_l0_ref_idx = zero_idx;
  913|   380k|            if(slice_type == PSLICE)
  ------------------
  |  Branch (913:16): [True: 52.0k, False: 328k]
  ------------------
  914|  52.0k|            {
  915|  52.0k|                ps_pu[0].mv.i1_l1_ref_idx = 0;
  916|  52.0k|                ps_pu[0].b2_pred_mode = PRED_L0;
  917|  52.0k|            }
  918|   328k|            else /* Slice type B */
  919|   328k|            {
  920|   328k|                ps_pu[0].mv.i1_l1_ref_idx = zero_idx;
  921|   328k|                ps_pu[0].b2_pred_mode = PRED_BI;
  922|   328k|            }
  923|       |
  924|   380k|            ps_pu[0].mv.s_l0_mv.i2_mvx = 0;
  925|   380k|            ps_pu[0].mv.s_l0_mv.i2_mvy = 0;
  926|   380k|            ps_pu[0].mv.s_l1_mv.i2_mvx = 0;
  927|   380k|            ps_pu[0].mv.s_l1_mv.i2_mvy = 0;
  928|       |
  929|   380k|            candidate_cnt++;
  930|   380k|        }
  931|   380k|    }
  932|       |
  933|      0|    return;
  934|   434k|}

ihevcd_scale_mv:
  107|   136k|{
  108|   136k|    WORD32 td, tb, tx;
  109|   136k|    WORD32 dist_scale_factor;
  110|   136k|    WORD32 mvx, mvy;
  111|       |
  112|   136k|    td = CLIP_S8(cur_poc - nbr_ref_poc);
  ------------------
  |  |   41|   136k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   136k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 294, False: 136k]
  |  |  |  |  |  Branch (40:53): [True: 2.10k, False: 133k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|   136k|    tb = CLIP_S8(cur_poc - cur_ref_poc);
  ------------------
  |  |   41|   136k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   136k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 294, False: 136k]
  |  |  |  |  |  Branch (40:53): [True: 2.74k, False: 133k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|       |
  115|   136k|    if(0 != td)
  ------------------
  |  Branch (115:8): [True: 133k, False: 2.74k]
  ------------------
  116|   133k|    {
  117|   133k|        tx = (16384 + (abs(td) >> 1)) / td;
  118|       |
  119|   133k|        dist_scale_factor = (tb * tx + 32) >> 6;
  120|   133k|        dist_scale_factor = CLIP3(dist_scale_factor, -4096, 4095);
  ------------------
  |  |   40|   133k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.46k, False: 130k]
  |  |  |  Branch (40:53): [True: 2.33k, False: 127k]
  |  |  ------------------
  ------------------
  121|       |
  122|   133k|        mvx = ps_mv->i2_mvx;
  123|   133k|        mvy = ps_mv->i2_mvy;
  124|       |
  125|   133k|        mvx = SIGN(dist_scale_factor * mvx)
  ------------------
  |  |   44|   133k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 96.5k, False: 37.0k]
  |  |  |  Branch (44:34): [True: 39.6k, False: 56.8k]
  |  |  ------------------
  ------------------
  126|   133k|                        * ((abs(dist_scale_factor * mvx) + 127) >> 8);
  127|   133k|        mvy = SIGN(dist_scale_factor * mvy)
  ------------------
  |  |   44|   133k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 97.1k, False: 36.4k]
  |  |  |  Branch (44:34): [True: 43.5k, False: 53.6k]
  |  |  ------------------
  ------------------
  128|   133k|                        * ((abs(dist_scale_factor * mvy) + 127) >> 8);
  129|       |
  130|   133k|        ps_mv->i2_mvx = CLIP_S16(mvx);
  ------------------
  |  |   53|   133k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   133k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.78k, False: 131k]
  |  |  |  |  |  Branch (40:53): [True: 2.64k, False: 129k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|   133k|        ps_mv->i2_mvy = CLIP_S16(mvy);
  ------------------
  |  |   53|   133k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   133k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.46k, False: 128k]
  |  |  |  |  |  Branch (40:53): [True: 1.48k, False: 126k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|   133k|    }
  133|   136k|}
ihevcd_scale_collocated_mv:
  169|   982k|{
  170|   982k|    WORD32 td, tb, tx;
  171|   982k|    WORD32 dist_scale_factor;
  172|   982k|    WORD32 mvx, mvy;
  173|       |
  174|   982k|    td = CLIP_S8(col_poc - col_ref_poc);
  ------------------
  |  |   41|   982k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   982k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 61.6k, False: 920k]
  |  |  |  |  |  Branch (40:53): [True: 7.82k, False: 912k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|   982k|    tb = CLIP_S8(cur_poc - cur_ref_poc);
  ------------------
  |  |   41|   982k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   982k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 982k]
  |  |  |  |  |  Branch (40:53): [True: 10.0k, False: 972k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|       |
  177|   982k|    tx = (16384 + (abs(td) >> 1)) / td;
  178|       |
  179|   982k|    dist_scale_factor = (tb * tx + 32) >> 6;
  180|   982k|    dist_scale_factor = CLIP3(dist_scale_factor, -4096, 4095);
  ------------------
  |  |   40|   982k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 7.62k, False: 974k]
  |  |  |  Branch (40:53): [True: 484k, False: 490k]
  |  |  ------------------
  ------------------
  181|       |
  182|   982k|    mvx = ps_mv->i2_mvx;
  183|   982k|    mvy = ps_mv->i2_mvy;
  184|       |
  185|   982k|    mvx = SIGN(dist_scale_factor * mvx)
  ------------------
  |  |   44|   982k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 880k, False: 102k]
  |  |  |  Branch (44:34): [True: 87.4k, False: 792k]
  |  |  ------------------
  ------------------
  186|   982k|                    * ((abs(dist_scale_factor * mvx) + 127) >> 8);
  187|   982k|    mvy = SIGN(dist_scale_factor * mvy)
  ------------------
  |  |   44|   982k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 868k, False: 114k]
  |  |  |  Branch (44:34): [True: 154k, False: 714k]
  |  |  ------------------
  ------------------
  188|   982k|                    * ((abs(dist_scale_factor * mvy) + 127) >> 8);
  189|       |
  190|   982k|    ps_mv->i2_mvx = CLIP_S16(mvx);
  ------------------
  |  |   53|   982k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   982k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 15.9k, False: 966k]
  |  |  |  |  |  Branch (40:53): [True: 19.3k, False: 947k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|   982k|    ps_mv->i2_mvy = CLIP_S16(mvy);
  ------------------
  |  |   53|   982k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   982k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 86.8k, False: 895k]
  |  |  |  |  |  Branch (40:53): [True: 45.1k, False: 850k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|   982k|}
GET_MV_NBR_ST:
  226|  1.38M|{
  227|  1.38M|    WORD32 i, nbr_pred_lx;
  228|  1.38M|    pic_buf_t *ps_nbr_pic_buf_lx;
  229|       |    /* Short Term */
  230|       |    /* L0 */
  231|  1.38M|    if(0 == lx)
  ------------------
  |  Branch (231:8): [True: 1.02M, False: 353k]
  ------------------
  232|  1.02M|    {
  233|  1.19M|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (233:20): [True: 1.01M, False: 186k]
  ------------------
  234|  1.01M|        {
  235|  1.01M|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  236|  1.01M|            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.01M|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|  1.01M|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|  1.01M|{                                                                                           \
  |  |  197|  1.01M|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 856k, False: 153k]
  |  |  |  Branch (197:30): [True: 745k, False: 111k]
  |  |  ------------------
  |  |  198|  1.01M|    {                                                                                       \
  |  |  199|   745k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|   745k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|   745k|        break ;                                                                             \
  |  |  202|   745k|    }                                                                                       \
  |  |  203|  1.01M|}
  ------------------
  238|  1.01M|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  239|   265k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  240|       |
  241|   265k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  242|   265k|            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|   265k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   265k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   265k|{                                                                                           \
  |  |  197|   265k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 194k, False: 70.7k]
  |  |  |  Branch (197:30): [True: 94.8k, False: 99.7k]
  |  |  ------------------
  |  |  198|   265k|    {                                                                                       \
  |  |  199|  94.8k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|  94.8k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|  94.8k|        break ;                                                                             \
  |  |  202|  94.8k|    }                                                                                       \
  |  |  203|   265k|}
  ------------------
  244|   265k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  245|   170k|        }
  246|  1.02M|    }
  247|       |    /* L1 */
  248|   353k|    else
  249|   353k|    {
  250|   424k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (250:20): [True: 348k, False: 75.7k]
  ------------------
  251|   348k|        {
  252|   348k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  253|   348k|            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|   348k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   348k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   348k|{                                                                                           \
  |  |  197|   348k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 234k, False: 113k]
  |  |  |  Branch (197:30): [True: 206k, False: 28.3k]
  |  |  ------------------
  |  |  198|   348k|    {                                                                                       \
  |  |  199|   206k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|   206k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|   206k|        break ;                                                                             \
  |  |  202|   206k|    }                                                                                       \
  |  |  203|   348k|}
  ------------------
  255|   348k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  256|       |
  257|   142k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  258|   142k|            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|   142k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   142k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   142k|{                                                                                           \
  |  |  197|   142k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 130k, False: 11.4k]
  |  |  |  Branch (197:30): [True: 71.9k, False: 58.9k]
  |  |  ------------------
  |  |  198|   142k|    {                                                                                       \
  |  |  199|  71.9k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|  71.9k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|  71.9k|        break ;                                                                             \
  |  |  202|  71.9k|    }                                                                                       \
  |  |  203|   142k|}
  ------------------
  260|   142k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  261|  70.3k|        }
  262|   353k|    }
  263|  1.38M|}
GET_MV_NBR_LT:
  266|   250k|{
  267|   250k|    WORD32 i, nbr_pred_lx;
  268|   250k|    pic_buf_t *ps_nbr_pic_buf_lx;
  269|       |    /* Long Term*/
  270|       |    /* L0 */
  271|   250k|    if(0 == lx)
  ------------------
  |  Branch (271:8): [True: 173k, False: 77.8k]
  ------------------
  272|   173k|    {
  273|   177k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (273:20): [True: 104k, False: 72.9k]
  ------------------
  274|   104k|        {
  275|   104k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  276|   104k|            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|   104k|            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|   104k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|   104k|{                                                                                            \
  |  |  208|   104k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|   104k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|   104k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|   104k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 63.4k, False: 40.9k]
  |  |  |  Branch (211:30): [True: 62.6k, False: 880]
  |  |  ------------------
  |  |  212|   104k|    {                                                                                        \
  |  |  213|  62.6k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  62.6k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  62.6k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 58.3k, False: 4.27k]
  |  |  ------------------
  |  |  216|  62.6k|        {                                                                                    \
  |  |  217|  58.3k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  58.3k|                                                cur_poc);                                    \
  |  |  219|  58.3k|        }                                                                                    \
  |  |  220|  62.6k|        break ;                                                                              \
  |  |  221|  62.6k|    }                                                                                        \
  |  |  222|   104k|}
  ------------------
  278|   104k|                            nbr_pred_lx,
  279|   104k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  280|   104k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  281|       |
  282|  41.8k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  283|  41.8k|            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|  41.8k|            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|  41.8k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  41.8k|{                                                                                            \
  |  |  208|  41.8k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  41.8k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  41.8k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  41.8k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 41.3k, False: 443]
  |  |  |  Branch (211:30): [True: 37.5k, False: 3.84k]
  |  |  ------------------
  |  |  212|  41.8k|    {                                                                                        \
  |  |  213|  37.5k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  37.5k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  37.5k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 36.2k, False: 1.26k]
  |  |  ------------------
  |  |  216|  37.5k|        {                                                                                    \
  |  |  217|  36.2k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  36.2k|                                                cur_poc);                                    \
  |  |  219|  36.2k|        }                                                                                    \
  |  |  220|  37.5k|        break ;                                                                              \
  |  |  221|  37.5k|    }                                                                                        \
  |  |  222|  41.8k|}
  ------------------
  285|  41.8k|                            nbr_pred_lx,
  286|  41.8k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  287|  41.8k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  288|  4.29k|        }
  289|   173k|    }
  290|       |    /* L1 */
  291|  77.8k|    else
  292|  77.8k|    {
  293|  80.0k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (293:20): [True: 47.6k, False: 32.4k]
  ------------------
  294|  47.6k|        {
  295|  47.6k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  296|  47.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));
  297|  47.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|  47.6k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  47.6k|{                                                                                            \
  |  |  208|  47.6k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  47.6k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  47.6k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  47.6k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 20.8k, False: 26.8k]
  |  |  |  Branch (211:30): [True: 18.7k, False: 2.04k]
  |  |  ------------------
  |  |  212|  47.6k|    {                                                                                        \
  |  |  213|  18.7k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  18.7k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  18.7k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 16.0k, False: 2.74k]
  |  |  ------------------
  |  |  216|  18.7k|        {                                                                                    \
  |  |  217|  16.0k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  16.0k|                                                cur_poc);                                    \
  |  |  219|  16.0k|        }                                                                                    \
  |  |  220|  18.7k|        break ;                                                                              \
  |  |  221|  18.7k|    }                                                                                        \
  |  |  222|  47.6k|}
  ------------------
  298|  47.6k|                            nbr_pred_lx,
  299|  47.6k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  300|  47.6k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  301|       |
  302|  28.8k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  303|  28.8k|            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|  28.8k|            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|  28.8k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  28.8k|{                                                                                            \
  |  |  208|  28.8k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  28.8k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  28.8k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  28.8k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 27.8k, False: 1.02k]
  |  |  |  Branch (211:30): [True: 26.6k, False: 1.19k]
  |  |  ------------------
  |  |  212|  28.8k|    {                                                                                        \
  |  |  213|  26.6k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  26.6k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  26.6k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 26.0k, False: 611]
  |  |  ------------------
  |  |  216|  26.6k|        {                                                                                    \
  |  |  217|  26.0k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  26.0k|                                                cur_poc);                                    \
  |  |  219|  26.0k|        }                                                                                    \
  |  |  220|  26.6k|        break ;                                                                              \
  |  |  221|  26.6k|    }                                                                                        \
  |  |  222|  28.8k|}
  ------------------
  305|  28.8k|                            nbr_pred_lx,
  306|  28.8k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  307|  28.8k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  308|  2.21k|        }
  309|  77.8k|    }
  310|   250k|}
ihevcd_mv_pred:
  366|   660k|{
  367|   660k|    slice_header_t *ps_slice_hdr;
  368|   660k|    ref_list_t *ps_ref_pic_list[2];
  369|   660k|    pu_t *ps_pic_pu;
  370|   660k|    WORD32 max_l0_mvp_cand, max_l1_mvp_cand;
  371|   660k|    WORD32 l0_done_flag, l1_done_flag;
  372|   660k|    WORD32 num_l0_mvp_cand, num_l1_mvp_cand;
  373|   660k|    WORD32 is_scaled_flag_list /* Indicates whether A0 or A1 is available */;
  374|   660k|    WORD32 avail_a_flag[2];
  375|   660k|    mv_t as_mv_a[2];
  376|   660k|    WORD32 part_pos_x;
  377|   660k|    WORD32 part_pos_y;
  378|   660k|    WORD32 part_wd;
  379|   660k|    WORD32 part_ht;
  380|   660k|    pic_buf_t *ps_cur_pic_buf_l0, *ps_cur_pic_buf_l1;
  381|   660k|    WORD32 nbr_avail[3]; /*[A0/A1] */ /* [B0/B1/B2] */
  382|   660k|    pu_t *aps_nbr_pu[3];  /*[A0/A1] */ /* [B0/B1/B2] */
  383|   660k|    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|   660k|    ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  401|   660k|    ps_pic_pu = ps_mv_ctxt->ps_pic_pu;
  402|   660k|    max_l0_mvp_cand = ps_pu->b1_l0_mvp_idx + 1;
  403|   660k|    max_l1_mvp_cand = ps_pu->b1_l1_mvp_idx + 1;
  404|   660k|    num_l0_mvp_cand = 0;
  405|   660k|    num_l1_mvp_cand = 0;
  406|       |
  407|       |    /* Initializing reference list */
  408|   660k|    ps_ref_pic_list[0] = ps_slice_hdr->as_ref_pic_list0;
  409|   660k|    ps_ref_pic_list[1] = ps_slice_hdr->as_ref_pic_list1;
  410|   660k|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (410:8): [True: 3.63k, False: 656k]
  ------------------
  411|  3.63k|        ps_ref_pic_list[1] = ps_slice_hdr->as_ref_pic_list0;
  412|       |
  413|   660k|    ps_cur_pic_buf_l0 = (pic_buf_t *)((ps_ref_pic_list[0][ps_pu->mv.i1_l0_ref_idx].pv_pic_buf));
  414|   660k|    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|   660k|    is_scaled_flag_list = 0;
  417|       |
  418|   660k|    part_pos_x = ps_pu->b4_pos_x << 2;
  419|   660k|    part_pos_y = ps_pu->b4_pos_y << 2;
  420|   660k|    part_wd = (ps_pu->b4_wd + 1) << 2;
  421|   660k|    part_ht = (ps_pu->b4_ht + 1) << 2;
  422|       |
  423|       |    /************************************************************/
  424|       |    /* Calculating of motion vector A from neighbors A0 and A1  */
  425|       |    /************************************************************/
  426|   660k|    {
  427|   660k|        nbr_avail[0] = 0;
  428|   660k|        nbr_avail[1] = 0;
  429|       |
  430|       |        /* Pointers to A0 and A1 */
  431|   660k|        {
  432|   660k|            WORD32 y_a0, y_a1;
  433|   660k|            WORD32 pu_idx_a0, pu_idx_a1;
  434|       |
  435|       |            /* TODO: y_a0, y_a1 is coded assuming left nbr pointer starts at PU */
  436|   660k|            y_a0 = (part_ht >> 2);
  437|   660k|            y_a1 = ((part_ht - 1) >> 2);
  438|       |
  439|   660k|            pu_idx_a0 = *(pu4_left_pu_idx + (y_a0 * left_nbr_4x4_strd));
  440|   660k|            pu_idx_a1 = *(pu4_left_pu_idx + (y_a1 * left_nbr_4x4_strd));
  441|       |
  442|   660k|            if(lb_avail && (!ps_pic_pu[pu_idx_a0].b1_intra_flag))
  ------------------
  |  Branch (442:16): [True: 204k, False: 455k]
  |  Branch (442:28): [True: 196k, False: 7.71k]
  ------------------
  443|   196k|            {
  444|   196k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_a0];
  445|   196k|                num_nbrs++;
  446|   196k|                nbr_avail[0] = 1;
  447|   196k|            }
  448|   660k|            if(l_avail && (!ps_pic_pu[pu_idx_a1].b1_intra_flag))
  ------------------
  |  Branch (448:16): [True: 615k, False: 44.3k]
  |  Branch (448:27): [True: 599k, False: 16.1k]
  ------------------
  449|   599k|            {
  450|   599k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_a1];
  451|   599k|                num_nbrs++;
  452|   599k|                nbr_avail[1] = 1;
  453|   599k|            }
  454|   660k|        }
  455|       |        /* Setting is scaled flag based on availability of A0 and A1 */
  456|   660k|        if((nbr_avail[0] == 1) || (nbr_avail[1]))
  ------------------
  |  Branch (456:12): [True: 190k, False: 470k]
  |  Branch (456:35): [True: 409k, False: 60.8k]
  ------------------
  457|   601k|        {
  458|   601k|            is_scaled_flag_list = 1;
  459|   601k|        }
  460|       |
  461|   660k|        avail_a_flag[0] = 0;
  462|   660k|        avail_a_flag[1] = 0;
  463|       |
  464|       |        /* L0 */
  465|   660k|        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|   660k|        if(0 == avail_a_flag[0])
  ------------------
  |  Branch (466:12): [True: 133k, False: 526k]
  ------------------
  467|   133k|        {
  468|   133k|            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|   133k|        }
  470|       |
  471|       |        /* L1 */
  472|   660k|        if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (472:12): [True: 230k, False: 429k]
  ------------------
  473|   230k|        {
  474|   230k|            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|   230k|            if(0 == avail_a_flag[1])
  ------------------
  |  Branch (475:16): [True: 58.5k, False: 172k]
  ------------------
  476|  58.5k|            {
  477|  58.5k|                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|  58.5k|            }
  479|   230k|        }
  480|       |
  481|   660k|        l0_done_flag = (PRED_L1 == ps_pu->b2_pred_mode);
  482|   660k|        l1_done_flag = (PRED_L0 == ps_pu->b2_pred_mode);
  483|       |
  484|   660k|        if(avail_a_flag[0])
  ------------------
  |  Branch (484:12): [True: 598k, False: 61.3k]
  ------------------
  485|   598k|        {
  486|   598k|            num_l0_mvp_cand++;
  487|   598k|            if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (487:16): [True: 352k, False: 246k]
  ------------------
  488|   352k|            {
  489|   352k|                ps_pred_mv->s_l0_mv = as_mv_a[0];
  490|   352k|                l0_done_flag = 1;
  491|   352k|            }
  492|   598k|        }
  493|   660k|        if(avail_a_flag[1])
  ------------------
  |  Branch (493:12): [True: 201k, False: 458k]
  ------------------
  494|   201k|        {
  495|   201k|            num_l1_mvp_cand++;
  496|   201k|            if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (496:16): [True: 113k, False: 88.9k]
  ------------------
  497|   113k|            {
  498|   113k|                ps_pred_mv->s_l1_mv = as_mv_a[1];
  499|   113k|                l1_done_flag = 1;
  500|   113k|            }
  501|   201k|        }
  502|   660k|        if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (502:12): [True: 367k, False: 292k]
  |  Branch (502:28): [True: 294k, False: 72.3k]
  ------------------
  503|   294k|            return;
  504|   660k|    }
  505|       |
  506|       |    /************************************************************/
  507|       |    /* Calculating of motion vector B from neighbors B0 and B1  */
  508|       |    /************************************************************/
  509|   365k|    {
  510|   365k|        WORD32 avail_b_flag[2];
  511|   365k|        mv_t as_mv_b[2];
  512|       |
  513|       |        /* Pointers to B0, B1 and B2 */
  514|   365k|        {
  515|   365k|            WORD32 x_b0, x_b1, x_b2;
  516|   365k|            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|   365k|            x_b0 = (part_pos_x + part_wd);
  521|   365k|            x_b1 = (part_pos_x + part_wd - 1);
  522|   365k|            x_b2 = (part_pos_x - 1);
  523|       |            /* Getting offset back to given pointer */
  524|   365k|            x_b0 = x_b0 - part_pos_x;
  525|   365k|            x_b1 = x_b1 - part_pos_x;
  526|   365k|            x_b2 = x_b2 - part_pos_x;
  527|       |
  528|       |            /* Below derivation are based on top pointer */
  529|       |            /* is pointing first pixel of PU             */
  530|   365k|            pu_idx_b0 = *(pu4_top_pu_idx + (x_b0 >> 2));
  531|   365k|            pu_idx_b0 = pu_idx_b0 * tr_avail;
  532|   365k|            pu_idx_b1 = *(pu4_top_pu_idx + (x_b1 >> 2));
  533|   365k|            pu_idx_b1 = pu_idx_b1 * t_avail;
  534|       |            /* At CTB boundary, use top-left passed in */
  535|   365k|            if(part_pos_y)
  ------------------
  |  Branch (535:16): [True: 273k, False: 91.3k]
  ------------------
  536|   273k|            {
  537|   273k|                pu_idx_b2 = *pu4_top_left_pu_idx;
  538|   273k|            }
  539|  91.3k|            else
  540|  91.3k|            {
  541|       |                /* Not at CTB boundary, use top and  */
  542|       |                /* add correction to go to top-left */
  543|  91.3k|                pu_idx_b2 = *((pu4_top_pu_idx)+(x_b2 >> 2));
  544|  91.3k|            }
  545|   365k|            pu_idx_b2 = pu_idx_b2 * tl_avail;
  546|       |
  547|   365k|            num_nbrs = 0;
  548|   365k|            nbr_avail[0] = 0;
  549|   365k|            nbr_avail[1] = 0;
  550|   365k|            nbr_avail[2] = 0;
  551|       |
  552|   365k|            if(tr_avail && (!ps_pic_pu[pu_idx_b0].b1_intra_flag))
  ------------------
  |  Branch (552:16): [True: 226k, False: 138k]
  |  Branch (552:28): [True: 219k, False: 6.70k]
  ------------------
  553|   219k|            {
  554|   219k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b0];
  555|   219k|                num_nbrs++;
  556|   219k|                nbr_avail[0] = 1;
  557|   219k|            }
  558|   365k|            if(t_avail && (!ps_pic_pu[pu_idx_b1].b1_intra_flag))
  ------------------
  |  Branch (558:16): [True: 344k, False: 21.1k]
  |  Branch (558:27): [True: 335k, False: 8.99k]
  ------------------
  559|   335k|            {
  560|   335k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b1];
  561|   335k|                num_nbrs++;
  562|   335k|                nbr_avail[1] = 1;
  563|   335k|            }
  564|   365k|            if(tl_avail && (!ps_pic_pu[pu_idx_b2].b1_intra_flag))
  ------------------
  |  Branch (564:16): [True: 304k, False: 61.0k]
  |  Branch (564:28): [True: 292k, False: 12.1k]
  ------------------
  565|   292k|            {
  566|   292k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b2];
  567|   292k|                num_nbrs++;
  568|   292k|                nbr_avail[2] = 1;
  569|   292k|            }
  570|   365k|        }
  571|       |
  572|       |        /* L0 */
  573|   365k|        avail_b_flag[0] = 0;
  574|   365k|        avail_b_flag[1] = 0;
  575|       |
  576|   365k|        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|   365k|        if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (579:12): [True: 128k, False: 236k]
  ------------------
  580|   128k|        {
  581|       |            /* B0 Short Term */
  582|   128k|            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|   128k|        }
  584|       |
  585|   365k|        if(avail_b_flag[0])
  ------------------
  |  Branch (585:12): [True: 312k, False: 52.3k]
  ------------------
  586|   312k|        {
  587|   312k|            if(((0 == num_l0_mvp_cand)
  ------------------
  |  Branch (587:17): [True: 43.8k, False: 268k]
  ------------------
  588|   268k|                            || (as_mv_a[0].i2_mvx != as_mv_b[0].i2_mvx)
  ------------------
  |  Branch (588:32): [True: 114k, False: 154k]
  ------------------
  589|   154k|                            || (as_mv_a[0].i2_mvy != as_mv_b[0].i2_mvy)))
  ------------------
  |  Branch (589:32): [True: 31.6k, False: 123k]
  ------------------
  590|   192k|            {
  591|   192k|                num_l0_mvp_cand++;
  592|   192k|                if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (592:20): [True: 152k, False: 39.6k]
  ------------------
  593|   152k|                {
  594|   152k|                    ps_pred_mv->s_l0_mv = as_mv_b[0];
  595|   152k|                    l0_done_flag = 1;
  596|   152k|                }
  597|   192k|            }
  598|   312k|        }
  599|   365k|        if(avail_b_flag[1])
  ------------------
  |  Branch (599:12): [True: 105k, False: 259k]
  ------------------
  600|   105k|        {
  601|   105k|            if(((0 == num_l1_mvp_cand)
  ------------------
  |  Branch (601:17): [True: 21.2k, False: 84.3k]
  ------------------
  602|  84.3k|                            || (as_mv_a[1].i2_mvx != as_mv_b[1].i2_mvx)
  ------------------
  |  Branch (602:32): [True: 34.0k, False: 50.2k]
  ------------------
  603|  50.2k|                            || (as_mv_a[1].i2_mvy != as_mv_b[1].i2_mvy)))
  ------------------
  |  Branch (603:32): [True: 10.6k, False: 39.5k]
  ------------------
  604|  66.4k|            {
  605|  66.4k|                num_l1_mvp_cand++;
  606|  66.4k|                if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (606:20): [True: 50.2k, False: 16.1k]
  ------------------
  607|  50.2k|                {
  608|  50.2k|                    ps_pred_mv->s_l1_mv = as_mv_b[1];
  609|  50.2k|                    l1_done_flag = 1;
  610|  50.2k|                }
  611|  66.4k|            }
  612|   105k|        }
  613|   365k|        if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (613:12): [True: 216k, False: 148k]
  |  Branch (613:28): [True: 170k, False: 45.7k]
  ------------------
  614|   170k|            return;
  615|       |
  616|   194k|        if((is_scaled_flag_list == 0) && (avail_b_flag[0] == 1))
  ------------------
  |  Branch (616:12): [True: 39.2k, False: 155k]
  |  Branch (616:42): [True: 22.8k, False: 16.3k]
  ------------------
  617|  22.8k|        {
  618|  22.8k|            avail_a_flag[0] = 1;
  619|  22.8k|            as_mv_a[0] = as_mv_b[0];
  620|  22.8k|        }
  621|   194k|        if((is_scaled_flag_list == 0) && (avail_b_flag[1] == 1))
  ------------------
  |  Branch (621:12): [True: 39.2k, False: 155k]
  |  Branch (621:42): [True: 12.6k, False: 26.5k]
  ------------------
  622|  12.6k|        {
  623|  12.6k|            avail_a_flag[1] = 1;
  624|  12.6k|            as_mv_a[1] = as_mv_b[1];
  625|  12.6k|        }
  626|       |
  627|   194k|        if(0 == is_scaled_flag_list)
  ------------------
  |  Branch (627:12): [True: 39.2k, False: 155k]
  ------------------
  628|  39.2k|        {
  629|  39.2k|            avail_b_flag[0] = avail_b_flag[1] = 0;
  630|       |
  631|  39.2k|            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.2k|            if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (633:16): [True: 19.5k, False: 19.6k]
  ------------------
  634|  19.5k|            {
  635|  19.5k|                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.5k|            }
  637|       |
  638|  39.2k|            if(avail_b_flag[0])
  ------------------
  |  Branch (638:16): [True: 29.8k, False: 9.30k]
  ------------------
  639|  29.8k|            {
  640|  29.8k|                if(((0 == num_l0_mvp_cand)
  ------------------
  |  Branch (640:21): [True: 7.04k, False: 22.8k]
  ------------------
  641|  22.8k|                                || (as_mv_a[0].i2_mvx != as_mv_b[0].i2_mvx)
  ------------------
  |  Branch (641:36): [True: 848, False: 22.0k]
  ------------------
  642|  22.0k|                                || (as_mv_a[0].i2_mvy != as_mv_b[0].i2_mvy)))
  ------------------
  |  Branch (642:36): [True: 533, False: 21.4k]
  ------------------
  643|  8.43k|                {
  644|  8.43k|                    num_l0_mvp_cand++;
  645|  8.43k|                    if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (645:24): [True: 4.92k, False: 3.50k]
  ------------------
  646|  4.92k|                    {
  647|  4.92k|                        ps_pred_mv->s_l0_mv = as_mv_b[0];
  648|  4.92k|                        l0_done_flag = 1;
  649|  4.92k|                    }
  650|  8.43k|                }
  651|  29.8k|            }
  652|  39.2k|            if(avail_b_flag[1])
  ------------------
  |  Branch (652:16): [True: 15.7k, False: 23.4k]
  ------------------
  653|  15.7k|            {
  654|  15.7k|                if(((0 == num_l1_mvp_cand)
  ------------------
  |  Branch (654:21): [True: 3.08k, False: 12.6k]
  ------------------
  655|  12.6k|                                || (as_mv_a[1].i2_mvx != as_mv_b[1].i2_mvx)
  ------------------
  |  Branch (655:36): [True: 888, False: 11.7k]
  ------------------
  656|  11.7k|                                || (as_mv_a[1].i2_mvy != as_mv_b[1].i2_mvy)))
  ------------------
  |  Branch (656:36): [True: 679, False: 11.0k]
  ------------------
  657|  4.65k|                {
  658|  4.65k|                    num_l1_mvp_cand++;
  659|  4.65k|                    if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (659:24): [True: 2.88k, False: 1.76k]
  ------------------
  660|  2.88k|                    {
  661|  2.88k|                        ps_pred_mv->s_l1_mv = as_mv_b[1];
  662|  2.88k|                        l1_done_flag = 1;
  663|  2.88k|                    }
  664|  4.65k|                }
  665|  15.7k|            }
  666|  39.2k|            if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (666:16): [True: 13.1k, False: 26.0k]
  |  Branch (666:32): [True: 4.76k, False: 8.37k]
  ------------------
  667|  4.76k|                return;
  668|  39.2k|        }
  669|       |        /***********************************************************/
  670|       |        /*          Collocated MV prediction                       */
  671|       |        /***********************************************************/
  672|   189k|        if((2 != num_l0_mvp_cand) || (2 != num_l1_mvp_cand))
  ------------------
  |  Branch (672:12): [True: 183k, False: 6.82k]
  |  Branch (672:38): [True: 6.82k, False: 0]
  ------------------
  673|   197k|        {
  674|   197k|            mv_t as_mv_col[2], s_mv_col_l0, s_mv_col_l1;
  675|   197k|            WORD32 avail_col_flag[2] = { 0 };
  676|   197k|            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|   197k|            x_col = part_pos_x + part_wd;
  679|   197k|            y_col = part_pos_y + part_ht;
  680|   197k|            ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 1, x_col, y_col);
  681|       |
  682|   197k|            avail_col_l0 = avail_col_flag[0];
  683|   197k|            avail_col_l1 = avail_col_flag[1];
  684|   197k|            if(avail_col_l0 || avail_col_l1)
  ------------------
  |  Branch (684:16): [True: 95.0k, False: 102k]
  |  Branch (684:32): [True: 679, False: 102k]
  ------------------
  685|  96.5k|            {
  686|  96.5k|                s_mv_col_l0 = as_mv_col[0];
  687|  96.5k|                s_mv_col_l1 = as_mv_col[1];
  688|  96.5k|            }
  689|       |
  690|   197k|            if(avail_col_l0 == 0 || avail_col_l1 == 0)
  ------------------
  |  Branch (690:16): [True: 101k, False: 96.4k]
  |  Branch (690:37): [True: 627, False: 95.8k]
  ------------------
  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: 791]
  ------------------
  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: 770]
  ------------------
  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|   197k|            if(avail_col_l0)
  ------------------
  |  Branch (711:16): [True: 146k, False: 51.4k]
  ------------------
  712|   146k|            {
  713|   146k|                if(2 != num_l0_mvp_cand)
  ------------------
  |  Branch (713:20): [True: 141k, False: 5.10k]
  ------------------
  714|   141k|                {
  715|   141k|                    num_l0_mvp_cand++;
  716|   141k|                    if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (716:24): [True: 112k, False: 28.8k]
  ------------------
  717|   112k|                    {
  718|   112k|                        ps_pred_mv->s_l0_mv = s_mv_col_l0;
  719|   112k|                        l0_done_flag = 1;
  720|   112k|                    }
  721|   141k|                }
  722|   146k|            }
  723|   197k|            if(avail_col_l1)
  ------------------
  |  Branch (723:16): [True: 146k, False: 51.7k]
  ------------------
  724|   146k|            {
  725|   146k|                if(2 != num_l1_mvp_cand)
  ------------------
  |  Branch (725:20): [True: 143k, False: 2.45k]
  ------------------
  726|   143k|                {
  727|   143k|                    num_l1_mvp_cand++;
  728|   143k|                    if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (728:24): [True: 139k, False: 4.23k]
  ------------------
  729|   139k|                    {
  730|   139k|                        ps_pred_mv->s_l1_mv = s_mv_col_l1;
  731|   139k|                        l1_done_flag = 1;
  732|   139k|                    }
  733|   143k|                }
  734|   146k|            }
  735|   197k|            if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (735:16): [True: 156k, False: 41.1k]
  |  Branch (735:32): [True: 145k, False: 11.6k]
  ------------------
  736|   145k|                return;
  737|   197k|        }
  738|       |
  739|  44.7k|        if(0 == l0_done_flag)
  ------------------
  |  Branch (739:12): [True: 41.8k, False: 2.94k]
  ------------------
  740|  41.8k|        {
  741|  41.8k|            ps_pred_mv->s_l0_mv.i2_mvx = 0;
  742|  41.8k|            ps_pred_mv->s_l0_mv.i2_mvy = 0;
  743|  41.8k|        }
  744|  44.7k|        if(0 == l1_done_flag)
  ------------------
  |  Branch (744:12): [True: 19.3k, False: 25.3k]
  ------------------
  745|  19.3k|        {
  746|  19.3k|            ps_pred_mv->s_l1_mv.i2_mvx = 0;
  747|  19.3k|            ps_pred_mv->s_l1_mv.i2_mvy = 0;
  748|  19.3k|        }
  749|  44.7k|    }
  750|  44.7k|}

ihevcd_nal_search_start_code:
   97|   568k|{
   98|   568k|    WORD32 ofst;
   99|       |
  100|   568k|    WORD32 zero_byte_cnt;
  101|   568k|    WORD32 start_code_found;
  102|       |
  103|   568k|    ofst = -1;
  104|       |
  105|   568k|    zero_byte_cnt = 0;
  106|   568k|    start_code_found = 0;
  107|   171M|    while(ofst < (bytes_remaining - 1))
  ------------------
  |  Branch (107:11): [True: 171M, False: 367]
  ------------------
  108|   171M|    {
  109|   171M|        ofst++;
  110|   171M|        if(pu1_buf[ofst] != 0)
  ------------------
  |  Branch (110:12): [True: 12.5M, False: 158M]
  ------------------
  111|  12.5M|        {
  112|  12.5M|            zero_byte_cnt = 0;
  113|  12.5M|            continue;
  114|  12.5M|        }
  115|       |
  116|   158M|        zero_byte_cnt++;
  117|   158M|        if((ofst < (bytes_remaining - 1)) &&
  ------------------
  |  Branch (117:12): [True: 158M, False: 66]
  ------------------
  118|   158M|           (pu1_buf[ofst + 1] == START_CODE_PREFIX_BYTE) &&
  ------------------
  |  |   47|   158M|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (118:12): [True: 587k, False: 157M]
  ------------------
  119|   587k|           (zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
  ------------------
  |  |   57|   587k|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (119:12): [True: 567k, False: 19.8k]
  ------------------
  120|   567k|        {
  121|       |            /* Found the start code */
  122|   567k|            ofst++;
  123|   567k|            start_code_found = 1;
  124|   567k|            break;
  125|   567k|        }
  126|   158M|    }
  127|   568k|    if((0 == start_code_found) && (ofst < bytes_remaining))
  ------------------
  |  Branch (127:8): [True: 367, False: 567k]
  |  Branch (127:35): [True: 367, False: 0]
  ------------------
  128|    367|    {
  129|    367|        if((START_CODE_PREFIX_BYTE == pu1_buf[ofst]) &&
  ------------------
  |  |   47|    367|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (129:12): [True: 23, False: 344]
  ------------------
  130|     23|           (zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
  ------------------
  |  |   57|     23|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (130:12): [True: 0, False: 23]
  ------------------
  131|      0|        {
  132|       |            /* Found a start code at the end*/
  133|      0|            ofst++;
  134|      0|        }
  135|    367|    }
  136|       |    /* Since ofst started at -1, increment it by 1 */
  137|   568k|    ofst++;
  138|       |
  139|   568k|    return ofst;
  140|   568k|}
ihevcd_nal_remv_emuln_bytes:
  186|   567k|{
  187|   567k|    WORD32 src_cnt;
  188|   567k|    WORD32 dst_cnt;
  189|   567k|    WORD32 zero_byte_cnt;
  190|   567k|    WORD32 start_code_found;
  191|   567k|    UWORD8 u1_src;
  192|   567k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  193|       |
  194|   567k|    src_cnt = 0;
  195|   567k|    dst_cnt = 0;
  196|   567k|    zero_byte_cnt = 0;
  197|   567k|    start_code_found = 0;
  198|   234M|    while(src_cnt < (bytes_remaining - 1))
  ------------------
  |  Branch (198:11): [True: 234M, False: 54.9k]
  ------------------
  199|   234M|    {
  200|   234M|        u1_src = pu1_src[src_cnt++];
  201|       |
  202|   234M|        pu1_dst[dst_cnt++] = u1_src;
  203|   234M|        if(u1_src != 0)
  ------------------
  |  Branch (203:12): [True: 142M, False: 91.7M]
  ------------------
  204|   142M|        {
  205|   142M|            zero_byte_cnt = 0;
  206|   142M|            continue;
  207|   142M|        }
  208|       |
  209|  91.7M|        zero_byte_cnt++;
  210|  91.7M|        if(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE)
  ------------------
  |  |   57|  91.7M|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (210:12): [True: 89.9M, False: 1.79M]
  ------------------
  211|  89.9M|        {
  212|  89.9M|            u1_src = pu1_src[src_cnt];
  213|  89.9M|            if(START_CODE_PREFIX_BYTE == u1_src)
  ------------------
  |  |   47|  89.9M|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (213:16): [True: 512k, False: 89.4M]
  ------------------
  214|   512k|            {
  215|       |                /* Found the start code */
  216|   512k|                src_cnt -= zero_byte_cnt;
  217|   512k|                dst_cnt -= zero_byte_cnt;
  218|   512k|                start_code_found = 1;
  219|   512k|                break;
  220|   512k|            }
  221|  89.4M|            else if(EMULATION_PREVENT_BYTE == u1_src)
  ------------------
  |  |   53|  89.4M|#define EMULATION_PREVENT_BYTE      3
  ------------------
  |  Branch (221:21): [True: 33.9k, False: 89.4M]
  ------------------
  222|  33.9k|            {
  223|       |                /* Found the emulation prevention byte */
  224|  33.9k|                src_cnt++;
  225|  33.9k|                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|  33.9k|            }
  231|  89.9M|        }
  232|       |
  233|  91.7M|    }
  234|       |
  235|   567k|    if((0 == start_code_found) && (src_cnt < bytes_remaining))
  ------------------
  |  Branch (235:8): [True: 54.9k, False: 512k]
  |  Branch (235:35): [True: 54.9k, False: 76]
  ------------------
  236|  54.9k|    {
  237|  54.9k|        u1_src = pu1_src[src_cnt++];
  238|  54.9k|        if(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE)
  ------------------
  |  |   57|  54.9k|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (238:12): [True: 2.10k, False: 52.8k]
  ------------------
  239|  2.10k|        {
  240|       |
  241|  2.10k|            if(START_CODE_PREFIX_BYTE == u1_src)
  ------------------
  |  |   47|  2.10k|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (241:16): [True: 0, False: 2.10k]
  ------------------
  242|      0|            {
  243|       |                /* Found a start code at the end*/
  244|      0|                src_cnt -= zero_byte_cnt;
  245|      0|            }
  246|  2.10k|            else if(EMULATION_PREVENT_BYTE == u1_src)
  ------------------
  |  |   53|  2.10k|#define EMULATION_PREVENT_BYTE      3
  ------------------
  |  Branch (246:21): [True: 0, False: 2.10k]
  ------------------
  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.10k|        }
  256|  52.8k|        else
  257|  52.8k|        {
  258|  52.8k|            pu1_dst[dst_cnt++] = u1_src;
  259|  52.8k|        }
  260|       |
  261|       |
  262|  54.9k|    }
  263|   567k|    *pi4_nal_len = src_cnt;
  264|   567k|    *pi4_dst_len = dst_cnt;
  265|   567k|    return ret;
  266|   567k|}
ihevcd_nal_unit_header:
  290|   567k|{
  291|   567k|    WORD32 unused;
  292|   567k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  293|   567k|    UNUSED(unused);
  ------------------
  |  |   38|   567k|#define UNUSED(x) ((void)(x))
  ------------------
  294|       |    /* Syntax : forbidden_zero_bit */
  295|   567k|    unused = ihevcd_bits_get(ps_bitstrm, 1);
  296|       |
  297|       |    /* Syntax : nal_unit_type */
  298|   567k|    ps_nal->i1_nal_unit_type = ihevcd_bits_get(ps_bitstrm, 6);
  299|       |
  300|       |    /* Syntax : nuh_reserved_zero_6bits */
  301|   567k|    unused = ihevcd_bits_get(ps_bitstrm, 6);
  302|       |
  303|       |    /* Syntax : nuh_temporal_id_plus1 */
  304|   567k|    ps_nal->i1_nuh_temporal_id = (WORD32)ihevcd_bits_get(ps_bitstrm, 3) - 1;
  305|       |
  306|   567k|    return ret;
  307|       |
  308|   567k|}
ihevcd_nal_unit:
  332|   567k|{
  333|   567k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  334|       |
  335|       |    /* NAL Header */
  336|   567k|    nal_header_t s_nal;
  337|       |
  338|   567k|    ret = ihevcd_nal_unit_header(&ps_codec->s_parse.s_bitstrm, &s_nal);
  339|   567k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   567k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 567k]
  |  |  ------------------
  ------------------
  340|       |
  341|   567k|    if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (341:8): [True: 31.1k, False: 536k]
  ------------------
  342|  31.1k|        s_nal.i1_nal_unit_type = ps_codec->s_parse.ps_slice_hdr->i1_nal_unit_type;
  343|       |
  344|       |    /* Setting RASL Output flag */
  345|   567k|    switch(s_nal.i1_nal_unit_type)
  346|   567k|    {
  347|  4.03k|        case NAL_BLA_W_LP    :
  ------------------
  |  Branch (347:9): [True: 4.03k, False: 563k]
  ------------------
  348|  17.9k|        case NAL_BLA_W_DLP   :
  ------------------
  |  Branch (348:9): [True: 13.9k, False: 553k]
  ------------------
  349|  22.1k|        case NAL_BLA_N_LP    :
  ------------------
  |  Branch (349:9): [True: 4.25k, False: 563k]
  ------------------
  350|  22.1k|            ps_codec->i4_rasl_output_flag = 0;
  351|  22.1k|            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|  38.6k|        case NAL_IDR_W_LP    :
  ------------------
  |  Branch (356:9): [True: 38.6k, False: 529k]
  ------------------
  357|   112k|        case NAL_IDR_N_LP    :
  ------------------
  |  Branch (357:9): [True: 73.4k, False: 494k]
  ------------------
  358|   112k|            ps_codec->i4_rasl_output_flag = 1;
  359|   112k|            break;
  360|       |
  361|  4.43k|        case NAL_CRA         :
  ------------------
  |  Branch (361:9): [True: 4.43k, False: 563k]
  ------------------
  362|  4.43k|            ps_codec->i4_rasl_output_flag = (0 != ps_codec->i4_cra_as_first_pic) ? 0 : 1;
  ------------------
  |  Branch (362:45): [True: 1.25k, False: 3.17k]
  ------------------
  363|  4.43k|            break;
  364|       |
  365|   428k|        default:
  ------------------
  |  Branch (365:9): [True: 428k, False: 138k]
  ------------------
  366|   428k|            break;
  367|   567k|    }
  368|       |
  369|   567k|    switch(s_nal.i1_nal_unit_type)
  370|   567k|    {
  371|  4.03k|        case NAL_BLA_W_LP    :
  ------------------
  |  Branch (371:9): [True: 4.03k, False: 563k]
  ------------------
  372|  17.9k|        case NAL_BLA_W_DLP   :
  ------------------
  |  Branch (372:9): [True: 13.9k, False: 553k]
  ------------------
  373|  22.1k|        case NAL_BLA_N_LP    :
  ------------------
  |  Branch (373:9): [True: 4.25k, False: 563k]
  ------------------
  374|  60.8k|        case NAL_IDR_W_LP    :
  ------------------
  |  Branch (374:9): [True: 38.6k, False: 529k]
  ------------------
  375|   134k|        case NAL_IDR_N_LP    :
  ------------------
  |  Branch (375:9): [True: 73.4k, False: 494k]
  ------------------
  376|   138k|        case NAL_CRA         :
  ------------------
  |  Branch (376:9): [True: 4.43k, False: 563k]
  ------------------
  377|   254k|        case NAL_TRAIL_N     :
  ------------------
  |  Branch (377:9): [True: 115k, False: 451k]
  ------------------
  378|   262k|        case NAL_TRAIL_R     :
  ------------------
  |  Branch (378:9): [True: 7.78k, False: 559k]
  ------------------
  379|   266k|        case NAL_TSA_N       :
  ------------------
  |  Branch (379:9): [True: 4.42k, False: 563k]
  ------------------
  380|   270k|        case NAL_TSA_R       :
  ------------------
  |  Branch (380:9): [True: 3.54k, False: 564k]
  ------------------
  381|   289k|        case NAL_STSA_N      :
  ------------------
  |  Branch (381:9): [True: 19.3k, False: 548k]
  ------------------
  382|   294k|        case NAL_STSA_R      :
  ------------------
  |  Branch (382:9): [True: 5.10k, False: 562k]
  ------------------
  383|   298k|        case NAL_RADL_N      :
  ------------------
  |  Branch (383:9): [True: 3.35k, False: 564k]
  ------------------
  384|   300k|        case NAL_RADL_R      :
  ------------------
  |  Branch (384:9): [True: 2.60k, False: 565k]
  ------------------
  385|   304k|        case NAL_RASL_N      :
  ------------------
  |  Branch (385:9): [True: 3.39k, False: 564k]
  ------------------
  386|   308k|        case NAL_RASL_R      :
  ------------------
  |  Branch (386:9): [True: 4.72k, False: 562k]
  ------------------
  387|   308k|            if(ps_codec->i4_header_mode)
  ------------------
  |  Branch (387:16): [True: 80.2k, False: 228k]
  ------------------
  388|  80.2k|                return IHEVCD_SLICE_IN_HEADER_MODE;
  389|       |
  390|   228k|            if((0 == ps_codec->i4_sps_done) ||
  ------------------
  |  Branch (390:16): [True: 4.15k, False: 224k]
  ------------------
  391|   224k|                            (0 == ps_codec->i4_pps_done))
  ------------------
  |  Branch (391:29): [True: 4.41k, False: 219k]
  ------------------
  392|  8.57k|            {
  393|  8.57k|                return IHEVCD_INVALID_HEADER;
  394|  8.57k|            }
  395|       |
  396|   219k|            ps_codec->i4_header_in_slice_mode = 0;
  397|   219k|            ps_codec->i4_cra_as_first_pic = 0;
  398|       |
  399|   219k|            ret = ihevcd_parse_slice_header(ps_codec, &s_nal);
  400|   219k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  401|   219k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (401:16): [True: 130k, False: 89.7k]
  ------------------
  402|   130k|            {
  403|   130k|                if((s_nal.i1_nal_unit_type != NAL_RASL_N && s_nal.i1_nal_unit_type != NAL_RASL_R) ||
  ------------------
  |  Branch (403:21): [True: 128k, False: 1.45k]
  |  Branch (403:61): [True: 126k, False: 2.47k]
  ------------------
  404|  3.93k|                                ps_codec->i4_rasl_output_flag ||
  ------------------
  |  Branch (404:33): [True: 267, False: 3.66k]
  ------------------
  405|  3.66k|                                ps_codec->i4_slice_error)
  ------------------
  |  Branch (405:33): [True: 588, False: 3.07k]
  ------------------
  406|   127k|                    ret = ihevcd_parse_slice_data(ps_codec);
  407|   130k|            }
  408|   219k|            break;
  409|       |
  410|  2.15k|        case NAL_VPS        :
  ------------------
  |  Branch (410:9): [True: 2.15k, False: 565k]
  ------------------
  411|       |            // ret = ihevcd_parse_vps(ps_codec);
  412|  2.15k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  413|  2.15k|            break;
  414|       |
  415|   122k|        case NAL_SPS        :
  ------------------
  |  Branch (415:9): [True: 122k, False: 445k]
  ------------------
  416|   122k|            if(0 == ps_codec->i4_header_mode)
  ------------------
  |  Branch (416:16): [True: 79.0k, False: 42.9k]
  ------------------
  417|  79.0k|            {
  418|  79.0k|                ps_codec->i4_header_in_slice_mode = 1;
  419|  79.0k|                if(ps_codec->i4_sps_done &&
  ------------------
  |  Branch (419:20): [True: 61.4k, False: 17.6k]
  ------------------
  420|  61.4k|                                ps_codec->i4_pic_present)
  ------------------
  |  Branch (420:33): [True: 10.7k, False: 50.6k]
  ------------------
  421|  10.7k|                    break;
  422|  79.0k|            }
  423|       |
  424|   111k|            ret = ihevcd_parse_sps(ps_codec);
  425|   111k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (425:16): [True: 42.1k, False: 69.0k]
  ------------------
  426|  42.1k|            {
  427|  42.1k|                sps_t *ps_sps = ps_codec->ps_sps_base + MAX_SPS_CNT - 1;
  ------------------
  |  |  327|  42.1k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  428|  42.1k|                ihevcd_copy_sps(ps_codec, ps_sps->i1_sps_id, MAX_SPS_CNT - 1);
  ------------------
  |  |  327|  42.1k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  429|  42.1k|            }
  430|   111k|            ps_codec->i4_error_code = ret;
  431|       |
  432|   111k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  433|   111k|            break;
  434|       |
  435|  90.6k|        case NAL_PPS        :
  ------------------
  |  Branch (435:9): [True: 90.6k, False: 477k]
  ------------------
  436|  90.6k|            if(0 == ps_codec->i4_header_mode)
  ------------------
  |  Branch (436:16): [True: 63.7k, False: 26.9k]
  ------------------
  437|  63.7k|            {
  438|  63.7k|                ps_codec->i4_header_in_slice_mode = 1;
  439|  63.7k|                if(ps_codec->i4_pps_done &&
  ------------------
  |  Branch (439:20): [True: 52.9k, False: 10.7k]
  ------------------
  440|  52.9k|                                ps_codec->i4_pic_present)
  ------------------
  |  Branch (440:33): [True: 6.80k, False: 46.1k]
  ------------------
  441|  6.80k|                    break;
  442|  63.7k|            }
  443|       |
  444|  83.8k|            ret = ihevcd_parse_pps(ps_codec);
  445|  83.8k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (445:16): [True: 62.6k, False: 21.1k]
  ------------------
  446|  62.6k|            {
  447|  62.6k|                pps_t *ps_pps = ps_codec->ps_pps_base + MAX_PPS_CNT - 1;
  ------------------
  |  |  344|  62.6k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  448|  62.6k|                ihevcd_copy_pps(ps_codec, ps_pps->i1_pps_id, MAX_PPS_CNT - 1);
  ------------------
  |  |  344|  62.6k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  449|  62.6k|            }
  450|  83.8k|            ps_codec->i4_error_code = ret;
  451|  83.8k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  452|  83.8k|            break;
  453|       |
  454|      0|#ifndef DISABLE_SEI
  455|  16.5k|        case NAL_PREFIX_SEI:
  ------------------
  |  Branch (455:9): [True: 16.5k, False: 551k]
  ------------------
  456|  19.9k|        case NAL_SUFFIX_SEI:
  ------------------
  |  Branch (456:9): [True: 3.41k, False: 564k]
  ------------------
  457|  19.9k|            if(IVD_DECODE_HEADER == ps_codec->i4_header_mode)
  ------------------
  |  Branch (457:16): [True: 5.50k, False: 14.4k]
  ------------------
  458|  5.50k|            {
  459|  5.50k|                return IHEVCD_SLICE_IN_HEADER_MODE;
  460|  5.50k|            }
  461|       |
  462|  14.4k|            ret = ihevcd_parse_sei(ps_codec, &s_nal);
  463|  14.4k|            break;
  464|       |
  465|      0|#endif
  466|    641|        case NAL_EOS        :
  ------------------
  |  Branch (466:9): [True: 641, False: 567k]
  ------------------
  467|    641|            ps_codec->i4_cra_as_first_pic = 1;
  468|    641|            break;
  469|       |
  470|  23.4k|        default:
  ------------------
  |  Branch (470:9): [True: 23.4k, False: 544k]
  ------------------
  471|  23.4k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  472|  23.4k|            break;
  473|   567k|    }
  474|       |
  475|   473k|    return ret;
  476|   567k|}

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

ihevcd_parse_residual_coding:
  185|  10.3M|{
  186|  10.3M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  187|  10.3M|    WORD32 transform_skip_flag;
  188|  10.3M|#ifdef ENABLE_MAIN_REXT_PROFILE
  189|  10.3M|    WORD32 explicit_rdpcm_flag, explicit_rdpcm_dir;
  190|  10.3M|#endif
  191|  10.3M|    WORD32 value;
  192|  10.3M|    sps_t *ps_sps;
  193|  10.3M|    pps_t *ps_pps;
  194|  10.3M|    WORD32 last_scan_pos, last_sub_blk;
  195|  10.3M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  196|  10.3M|    WORD32 last_significant_coeff_x_prefix, last_significant_coeff_y_prefix;
  197|  10.3M|    WORD32 last_significant_coeff_x, last_significant_coeff_y;
  198|  10.3M|    const UWORD8 *pu1_scan_blk = NULL, *pu1_scan_coeff;
  199|  10.3M|    WORD32 scan_idx;
  200|  10.3M|    WORD32 i;
  201|  10.3M|    WORD32 sign_data_hiding_flag;
  202|  10.3M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  203|  10.3M|    WORD32 gt1_ctxt = 1;
  204|  10.3M|    WORD32 c_max;
  205|  10.3M|    UWORD16 au2_csbf[9];
  206|  10.3M|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  207|  10.3M|    WORD8 *pi1_num_coded_subblks;
  208|  10.3M|    WORD32 num_subblks;
  209|  10.3M|    WORD32 sig_coeff_base_ctxt, abs_gt1_base_ctxt;
  210|  10.3M|    UNUSED(x0);
  ------------------
  |  |   38|  10.3M|#define UNUSED(x) ((void)(x))
  ------------------
  211|  10.3M|    UNUSED(y0);
  ------------------
  |  |   38|  10.3M|#define UNUSED(x) ((void)(x))
  ------------------
  212|  10.3M|    ps_sps = ps_codec->s_parse.ps_sps;
  213|  10.3M|    ps_pps = ps_codec->s_parse.ps_pps;
  214|       |
  215|  10.3M|    sign_data_hiding_flag = ps_pps->i1_sign_data_hiding_flag;
  216|  10.3M|    transform_skip_flag = 0;
  217|  10.3M|#ifdef ENABLE_MAIN_REXT_PROFILE
  218|  10.3M|    explicit_rdpcm_flag = 0;
  219|  10.3M|    explicit_rdpcm_dir = 0;
  220|  10.3M|#endif
  221|  10.3M|    if(ps_pps->i1_transform_skip_enabled_flag &&
  ------------------
  |  Branch (221:8): [True: 6.91M, False: 3.43M]
  ------------------
  222|  6.91M|       !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass &&
  ------------------
  |  Branch (222:8): [True: 6.74M, False: 169k]
  ------------------
  223|  6.74M|#ifdef ENABLE_MAIN_REXT_PROFILE
  224|  6.74M|       (log2_trafo_size <= ps_pps->i1_log2_max_transform_skip_block_size_minus2 + 2)
  ------------------
  |  Branch (224:8): [True: 2.92M, False: 3.82M]
  ------------------
  225|       |#else
  226|       |       (log2_trafo_size == 2)
  227|       |#endif
  228|  10.3M|       )
  229|  2.92M|    {
  230|  2.92M|        WORD32 ctxt_idx;
  231|       |
  232|  2.92M|        if(!c_idx)
  ------------------
  |  Branch (232:12): [True: 1.63M, False: 1.28M]
  ------------------
  233|  1.63M|        {
  234|  1.63M|            ctxt_idx = IHEVC_CAB_TFM_SKIP0;
  235|  1.63M|        }
  236|  1.28M|        else
  237|  1.28M|        {
  238|  1.28M|            ctxt_idx = IHEVC_CAB_TFM_SKIP12;
  239|  1.28M|        }
  240|  2.92M|        TRACE_CABAC_CTXT("transform_skip_flag", ps_cabac->u4_range, ctxt_idx);
  241|  2.92M|        value = ihevcd_cabac_decode_bin(ps_cabac,
  242|  2.92M|                                        ps_bitstrm,
  243|  2.92M|                                        ctxt_idx);
  244|  2.92M|        AEV_TRACE("transform_skip_flag", value, ps_cabac->u4_range);
  245|  2.92M|        transform_skip_flag = value;
  246|  2.92M|    }
  247|       |
  248|  10.3M|#ifdef ENABLE_MAIN_REXT_PROFILE
  249|  10.3M|    if(PRED_MODE_INTER == ps_codec->s_parse.s_cu.i4_pred_mode
  ------------------
  |  Branch (249:8): [True: 379k, False: 9.97M]
  ------------------
  250|   379k|                    && ps_sps->i1_explicit_rdpcm_enabled_flag
  ------------------
  |  Branch (250:24): [True: 3.57k, False: 375k]
  ------------------
  251|  3.57k|                    && (transform_skip_flag || ps_codec->s_parse.s_cu.i4_cu_transquant_bypass))
  ------------------
  |  Branch (251:25): [True: 427, False: 3.14k]
  |  Branch (251:48): [True: 2.20k, False: 940]
  ------------------
  252|       |
  253|  2.63k|    {
  254|  2.63k|        WORD32 ctxt_idx = IHEVC_CAB_EXPLICIT_RDPCM_FLAG + (c_idx != 0);
  255|  2.63k|        TRACE_CABAC_CTXT("explicit_rdpcm_flag", ps_cabac->u4_range, ctxt_idx);
  256|  2.63k|        value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  257|  2.63k|        AEV_TRACE("explicit_rdpcm_flag", value, ps_cabac->u4_range);
  258|  2.63k|        explicit_rdpcm_flag = value;
  259|       |
  260|  2.63k|        if(explicit_rdpcm_flag)
  ------------------
  |  Branch (260:12): [True: 1.76k, False: 874]
  ------------------
  261|  1.76k|        {
  262|  1.76k|            ctxt_idx = IHEVC_CAB_EXPLICIT_RDPCM_DIR + (c_idx != 0);
  263|  1.76k|            TRACE_CABAC_CTXT("explicit_rdpcm_dir_flag", ps_cabac->u4_range, ctxt_idx);
  264|  1.76k|            value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  265|  1.76k|            AEV_TRACE("explicit_rdpcm_dir_flag", value, ps_cabac->u4_range);
  266|  1.76k|            explicit_rdpcm_dir = value;
  267|  1.76k|        }
  268|  2.63k|    }
  269|  10.3M|#endif
  270|       |
  271|       |    /* code the last_coeff_x_prefix as tunary binarized code */
  272|  10.3M|    {
  273|  10.3M|        WORD32 ctxt_idx_x, ctxt_idx_y, ctx_shift;
  274|  10.3M|        WORD32 ctx_offset;
  275|  10.3M|        c_max = (log2_trafo_size << 1) - 1;
  276|       |
  277|  10.3M|        if(!c_idx)
  ------------------
  |  Branch (277:12): [True: 5.87M, False: 4.48M]
  ------------------
  278|  5.87M|        {
  279|  5.87M|            ctx_offset = (3 * (log2_trafo_size - 2)) + ((log2_trafo_size - 1) >> 2);
  280|  5.87M|            ctxt_idx_x = IHEVC_CAB_COEFFX_PREFIX + ctx_offset;
  281|  5.87M|            ctxt_idx_y = IHEVC_CAB_COEFFY_PREFIX + ctx_offset;
  282|  5.87M|            ctx_shift  = (log2_trafo_size + 1) >> 2;
  283|  5.87M|        }
  284|  4.48M|        else
  285|  4.48M|        {
  286|  4.48M|            ctxt_idx_x = IHEVC_CAB_COEFFX_PREFIX + 15;
  287|  4.48M|            ctxt_idx_y = IHEVC_CAB_COEFFY_PREFIX + 15;
  288|  4.48M|            ctx_shift  = log2_trafo_size  - 2;
  289|  4.48M|        }
  290|       |
  291|  10.3M|        TRACE_CABAC_CTXT("last_coeff_x_prefix", ps_cabac->u4_range, ctxt_idx_x);
  292|  10.3M|        last_significant_coeff_x_prefix = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  293|  10.3M|                                                                          ps_bitstrm,
  294|  10.3M|                                                                          c_max,
  295|  10.3M|                                                                          ctxt_idx_x,
  296|  10.3M|                                                                          ctx_shift,
  297|  10.3M|                                                                          c_max);
  298|       |
  299|  10.3M|        AEV_TRACE("last_coeff_x_prefix", last_significant_coeff_x_prefix, ps_cabac->u4_range);
  300|       |
  301|  10.3M|        TRACE_CABAC_CTXT("last_coeff_y_prefix", ps_cabac->u4_range, ctxt_idx_y);
  302|  10.3M|        last_significant_coeff_y_prefix = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  303|  10.3M|                                                                          ps_bitstrm,
  304|  10.3M|                                                                          c_max,
  305|  10.3M|                                                                          ctxt_idx_y,
  306|  10.3M|                                                                          ctx_shift,
  307|  10.3M|                                                                          c_max);
  308|       |
  309|  10.3M|        AEV_TRACE("last_coeff_y_prefix", last_significant_coeff_y_prefix, ps_cabac->u4_range);
  310|       |
  311|       |
  312|  10.3M|        last_significant_coeff_x = last_significant_coeff_x_prefix;
  313|  10.3M|        if(last_significant_coeff_x_prefix > 3)
  ------------------
  |  Branch (313:12): [True: 1.29M, False: 9.06M]
  ------------------
  314|  1.29M|        {
  315|  1.29M|            WORD32 suf_length = ((last_significant_coeff_x_prefix - 2) >> 1);
  316|       |
  317|  1.29M|            value = ihevcd_cabac_decode_bypass_bins(ps_cabac,
  318|  1.29M|                                                    ps_bitstrm,
  319|  1.29M|                                                    suf_length);
  320|       |
  321|  1.29M|            AEV_TRACE("last_coeff_x_suffix", value, ps_cabac->u4_range);
  322|       |
  323|       |
  324|  1.29M|            last_significant_coeff_x =
  325|  1.29M|                            (1 << ((last_significant_coeff_x_prefix >> 1) - 1)) *
  326|  1.29M|                            (2 + (last_significant_coeff_x_prefix & 1)) + value;
  327|  1.29M|        }
  328|       |
  329|       |
  330|  10.3M|        last_significant_coeff_y = last_significant_coeff_y_prefix;
  331|  10.3M|        if(last_significant_coeff_y_prefix > 3)
  ------------------
  |  Branch (331:12): [True: 1.27M, False: 9.08M]
  ------------------
  332|  1.27M|        {
  333|  1.27M|            WORD32 suf_length = ((last_significant_coeff_y_prefix - 2) >> 1);
  334|  1.27M|            value = ihevcd_cabac_decode_bypass_bins(ps_cabac,
  335|  1.27M|                                                    ps_bitstrm,
  336|  1.27M|                                                    suf_length);
  337|       |
  338|  1.27M|            AEV_TRACE("last_coeff_y_suffix", value, ps_cabac->u4_range);
  339|  1.27M|            last_significant_coeff_y =
  340|  1.27M|                            (1 << ((last_significant_coeff_y_prefix >> 1) - 1)) *
  341|  1.27M|                            (2 + (last_significant_coeff_y_prefix & 1)) + value;
  342|  1.27M|        }
  343|       |
  344|  10.3M|    }
  345|       |
  346|       |    /* Choose a scan matrix based on intra flag, intra pred mode, transform size
  347|       |     and luma/chroma */
  348|  10.3M|    scan_idx = SCAN_DIAG_UPRIGHT;
  349|  10.3M|    if(PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode)
  ------------------
  |  Branch (349:8): [True: 9.97M, False: 379k]
  ------------------
  350|  9.97M|    {
  351|  9.97M|        int is_YUV444 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444;
  352|  9.97M|        if((2 == log2_trafo_size) || ((3 == log2_trafo_size) && (0 == c_idx || is_YUV444)))
  ------------------
  |  Branch (352:12): [True: 4.92M, False: 5.05M]
  |  Branch (352:39): [True: 1.76M, False: 3.29M]
  |  Branch (352:66): [True: 1.02M, False: 739k]
  |  Branch (352:80): [True: 0, False: 739k]
  ------------------
  353|  5.95M|        {
  354|  5.95M|            if((6 <= intra_pred_mode) &&
  ------------------
  |  Branch (354:16): [True: 2.33M, False: 3.61M]
  ------------------
  355|  2.33M|               (14 >= intra_pred_mode))
  ------------------
  |  Branch (355:16): [True: 550k, False: 1.78M]
  ------------------
  356|   550k|            {
  357|   550k|                scan_idx = SCAN_VERT;
  358|   550k|            }
  359|  5.39M|            else if((22 <= intra_pred_mode) &&
  ------------------
  |  Branch (359:21): [True: 1.38M, False: 4.01M]
  ------------------
  360|  1.38M|                    (30 >= intra_pred_mode))
  ------------------
  |  Branch (360:21): [True: 1.08M, False: 299k]
  ------------------
  361|  1.08M|            {
  362|  1.08M|                scan_idx = SCAN_HORZ;
  363|  1.08M|            }
  364|  5.95M|        }
  365|  9.97M|    }
  366|       |
  367|       |    /* In case the scan is vertical, then swap  X and Y positions */
  368|  10.3M|    if(SCAN_VERT == scan_idx)
  ------------------
  |  Branch (368:8): [True: 550k, False: 9.80M]
  ------------------
  369|   550k|    {
  370|   550k|        SWAP(last_significant_coeff_x, last_significant_coeff_y);
  ------------------
  |  |   87|   550k|#define SWAP(X,Y)                   \
  |  |   88|   550k|{                                   \
  |  |   89|   550k|    (X) = (X) ^ (Y);                \
  |  |   90|   550k|    (Y) = (X) ^ (Y);                \
  |  |   91|   550k|    (X) = (X) ^ (Y);                \
  |  |   92|   550k|}
  ------------------
  371|   550k|    }
  372|       |
  373|  10.3M|    {
  374|  10.3M|        WORD8 *pi1_scan_idx;
  375|  10.3M|        WORD8 *pi1_buf = (WORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
  376|       |
  377|       |        /* First WORD8 gives number of coded subblocks */
  378|  10.3M|        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|  10.3M|        *pi1_num_coded_subblks = 0;
  383|       |
  384|  10.3M|        pi1_scan_idx = pi1_buf++;
  385|  10.3M|#ifdef ENABLE_MAIN_REXT_PROFILE
  386|       |        /* Second WORD8 gives (explicit_rdpcm_dir << 5) | (explicit_rdpcm_flag << 4) | (scan idx << 1) | trans_skip */
  387|  10.3M|        *pi1_scan_idx = (explicit_rdpcm_dir << 5) | (explicit_rdpcm_flag << 4) | (scan_idx << 1)
  388|  10.3M|                        | 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|  10.3M|        ps_codec->s_parse.pv_tu_coeff_data = pi1_buf;
  396|       |
  397|  10.3M|    }
  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|  10.3M|    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|  10.3M|    if(log2_trafo_size > 2)
  ------------------
  |  Branch (409:8): [True: 5.26M, False: 5.09M]
  ------------------
  410|  5.26M|    {
  411|  5.26M|        WORD32 scan_pos;
  412|  5.26M|        WORD32 scan_mat_size;
  413|  5.26M|        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|  5.26M|        scan_mat_size = 1 << (log2_trafo_size - 2);
  419|  5.26M|        scan_pos = ((last_significant_coeff_y >> 2) * scan_mat_size) +
  420|  5.26M|                        (last_significant_coeff_x >> 2);
  421|       |
  422|  5.26M|        last_sub_blk = pu1_scan_blk[scan_pos];
  423|  5.26M|    }
  424|  10.3M|    pu1_scan_coeff  = &gau1_ihevc_scan4x4[scan_idx][0];
  425|       |
  426|  10.3M|    {
  427|  10.3M|        WORD32 scan_pos;
  428|       |
  429|  10.3M|        scan_pos = ((last_significant_coeff_y & 3) << 2) +
  430|  10.3M|                        (last_significant_coeff_x & 3);
  431|       |
  432|  10.3M|        last_scan_pos = pu1_scan_coeff[scan_pos];
  433|  10.3M|    }
  434|  10.3M|    if(log2_trafo_size > 2)
  ------------------
  |  Branch (434:8): [True: 5.26M, False: 5.09M]
  ------------------
  435|  5.26M|        pu1_scan_blk = (UWORD8 *)gapv_ihevc_invscan[scan_idx * 3 + (log2_trafo_size - 2 - 1)];
  436|  10.3M|    pu1_scan_coeff  = &gau1_ihevc_invscan4x4[scan_idx][0];
  437|       |
  438|       |    /* Set CSBF array to zero */
  439|  10.3M|    {
  440|  10.3M|        UWORD32 *pu4_csbf;
  441|  10.3M|        pu4_csbf = (void *)au2_csbf;
  442|  10.3M|        *pu4_csbf++ = 0;
  443|  10.3M|        *pu4_csbf++ = 0;
  444|  10.3M|        *pu4_csbf++ = 0;
  445|  10.3M|        *pu4_csbf = 0;
  446|       |        /* To avoid a check for y pos, 9th WORD16 in the array is set to zero */
  447|  10.3M|        au2_csbf[8] = 0;
  448|  10.3M|    }
  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|  10.3M|    if(!c_idx)
  ------------------
  |  Branch (454:8): [True: 5.87M, False: 4.48M]
  ------------------
  455|  5.87M|    {
  456|  5.87M|        sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG;
  457|  5.87M|        abs_gt1_base_ctxt = IHEVC_CAB_COEFABS_GRTR1_FLAG;
  458|       |
  459|  5.87M|        if(3 == log2_trafo_size)
  ------------------
  |  Branch (459:12): [True: 1.10M, False: 4.77M]
  ------------------
  460|  1.10M|        {
  461|       |            /* 8x8 transform size */
  462|  1.10M|            sig_coeff_base_ctxt += (scan_idx == SCAN_DIAG_UPRIGHT) ? 9 : 15;
  ------------------
  |  Branch (462:36): [True: 726k, False: 376k]
  ------------------
  463|  1.10M|        }
  464|  4.77M|        else  if(3 < log2_trafo_size)
  ------------------
  |  Branch (464:18): [True: 1.99M, False: 2.77M]
  ------------------
  465|  1.99M|        {
  466|       |            /* larger transform sizes */
  467|  1.99M|            sig_coeff_base_ctxt += 21;
  468|  1.99M|        }
  469|  5.87M|    }
  470|  4.48M|    else
  471|  4.48M|    {
  472|       |        /* chroma context initializations */
  473|  4.48M|        sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG + 27;
  474|  4.48M|        abs_gt1_base_ctxt = IHEVC_CAB_COEFABS_GRTR1_FLAG + 16;
  475|       |
  476|  4.48M|        if(3 == log2_trafo_size)
  ------------------
  |  Branch (476:12): [True: 745k, False: 3.73M]
  ------------------
  477|   745k|        {
  478|       |            /* 8x8 transform size */
  479|   745k|            sig_coeff_base_ctxt += 9;
  480|   745k|        }
  481|  3.73M|        else  if(3 < log2_trafo_size)
  ------------------
  |  Branch (481:18): [True: 1.42M, False: 2.31M]
  ------------------
  482|  1.42M|        {
  483|       |            /* larger transform sizes */
  484|  1.42M|            sig_coeff_base_ctxt += 12;
  485|  1.42M|        }
  486|  4.48M|    }
  487|  10.3M|    num_subblks = 0;
  488|       |    /* Parse each 4x4 subblocks */
  489|  29.8M|    for(i = last_sub_blk; i >= 0; i--)
  ------------------
  |  Branch (489:27): [True: 19.5M, False: 10.3M]
  ------------------
  490|  19.5M|    {
  491|  19.5M|        WORD32 sub_blk_pos;
  492|  19.5M|        WORD32 infer_sig_coeff_flag;
  493|  19.5M|        WORD32 cur_csbf;
  494|       |
  495|  19.5M|        WORD32 n;
  496|  19.5M|        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|  19.5M|        UWORD32 u4_sig_coeff_map_raster;
  503|  19.5M|        WORD32 sign_hidden;
  504|       |
  505|       |        /* Sig coeff map in scan order */
  506|  19.5M|        UWORD32 u4_sig_coeff_map;
  507|  19.5M|        WORD32 coeff_abs_level_greater2_flag;
  508|  19.5M|        UWORD32 u4_coeff_abs_level_greater1_map;
  509|  19.5M|        UWORD32 u4_coeff_abs_level_greater2_map;
  510|  19.5M|        UWORD32 u4_coeff_sign_map;
  511|  19.5M|        WORD32 first_sig_scan_pos, last_sig_scan_pos, num_greater1_flag, first_greater1_scan_pos;
  512|  19.5M|        WORD32  num_sig_coeff, sum_abs_level;
  513|  19.5M|        WORD32 nbr_csbf;
  514|       |
  515|       |
  516|  19.5M|        WORD32 ctxt_set;
  517|  19.5M|        WORD32 rice_param;
  518|  19.5M|        WORD32 xs, ys;
  519|       |
  520|  19.5M|#ifdef ENABLE_MAIN_REXT_PROFILE
  521|  19.5M|        WORD8 i1_update_stats = ps_sps->i1_persistent_rice_adaptation_enabled_flag;
  522|  19.5M|#endif
  523|       |
  524|  19.5M|        sub_blk_pos  = 0;
  525|  19.5M|        if(i && (log2_trafo_size > 2))
  ------------------
  |  Branch (525:12): [True: 9.16M, False: 10.3M]
  |  Branch (525:17): [True: 9.16M, False: 0]
  ------------------
  526|  9.16M|            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|  19.5M|        xs = sub_blk_pos & ((1 << (log2_trafo_size - 2)) - 1);
  531|  19.5M|        ys = sub_blk_pos >> (log2_trafo_size - 2);
  532|       |
  533|       |
  534|       |        /* Check if neighbor subblocks are coded */
  535|  19.5M|        {
  536|       |
  537|  19.5M|            nbr_csbf = 0;
  538|       |
  539|       |            /* Get Bottom sub blocks CSBF */
  540|  19.5M|            nbr_csbf |= (au2_csbf[ys + 1] >> xs) & 1;
  541|  19.5M|            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|  19.5M|            nbr_csbf |= (au2_csbf[ys] >> (xs + 1)) & 1;
  549|       |
  550|       |
  551|  19.5M|        }
  552|  19.5M|        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|  19.5M|        infer_sig_coeff_flag = 0;
  557|  19.5M|        if((i < last_sub_blk) && (i > 0))
  ------------------
  |  Branch (557:12): [True: 9.16M, False: 10.3M]
  |  Branch (557:34): [True: 7.18M, False: 1.98M]
  ------------------
  558|  7.18M|        {
  559|  7.18M|            WORD32 ctxt_idx  = IHEVC_CAB_CODED_SUBLK_IDX;
  560|       |
  561|       |            /* ctxt based on right / bottom avail csbf, section 9.3.3.1.3 */
  562|  7.18M|            ctxt_idx += (nbr_csbf) ? 1 : 0;
  ------------------
  |  Branch (562:25): [True: 3.26M, False: 3.91M]
  ------------------
  563|       |
  564|       |            /* Ctxt based on luma or chroma */
  565|  7.18M|            ctxt_idx += c_idx  ? 2 : 0;
  ------------------
  |  Branch (565:25): [True: 1.59M, False: 5.58M]
  ------------------
  566|  7.18M|            TRACE_CABAC_CTXT("coded_sub_block_flag", ps_cabac->u4_range, ctxt_idx);
  567|  7.18M|            IHEVCD_CABAC_DECODE_BIN(cur_csbf, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  7.18M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  7.18M|{                                                                               \
  |  |   61|  7.18M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  7.18M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  7.18M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  7.18M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  7.18M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  7.18M|    WORD32 clz;                                                                 \
  |  |   67|  7.18M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  7.18M|                                                                                \
  |  |   69|  7.18M|    /* Sanity checks */                                                         \
  |  |   70|  7.18M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  7.18M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  7.18M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  7.18M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  7.18M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  7.18M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  7.18M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  7.18M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  7.18M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  7.18M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  7.18M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  7.18M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  7.18M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  7.18M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  7.18M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  7.18M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  7.18M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  7.18M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  7.18M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  7.18M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  7.18M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  7.18M|                                                                                \
  |  |   83|  7.18M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  7.18M|                                                                                \
  |  |   85|  7.18M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 373k, False: 6.80M]
  |  |  ------------------
  |  |   86|  7.18M|    {                                                                           \
  |  |   87|   373k|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|   373k|        u4_ofst -= u4_range;                                                    \
  |  |   89|   373k|        u4_range = u4_rlps;                                                     \
  |  |   90|   373k|    }                                                                           \
  |  |   91|  7.18M|                                                                                \
  |  |   92|  7.18M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  7.18M|                                                                                \
  |  |   94|  7.18M|    /*****************************************************************/         \
  |  |   95|  7.18M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  7.18M|    /*****************************************************************/         \
  |  |   97|  7.18M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 62.5k, False: 7.11M]
  |  |  ------------------
  |  |   98|  7.18M|    {                                                                           \
  |  |   99|  62.5k|        UWORD32 u4_bits;                                                        \
  |  |  100|  62.5k|        WORD32 numbits;                                                         \
  |  |  101|  62.5k|        numbits = CLZ(u4_range);                                                \
  |  |  102|  62.5k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  62.5k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  62.5k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  62.5k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  62.5k|{                                                               \
  |  |  |  |  152|  62.5k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  62.5k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  62.5k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  62.5k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  62.5k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   125k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 45.5k, False: 17.0k]
  |  |  |  |  ------------------
  |  |  |  |  156|  62.5k|    {                                                           \
  |  |  |  |  157|  45.5k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  45.5k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 45.5k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  45.5k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  45.5k|    }                                                           \
  |  |  |  |  160|  62.5k|                                                                \
  |  |  |  |  161|  62.5k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   125k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 47.2k, False: 15.3k]
  |  |  |  |  ------------------
  |  |  |  |  162|  62.5k|    {                                                           \
  |  |  |  |  163|  47.2k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  47.2k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  47.2k|        /* Getting the next word */                             \
  |  |  |  |  166|  47.2k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  47.2k|                                                                \
  |  |  |  |  168|  47.2k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  47.2k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  47.2k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  47.2k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  47.2k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  47.2k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  47.2k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  47.2k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  47.2k|    }                                                           \
  |  |  |  |  172|  62.5k|}
  |  |  ------------------
  |  |  104|  62.5k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  62.5k|                                                                                \
  |  |  106|  62.5k|        u4_ofst <<= numbits;                                                    \
  |  |  107|  62.5k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  62.5k|        u4_range <<= numbits;                                                   \
  |  |  109|  62.5k|                                                                                \
  |  |  110|  62.5k|    }                                                                           \
  |  |  111|  7.18M|    /* Update the cabac context */                                              \
  |  |  112|  7.18M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  7.18M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  7.18M|                                                                                \
  |  |  115|  7.18M|}
  ------------------
  568|  7.18M|            AEV_TRACE("coded_sub_block_flag", cur_csbf, ps_cabac->u4_range);
  569|       |
  570|  7.18M|            infer_sig_coeff_flag = 1;
  571|  7.18M|        }
  572|  12.3M|        else /* if((i == last_sub_blk) || (sub_blk_pos == 0)) */
  573|  12.3M|        {
  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|  12.3M|            cur_csbf = 1;
  577|  12.3M|        }
  578|       |
  579|       |        /* Set current sub blocks CSBF */
  580|  19.5M|        {
  581|  19.5M|            UWORD32 u4_mask = 1 << xs;
  582|  19.5M|            if(cur_csbf)
  ------------------
  |  Branch (582:16): [True: 15.2M, False: 4.32M]
  ------------------
  583|  15.2M|                au2_csbf[ys] |= u4_mask;
  584|  4.32M|            else
  585|  4.32M|                au2_csbf[ys] &= ~u4_mask;
  586|       |
  587|  19.5M|        }
  588|       |
  589|       |        /* If current subblock is not coded, proceed to the next subblock */
  590|  19.5M|        if(0 == cur_csbf)
  ------------------
  |  Branch (590:12): [True: 4.32M, False: 15.2M]
  ------------------
  591|  4.32M|            continue;
  592|       |
  593|  15.2M|        n = 15;
  594|  15.2M|        u4_sig_coeff_map_raster = 0;
  595|  15.2M|        u4_sig_coeff_map = 0;
  596|  15.2M|        num_coeff = 0;
  597|  15.2M|        if(i == last_sub_blk)
  ------------------
  |  Branch (597:12): [True: 10.3M, False: 4.84M]
  ------------------
  598|  10.3M|        {
  599|  10.3M|            WORD32 pos = ((last_significant_coeff_y & 3) << 2) +
  600|  10.3M|                            (last_significant_coeff_x & 3);
  601|  10.3M|            n = (last_scan_pos - 1);
  602|       |            /* Set Significant coeff map for last significant coeff flag as 1 */
  603|  10.3M|            u4_sig_coeff_map_raster = 1 << pos;
  604|  10.3M|            u4_sig_coeff_map = 1 << last_scan_pos;
  605|  10.3M|            num_coeff = 1;
  606|  10.3M|        }
  607|       |
  608|   132M|        for(; n >= 0; n--)
  ------------------
  |  Branch (608:15): [True: 117M, False: 15.2M]
  ------------------
  609|   117M|        {
  610|   117M|            WORD32 significant_coeff_flag;
  611|       |
  612|   117M|            if((n > 0 || !infer_sig_coeff_flag))
  ------------------
  |  Branch (612:17): [True: 107M, False: 10.4M]
  |  Branch (612:26): [True: 9.79M, False: 630k]
  ------------------
  613|   116M|            {
  614|       |                //WORD32 coeff_pos;
  615|   116M|                WORD32 sig_ctxinc;
  616|   116M|                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|   116M|                sig_ctxinc = 0;
  622|   116M|#ifdef ENABLE_MAIN_REXT_PROFILE
  623|   116M|                if(ps_sps->i1_transform_skip_context_enabled_flag
  ------------------
  |  Branch (623:20): [True: 111k, False: 116M]
  ------------------
  624|   111k|                                && (ps_codec->s_parse.s_cu.i4_cu_transquant_bypass
  ------------------
  |  Branch (624:37): [True: 33.5k, False: 78.1k]
  ------------------
  625|  78.1k|                                                || transform_skip_flag))
  ------------------
  |  Branch (625:52): [True: 32.5k, False: 45.6k]
  ------------------
  626|  66.1k|                {
  627|  66.1k|                    sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG;
  628|  66.1k|                    sig_coeff_base_ctxt += (0 == c_idx) ? 42 : 43;
  ------------------
  |  Branch (628:44): [True: 63.3k, False: 2.75k]
  ------------------
  629|  66.1k|                }
  630|   116M|                else if(2 == log2_trafo_size)
  ------------------
  |  Branch (630:25): [True: 29.4M, False: 87.3M]
  ------------------
  631|       |#else
  632|       |                if(2 == log2_trafo_size)
  633|       |#endif
  634|  29.4M|                {
  635|       |
  636|       |                    /* 4x4 transform size increment uses lookup */
  637|  29.4M|                    sig_ctxinc = gau1_ihevcd_sigcoeff_ctxtinc_tr4[scan_idx][n];
  638|  29.4M|                }
  639|  87.3M|                else if(n || i)
  ------------------
  |  Branch (639:25): [True: 80.9M, False: 6.43M]
  |  Branch (639:30): [True: 3.09M, False: 3.34M]
  ------------------
  640|  84.0M|                {
  641|       |                    /* ctxt for AC coeff depends on curpos and neigbour csbf */
  642|  84.0M|                    sig_ctxinc = gau1_ihevcd_sigcoeff_ctxtinc[scan_idx][nbr_csbf][n];
  643|       |
  644|       |                    /* based on luma subblock pos */
  645|  84.0M|                    sig_ctxinc += (i && (!c_idx)) ? 3 : 0;
  ------------------
  |  Branch (645:36): [True: 49.9M, False: 34.0M]
  |  Branch (645:41): [True: 40.3M, False: 9.62M]
  ------------------
  646|       |
  647|  84.0M|                }
  648|  3.34M|                else
  649|  3.34M|                {
  650|       |                    /* DC coeff has fixed context for luma and chroma */
  651|  3.34M|                    sig_coeff_base_ctxt = (0 == c_idx) ? IHEVC_CAB_COEFF_FLAG :
  ------------------
  |  Branch (651:43): [True: 2.25M, False: 1.09M]
  ------------------
  652|  3.34M|                                                         (IHEVC_CAB_COEFF_FLAG + 27);
  653|  3.34M|                }
  654|       |
  655|   116M|                ctxt_idx = sig_ctxinc + sig_coeff_base_ctxt;
  656|   116M|                TRACE_CABAC_CTXT("significant_coeff_flag", ps_cabac->u4_range, ctxt_idx);
  657|   116M|                IHEVCD_CABAC_DECODE_BIN(significant_coeff_flag, ps_cabac,
  ------------------
  |  |   59|   116M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|   116M|{                                                                               \
  |  |   61|   116M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|   116M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|   116M|    UWORD32 u4_rlps;                                                            \
  |  |   64|   116M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|   116M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|   116M|    WORD32 clz;                                                                 \
  |  |   67|   116M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|   116M|                                                                                \
  |  |   69|   116M|    /* Sanity checks */                                                         \
  |  |   70|   116M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   116M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|   116M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   116M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|   116M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|   116M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|   116M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|   116M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|   116M|    clz = CLZ(u4_range);                                                        \
  |  |   75|   116M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|   116M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|   116M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|   116M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|   116M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|   116M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|   116M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|   116M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|   116M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|   116M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|   116M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|   116M|    u4_range -= u4_rlps;                                                        \
  |  |   82|   116M|                                                                                \
  |  |   83|   116M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|   116M|                                                                                \
  |  |   85|   116M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 10.2M, False: 106M]
  |  |  ------------------
  |  |   86|   116M|    {                                                                           \
  |  |   87|  10.2M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  10.2M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  10.2M|        u4_range = u4_rlps;                                                     \
  |  |   90|  10.2M|    }                                                                           \
  |  |   91|   116M|                                                                                \
  |  |   92|   116M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|   116M|                                                                                \
  |  |   94|   116M|    /*****************************************************************/         \
  |  |   95|   116M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|   116M|    /*****************************************************************/         \
  |  |   97|   116M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 1.43M, False: 115M]
  |  |  ------------------
  |  |   98|   116M|    {                                                                           \
  |  |   99|  1.43M|        UWORD32 u4_bits;                                                        \
  |  |  100|  1.43M|        WORD32 numbits;                                                         \
  |  |  101|  1.43M|        numbits = CLZ(u4_range);                                                \
  |  |  102|  1.43M|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  1.43M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  1.43M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  1.43M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  1.43M|{                                                               \
  |  |  |  |  152|  1.43M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  1.43M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.43M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  1.43M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  1.43M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.86M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 993k, False: 437k]
  |  |  |  |  ------------------
  |  |  |  |  156|  1.43M|    {                                                           \
  |  |  |  |  157|   993k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   993k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 993k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   993k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   993k|    }                                                           \
  |  |  |  |  160|  1.43M|                                                                \
  |  |  |  |  161|  1.43M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.86M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 1.03M, False: 392k]
  |  |  |  |  ------------------
  |  |  |  |  162|  1.43M|    {                                                           \
  |  |  |  |  163|  1.03M|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  1.03M|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  1.03M|        /* Getting the next word */                             \
  |  |  |  |  166|  1.03M|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  1.03M|                                                                \
  |  |  |  |  168|  1.03M|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.03M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  1.03M|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  1.03M|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  1.03M|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  1.03M|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  1.03M|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  1.03M|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  1.03M|    }                                                           \
  |  |  |  |  172|  1.43M|}
  |  |  ------------------
  |  |  104|  1.43M|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  1.43M|                                                                                \
  |  |  106|  1.43M|        u4_ofst <<= numbits;                                                    \
  |  |  107|  1.43M|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  1.43M|        u4_range <<= numbits;                                                   \
  |  |  109|  1.43M|                                                                                \
  |  |  110|  1.43M|    }                                                                           \
  |  |  111|   116M|    /* Update the cabac context */                                              \
  |  |  112|   116M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|   116M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|   116M|                                                                                \
  |  |  115|   116M|}
  ------------------
  658|   116M|                                        ps_bitstrm,
  659|   116M|                                        ctxt_idx);
  660|   116M|                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|   116M|                if(significant_coeff_flag)
  ------------------
  |  Branch (665:20): [True: 51.2M, False: 65.6M]
  ------------------
  666|  51.2M|                    infer_sig_coeff_flag = 0;
  667|       |
  668|       |//                u4_sig_coeff_map_raster |= significant_coeff_flag
  669|       |//                              << coeff_pos;
  670|   116M|                u4_sig_coeff_map |= significant_coeff_flag << n;
  671|   116M|                num_coeff += significant_coeff_flag;
  672|   116M|            }
  673|       |
  674|       |
  675|   117M|        }
  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|  15.2M|        if(infer_sig_coeff_flag)
  ------------------
  |  Branch (681:12): [True: 630k, False: 14.5M]
  ------------------
  682|   630k|        {
  683|   630k|            u4_sig_coeff_map_raster |= 1;
  684|   630k|            u4_sig_coeff_map |= 1;
  685|   630k|            num_coeff++;
  686|   630k|        }
  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|  15.2M|        if(0 == num_coeff)
  ------------------
  |  Branch (695:12): [True: 411k, False: 14.7M]
  ------------------
  696|   411k|            continue;
  697|       |
  698|       |        /* Increment number of coded subblocks for the current TU */
  699|  14.7M|        num_subblks++;
  700|       |
  701|       |        /* Set sig coeff map and subblock position */
  702|  14.7M|        ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)ps_codec->s_parse.pv_tu_coeff_data;
  703|  14.7M|        ps_tu_sblk_coeff_data->u2_sig_coeff_map = u4_sig_coeff_map;
  704|  14.7M|        ps_tu_sblk_coeff_data->u2_subblk_pos = (ys << 8) | xs;
  705|       |
  706|  14.7M|        first_sig_scan_pos = 16;
  707|  14.7M|        last_sig_scan_pos = -1;
  708|  14.7M|        num_greater1_flag = 0;
  709|  14.7M|        first_greater1_scan_pos = -1;
  710|  14.7M|        u4_coeff_abs_level_greater1_map = 0;
  711|       |
  712|       |
  713|       |        /* context set based on luma subblock pos */
  714|  14.7M|        ctxt_set = (i && (!c_idx)) ? 2 : 0;
  ------------------
  |  Branch (714:21): [True: 4.84M, False: 9.94M]
  |  Branch (714:26): [True: 3.68M, False: 1.15M]
  ------------------
  715|       |
  716|       |        /* See section 9.3.3.1.5           */
  717|  14.7M|        ctxt_set += (0 == gt1_ctxt) ? 1 : 0;
  ------------------
  |  Branch (717:21): [True: 1.12M, False: 13.6M]
  ------------------
  718|       |
  719|  14.7M|        gt1_ctxt = 1;
  720|       |        /* Instead of initializing n to 15, set it to 31-CLZ(sig coeff map) */
  721|  14.7M|        {
  722|  14.7M|            UWORD32 u4_sig_coeff_map_shift;
  723|  14.7M|            UWORD32 clz;
  724|  14.7M|            clz = CLZ(u4_sig_coeff_map);
  725|  14.7M|            n = 31 - clz;
  726|  14.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|  14.7M|            do
  729|  51.6M|            {
  730|       |                //WORD32 coeff_pos;
  731|  51.6M|                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|  51.6M|                if((u4_sig_coeff_map_shift >> 31) & 1)
  ------------------
  |  Branch (736:20): [True: 51.6M, False: 0]
  ------------------
  737|  51.6M|                {
  738|       |
  739|       |                    /* abs_level_greater1_flag is sent for only first 8 non-zero levels in a subblock */
  740|  51.6M|                    if(num_greater1_flag < 8)
  ------------------
  |  Branch (740:24): [True: 49.3M, False: 2.29M]
  ------------------
  741|  49.3M|                    {
  742|  49.3M|                        WORD32 coeff_abs_level_greater1_flag;
  743|       |
  744|  49.3M|                        ctxt_idx = (ctxt_set * 4) + abs_gt1_base_ctxt + gt1_ctxt;
  745|       |
  746|  49.3M|                        TRACE_CABAC_CTXT("coeff_abs_level_greater1_flag", ps_cabac->u4_range, ctxt_idx);
  747|  49.3M|                        IHEVCD_CABAC_DECODE_BIN(coeff_abs_level_greater1_flag, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  49.3M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  49.3M|{                                                                               \
  |  |   61|  49.3M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  49.3M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  49.3M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  49.3M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  49.3M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  49.3M|    WORD32 clz;                                                                 \
  |  |   67|  49.3M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  49.3M|                                                                                \
  |  |   69|  49.3M|    /* Sanity checks */                                                         \
  |  |   70|  49.3M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  49.3M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  49.3M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  49.3M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  49.3M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  49.3M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  49.3M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  49.3M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  49.3M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  49.3M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  49.3M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  49.3M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  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
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  49.3M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  49.3M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  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
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  49.3M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  49.3M|                                                                                \
  |  |   83|  49.3M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  49.3M|                                                                                \
  |  |   85|  49.3M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 4.70M, False: 44.6M]
  |  |  ------------------
  |  |   86|  49.3M|    {                                                                           \
  |  |   87|  4.70M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  4.70M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  4.70M|        u4_range = u4_rlps;                                                     \
  |  |   90|  4.70M|    }                                                                           \
  |  |   91|  49.3M|                                                                                \
  |  |   92|  49.3M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  49.3M|                                                                                \
  |  |   94|  49.3M|    /*****************************************************************/         \
  |  |   95|  49.3M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  49.3M|    /*****************************************************************/         \
  |  |   97|  49.3M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 652k, False: 48.7M]
  |  |  ------------------
  |  |   98|  49.3M|    {                                                                           \
  |  |   99|   652k|        UWORD32 u4_bits;                                                        \
  |  |  100|   652k|        WORD32 numbits;                                                         \
  |  |  101|   652k|        numbits = CLZ(u4_range);                                                \
  |  |  102|   652k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|   652k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|   652k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   652k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   652k|{                                                               \
  |  |  |  |  152|   652k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   652k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   652k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   652k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   652k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.30M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 456k, False: 195k]
  |  |  |  |  ------------------
  |  |  |  |  156|   652k|    {                                                           \
  |  |  |  |  157|   456k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   456k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 456k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   456k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   456k|    }                                                           \
  |  |  |  |  160|   652k|                                                                \
  |  |  |  |  161|   652k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.30M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 477k, False: 174k]
  |  |  |  |  ------------------
  |  |  |  |  162|   652k|    {                                                           \
  |  |  |  |  163|   477k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   477k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   477k|        /* Getting the next word */                             \
  |  |  |  |  166|   477k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   477k|                                                                \
  |  |  |  |  168|   477k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   477k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   477k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   477k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   477k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   477k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   477k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   477k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   477k|    }                                                           \
  |  |  |  |  172|   652k|}
  |  |  ------------------
  |  |  104|   652k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|   652k|                                                                                \
  |  |  106|   652k|        u4_ofst <<= numbits;                                                    \
  |  |  107|   652k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|   652k|        u4_range <<= numbits;                                                   \
  |  |  109|   652k|                                                                                \
  |  |  110|   652k|    }                                                                           \
  |  |  111|  49.3M|    /* Update the cabac context */                                              \
  |  |  112|  49.3M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  49.3M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  49.3M|                                                                                \
  |  |  115|  49.3M|}
  ------------------
  748|  49.3M|                        AEV_TRACE("coeff_abs_level_greater1_flag", coeff_abs_level_greater1_flag, ps_cabac->u4_range);
  749|       |
  750|  49.3M|                        u4_coeff_abs_level_greater1_map |= coeff_abs_level_greater1_flag << n;
  751|  49.3M|                        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|  49.3M|                        if(coeff_abs_level_greater1_flag)
  ------------------
  |  Branch (758:28): [True: 11.6M, False: 37.6M]
  ------------------
  759|  11.6M|                        {
  760|  11.6M|                            gt1_ctxt = 0;
  761|  11.6M|                        }
  762|  37.6M|                        else if(gt1_ctxt && (gt1_ctxt < 3))
  ------------------
  |  Branch (762:33): [True: 33.3M, False: 4.30M]
  |  Branch (762:45): [True: 17.9M, False: 15.4M]
  ------------------
  763|  17.9M|                        {
  764|  17.9M|                            gt1_ctxt++;
  765|  17.9M|                        }
  766|       |
  767|  49.3M|                    }
  768|  2.29M|                    else
  769|  2.29M|                        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|  51.6M|                }
  777|  49.3M|                u4_sig_coeff_map_shift <<= 1;
  778|  49.3M|                n--;
  779|       |                /* If there are zero coeffs, then shift by as many zero coeffs and decrement n */
  780|  49.3M|                clz = CLZ(u4_sig_coeff_map_shift);
  781|  49.3M|                u4_sig_coeff_map_shift <<= clz;
  782|  49.3M|                n -= (WORD32)clz;
  783|  49.3M|            }while(u4_sig_coeff_map_shift);
  ------------------
  |  Branch (783:20): [True: 36.8M, False: 12.4M]
  ------------------
  784|  14.7M|        }
  785|       |        /* At this level u4_sig_coeff_map is non-zero i.e. has atleast one non-zero coeff */
  786|  14.7M|        last_sig_scan_pos = (31 - CLZ(u4_sig_coeff_map));
  787|  14.7M|        first_sig_scan_pos = CTZ(u4_sig_coeff_map);
  788|       |
  789|  14.7M|        if(ps_codec->s_parse.s_cu.i4_cu_transquant_bypass
  ------------------
  |  Branch (789:12): [True: 1.28M, False: 13.5M]
  ------------------
  790|  13.5M|#ifdef ENABLE_MAIN_REXT_PROFILE
  791|  13.5M|                        || explicit_rdpcm_flag
  ------------------
  |  Branch (791:28): [True: 389, False: 13.5M]
  ------------------
  792|  13.5M|#endif
  793|  13.5M|                        || (PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode
  ------------------
  |  Branch (793:29): [True: 13.0M, False: 484k]
  ------------------
  794|  13.0M|#ifdef ENABLE_MAIN_REXT_PROFILE
  795|  13.0M|                                        && ps_sps->i1_implicit_rdpcm_enabled_flag
  ------------------
  |  Branch (795:44): [True: 89.2k, False: 12.9M]
  ------------------
  796|       |#else
  797|       |                                        && 0
  798|       |#endif
  799|  89.2k|                                        && transform_skip_flag
  ------------------
  |  Branch (799:44): [True: 12.3k, False: 76.8k]
  ------------------
  800|  12.3k|                                        && (intra_pred_mode == 10 || intra_pred_mode == 26)))
  ------------------
  |  Branch (800:45): [True: 922, False: 11.4k]
  |  Branch (800:70): [True: 2.02k, False: 9.44k]
  ------------------
  801|  1.28M|        {
  802|  1.28M|            sign_hidden = 0;
  803|  1.28M|        }
  804|  13.4M|        else
  805|  13.4M|        {
  806|  13.4M|            sign_hidden = ((last_sig_scan_pos - first_sig_scan_pos) > 3);
  807|  13.4M|        }
  808|       |
  809|  14.7M|        u4_coeff_abs_level_greater2_map = 0;
  810|       |
  811|  14.7M|        if(u4_coeff_abs_level_greater1_map)
  ------------------
  |  Branch (811:12): [True: 4.62M, False: 10.1M]
  ------------------
  812|  4.62M|        {
  813|       |            /* Check if the first level > 1 is greater than 2 */
  814|  4.62M|            WORD32 ctxt_idx;
  815|  4.62M|            first_greater1_scan_pos = (31 - CLZ(u4_coeff_abs_level_greater1_map));
  816|       |
  817|       |
  818|  4.62M|            ctxt_idx = IHEVC_CAB_COEFABS_GRTR2_FLAG;
  819|       |
  820|  4.62M|            ctxt_idx += (!c_idx) ? ctxt_set : (ctxt_set + 4);
  ------------------
  |  Branch (820:25): [True: 2.83M, False: 1.78M]
  ------------------
  821|  4.62M|            TRACE_CABAC_CTXT("coeff_abs_level_greater2_flag", ps_cabac->u4_range, ctxt_idx);
  822|  4.62M|            IHEVCD_CABAC_DECODE_BIN(coeff_abs_level_greater2_flag, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  4.62M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  4.62M|{                                                                               \
  |  |   61|  4.62M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  4.62M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  4.62M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  4.62M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  4.62M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  4.62M|    WORD32 clz;                                                                 \
  |  |   67|  4.62M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  4.62M|                                                                                \
  |  |   69|  4.62M|    /* Sanity checks */                                                         \
  |  |   70|  4.62M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  4.62M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  4.62M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  4.62M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  4.62M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  4.62M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  4.62M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  4.62M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  4.62M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  4.62M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  4.62M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  4.62M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  4.62M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  4.62M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  4.62M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  4.62M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  4.62M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  4.62M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  4.62M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  4.62M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  4.62M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  4.62M|                                                                                \
  |  |   83|  4.62M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  4.62M|                                                                                \
  |  |   85|  4.62M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 798k, False: 3.82M]
  |  |  ------------------
  |  |   86|  4.62M|    {                                                                           \
  |  |   87|   798k|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|   798k|        u4_ofst -= u4_range;                                                    \
  |  |   89|   798k|        u4_range = u4_rlps;                                                     \
  |  |   90|   798k|    }                                                                           \
  |  |   91|  4.62M|                                                                                \
  |  |   92|  4.62M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  4.62M|                                                                                \
  |  |   94|  4.62M|    /*****************************************************************/         \
  |  |   95|  4.62M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  4.62M|    /*****************************************************************/         \
  |  |   97|  4.62M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 101k, False: 4.51M]
  |  |  ------------------
  |  |   98|  4.62M|    {                                                                           \
  |  |   99|   101k|        UWORD32 u4_bits;                                                        \
  |  |  100|   101k|        WORD32 numbits;                                                         \
  |  |  101|   101k|        numbits = CLZ(u4_range);                                                \
  |  |  102|   101k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|   101k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|   101k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   101k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   101k|{                                                               \
  |  |  |  |  152|   101k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   101k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   101k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   101k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   101k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   203k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 71.4k, False: 30.2k]
  |  |  |  |  ------------------
  |  |  |  |  156|   101k|    {                                                           \
  |  |  |  |  157|  71.4k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  71.4k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 71.4k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  71.4k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  71.4k|    }                                                           \
  |  |  |  |  160|   101k|                                                                \
  |  |  |  |  161|   101k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   203k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 75.3k, False: 26.3k]
  |  |  |  |  ------------------
  |  |  |  |  162|   101k|    {                                                           \
  |  |  |  |  163|  75.3k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  75.3k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  75.3k|        /* Getting the next word */                             \
  |  |  |  |  166|  75.3k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  75.3k|                                                                \
  |  |  |  |  168|  75.3k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  75.3k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  75.3k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  75.3k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  75.3k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  75.3k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  75.3k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  75.3k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  75.3k|    }                                                           \
  |  |  |  |  172|   101k|}
  |  |  ------------------
  |  |  104|   101k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|   101k|                                                                                \
  |  |  106|   101k|        u4_ofst <<= numbits;                                                    \
  |  |  107|   101k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|   101k|        u4_range <<= numbits;                                                   \
  |  |  109|   101k|                                                                                \
  |  |  110|   101k|    }                                                                           \
  |  |  111|  4.62M|    /* Update the cabac context */                                              \
  |  |  112|  4.62M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  4.62M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  4.62M|                                                                                \
  |  |  115|  4.62M|}
  ------------------
  823|  4.62M|            AEV_TRACE("coeff_abs_level_greater2_flag", coeff_abs_level_greater2_flag, ps_cabac->u4_range);
  824|  4.62M|            u4_coeff_abs_level_greater2_map = coeff_abs_level_greater2_flag << first_greater1_scan_pos;
  825|  4.62M|        }
  826|       |
  827|       |
  828|  14.7M|        u4_coeff_sign_map = 0;
  829|       |
  830|       |        /* Parse sign flags */
  831|  14.7M|        if(!sign_data_hiding_flag || !sign_hidden)
  ------------------
  |  Branch (831:12): [True: 4.47M, False: 10.3M]
  |  Branch (831:38): [True: 5.78M, False: 4.53M]
  ------------------
  832|  10.2M|        {
  833|  10.2M|            IHEVCD_CABAC_DECODE_BYPASS_BINS(value, ps_cabac, ps_bitstrm, num_coeff);
  ------------------
  |  |  156|  10.2M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  10.2M|{                                                                               \
  |  |  158|  10.2M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  10.2M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  10.2M|    UWORD32 u4_bits;                                                            \
  |  |  161|  10.2M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  10.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|  10.2M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  10.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|  10.2M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  10.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|  10.2M|    {                                                                           \
  |  |  165|  10.2M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  10.2M|        /* Sanity checks */                                                     \
  |  |  167|  10.2M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  10.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|  10.2M|                                                                                \
  |  |  169|  10.2M|        u4_bins = 0;                                                            \
  |  |  170|  10.2M|                                                                                \
  |  |  171|  10.2M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  10.2M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  10.2M|{                                                               \
  |  |  |  |  152|  10.2M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  10.2M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  10.2M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  10.2M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  10.2M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  20.5M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 545k, False: 9.71M]
  |  |  |  |  ------------------
  |  |  |  |  156|  10.2M|    {                                                           \
  |  |  |  |  157|   545k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   545k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 545k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   545k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   545k|    }                                                           \
  |  |  |  |  160|  10.2M|                                                                \
  |  |  |  |  161|  10.2M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  20.5M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 871k, False: 9.38M]
  |  |  |  |  ------------------
  |  |  |  |  162|  10.2M|    {                                                           \
  |  |  |  |  163|   871k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   871k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   871k|        /* Getting the next word */                             \
  |  |  |  |  166|   871k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   871k|                                                                \
  |  |  |  |  168|   871k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   871k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   871k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   871k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   871k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   871k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   871k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   871k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   871k|    }                                                           \
  |  |  |  |  172|  10.2M|}
  |  |  ------------------
  |  |  172|  10.2M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  10.2M|        do                                                                      \
  |  |  174|  27.8M|        {                                                                       \
  |  |  175|  27.8M|            UWORD32 u4_bit;                                                     \
  |  |  176|  27.8M|            numbins_tmp--;                                                      \
  |  |  177|  27.8M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  27.8M|            u4_ofst <<= 1;                                                      \
  |  |  179|  27.8M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  27.8M|                                                                                \
  |  |  181|  27.8M|            u4_bins <<= 1;                                                      \
  |  |  182|  27.8M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 5.99M, False: 21.8M]
  |  |  ------------------
  |  |  183|  27.8M|            {                                                                   \
  |  |  184|  5.99M|                u4_bins += 1;                                                   \
  |  |  185|  5.99M|                u4_ofst -= u4_range;                                            \
  |  |  186|  5.99M|            }                                                                   \
  |  |  187|  27.8M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 17.6M, False: 10.2M]
  |  |  ------------------
  |  |  188|  10.2M|                                                                                \
  |  |  189|  10.2M|        /* Update the cabac context */                                          \
  |  |  190|  10.2M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  10.2M|    }                                                                           \
  |  |  192|  10.2M|}
  ------------------
  834|  10.2M|            AEV_TRACE("sign_flags", value, ps_cabac->u4_range);
  835|  10.2M|            u4_coeff_sign_map = (UWORD32)value << (32 - num_coeff);
  836|  10.2M|        }
  837|  4.53M|        else
  838|  4.53M|        {
  839|  4.53M|            IHEVCD_CABAC_DECODE_BYPASS_BINS(value, ps_cabac, ps_bitstrm, (num_coeff - 1));
  ------------------
  |  |  156|  4.53M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  4.53M|{                                                                               \
  |  |  158|  4.53M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  4.53M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  4.53M|    UWORD32 u4_bits;                                                            \
  |  |  161|  4.53M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  4.53M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|  4.53M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  4.53M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|  4.53M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  4.53M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|  4.53M|    {                                                                           \
  |  |  165|  4.53M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  4.53M|        /* Sanity checks */                                                     \
  |  |  167|  4.53M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  4.53M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|  4.53M|                                                                                \
  |  |  169|  4.53M|        u4_bins = 0;                                                            \
  |  |  170|  4.53M|                                                                                \
  |  |  171|  4.53M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  4.53M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  4.53M|{                                                               \
  |  |  |  |  152|  4.53M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  4.53M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.53M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  4.53M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  4.53M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  9.06M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 790k, False: 3.74M]
  |  |  |  |  ------------------
  |  |  |  |  156|  4.53M|    {                                                           \
  |  |  |  |  157|   790k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   790k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 790k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   790k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   790k|    }                                                           \
  |  |  |  |  160|  4.53M|                                                                \
  |  |  |  |  161|  4.53M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  9.06M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 937k, False: 3.59M]
  |  |  |  |  ------------------
  |  |  |  |  162|  4.53M|    {                                                           \
  |  |  |  |  163|   937k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   937k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   937k|        /* Getting the next word */                             \
  |  |  |  |  166|   937k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   937k|                                                                \
  |  |  |  |  168|   937k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   937k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   937k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   937k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   937k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   937k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   937k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   937k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   937k|    }                                                           \
  |  |  |  |  172|  4.53M|}
  |  |  ------------------
  |  |  172|  4.53M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  4.53M|        do                                                                      \
  |  |  174|  29.7M|        {                                                                       \
  |  |  175|  29.7M|            UWORD32 u4_bit;                                                     \
  |  |  176|  29.7M|            numbins_tmp--;                                                      \
  |  |  177|  29.7M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  29.7M|            u4_ofst <<= 1;                                                      \
  |  |  179|  29.7M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  29.7M|                                                                                \
  |  |  181|  29.7M|            u4_bins <<= 1;                                                      \
  |  |  182|  29.7M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 6.95M, False: 22.8M]
  |  |  ------------------
  |  |  183|  29.7M|            {                                                                   \
  |  |  184|  6.95M|                u4_bins += 1;                                                   \
  |  |  185|  6.95M|                u4_ofst -= u4_range;                                            \
  |  |  186|  6.95M|            }                                                                   \
  |  |  187|  29.7M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 25.2M, False: 4.53M]
  |  |  ------------------
  |  |  188|  4.53M|                                                                                \
  |  |  189|  4.53M|        /* Update the cabac context */                                          \
  |  |  190|  4.53M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  4.53M|    }                                                                           \
  |  |  192|  4.53M|}
  ------------------
  840|  4.53M|            AEV_TRACE("sign_flags", value, ps_cabac->u4_range);
  841|  4.53M|            u4_coeff_sign_map = (UWORD32)value << (32 - (num_coeff - 1));
  842|  4.53M|        }
  843|       |
  844|  14.7M|        num_sig_coeff = 0;
  845|  14.7M|        sum_abs_level = 0;
  846|       |
  847|  14.7M|#ifdef ENABLE_MAIN_REXT_PROFILE
  848|  14.7M|        WORD32 sb_type = 2 * (c_idx == 0 ? 1 : 0);
  ------------------
  |  Branch (848:31): [True: 9.36M, False: 5.42M]
  ------------------
  849|  14.7M|        if(ps_sps->i1_persistent_rice_adaptation_enabled_flag)
  ------------------
  |  Branch (849:12): [True: 129k, False: 14.6M]
  ------------------
  850|   129k|        {
  851|   129k|            if(!(transform_skip_flag == 0 && ps_codec->s_parse.s_cu.i4_cu_transquant_bypass == 0))
  ------------------
  |  Branch (851:18): [True: 113k, False: 16.2k]
  |  Branch (851:46): [True: 97.2k, False: 15.7k]
  ------------------
  852|  32.0k|            {
  853|  32.0k|                sb_type += 1;
  854|  32.0k|            }
  855|   129k|            rice_param = ps_cabac->ai4_rice_stat_coeff[sb_type] / 4;
  856|   129k|        }
  857|  14.6M|        else
  858|  14.6M|#endif
  859|  14.6M|        {
  860|  14.6M|            rice_param = 0;
  861|  14.6M|        }
  862|  14.7M|        {
  863|  14.7M|            UWORD32 clz;
  864|  14.7M|            UWORD32 u4_sig_coeff_map_shift;
  865|  14.7M|            clz = CLZ(u4_sig_coeff_map);
  866|  14.7M|            n = 31 - clz;
  867|  14.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|  14.7M|            do
  870|  62.2M|            {
  871|       |
  872|  62.2M|                if((u4_sig_coeff_map_shift >> 31) & 1)
  ------------------
  |  Branch (872:20): [True: 62.2M, False: 0]
  ------------------
  873|  62.2M|                {
  874|  62.2M|                    WORD32 base_lvl;
  875|  62.2M|                    WORD32 coeff_abs_level_remaining;
  876|  62.2M|                    WORD32 level;
  877|  62.2M|                    base_lvl = 1;
  878|       |
  879|       |                    /* Update base_lvl if it is greater than 1 */
  880|  62.2M|                    if((u4_coeff_abs_level_greater1_map >> n) & 1)
  ------------------
  |  Branch (880:24): [True: 11.6M, False: 50.5M]
  ------------------
  881|  11.6M|                        base_lvl++;
  882|       |
  883|       |                    /* Update base_lvl if it is greater than 2 */
  884|  62.2M|                    if((u4_coeff_abs_level_greater2_map >> n) & 1)
  ------------------
  |  Branch (884:24): [True: 1.44M, False: 60.7M]
  ------------------
  885|  1.44M|                        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|  62.2M|                    coeff_abs_level_remaining = 0;
  891|  62.2M|                    if(base_lvl == ((num_sig_coeff < 8) ? ((n == first_greater1_scan_pos) ? 3 : 2) : 1))
  ------------------
  |  Branch (891:24): [True: 21.3M, False: 40.8M]
  |  Branch (891:37): [True: 49.3M, False: 12.8M]
  |  Branch (891:60): [True: 4.62M, False: 44.7M]
  ------------------
  892|  21.3M|                    {
  893|  21.3M|                        UWORD32 u4_prefix;
  894|  21.3M|                        WORD32 bin;
  895|       |
  896|  21.3M|                        u4_prefix = 0;
  897|       |
  898|  21.3M|                        do
  899|  32.1M|                        {
  900|  32.1M|                            IHEVCD_CABAC_DECODE_BYPASS_BIN(bin, ps_cabac, ps_bitstrm);
  ------------------
  |  |  122|  32.1M|#define IHEVCD_CABAC_DECODE_BYPASS_BIN(u4_bin, ps_cabac, ps_bitstrm)            \
  |  |  123|  32.1M|{                                                                               \
  |  |  124|  32.1M|                                                                                \
  |  |  125|  32.1M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  126|  32.1M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  127|  32.1M|    UWORD32 u4_bits;                                                            \
  |  |  128|  32.1M|                                                                                \
  |  |  129|  32.1M|    /* Sanity checks */                                                         \
  |  |  130|  32.1M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  32.1M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  131|  32.1M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  32.1M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  132|  32.1M|                                                                                \
  |  |  133|  32.1M|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,              \
  |  |  ------------------
  |  |  |  |  182|  32.1M|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  |  |  183|  32.1M|{                                                               \
  |  |  |  |  184|  32.1M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  185|  32.1M|                             >> (WORD_SIZE_MINUS1);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  32.1M|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  32.1M|#define WORD_SIZE         32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  186|  32.1M|    m_u4_bit_ofst++;                                            \
  |  |  |  |  187|  32.1M|                                                                \
  |  |  |  |  188|  32.1M|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  64.2M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (188:8): [True: 995k, False: 31.1M]
  |  |  |  |  ------------------
  |  |  |  |  189|  32.1M|    {                                                           \
  |  |  |  |  190|   995k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  191|   995k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  192|   995k|        /* Getting the next word */                             \
  |  |  |  |  193|   995k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  |  |  194|   995k|                                                                \
  |  |  |  |  195|   995k|        m_u4_bit_ofst = 0;                                      \
  |  |  |  |  196|   995k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  197|   995k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   995k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   995k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   995k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   995k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  198|   995k|    }                                                           \
  |  |  |  |  199|  32.1M|}
  |  |  ------------------
  |  |  134|  32.1M|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);                  \
  |  |  135|  32.1M|                                                                                \
  |  |  136|  32.1M|    u4_ofst <<= 1;                                                              \
  |  |  137|  32.1M|    u4_ofst |= u4_bits;                                                         \
  |  |  138|  32.1M|                                                                                \
  |  |  139|  32.1M|    u4_bin = 0;                                                                 \
  |  |  140|  32.1M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 10.9M, False: 21.1M]
  |  |  ------------------
  |  |  141|  32.1M|    {                                                                           \
  |  |  142|  10.9M|        u4_bin = 1;                                                             \
  |  |  143|  10.9M|        u4_ofst -= u4_range;                                                    \
  |  |  144|  10.9M|    }                                                                           \
  |  |  145|  32.1M|                                                                                \
  |  |  146|  32.1M|    /* Update the cabac context */                                              \
  |  |  147|  32.1M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  148|  32.1M|}
  ------------------
  901|  32.1M|                            u4_prefix++;
  902|       |
  903|  32.1M|                            if((WORD32)u4_prefix == 19 - rice_param)
  ------------------
  |  Branch (903:32): [True: 202k, False: 31.9M]
  ------------------
  904|   202k|                            {
  905|   202k|                                bin = 1;
  906|   202k|                                break;
  907|   202k|                            }
  908|       |
  909|  32.1M|                        }while(bin);
  ------------------
  |  Branch (909:32): [True: 10.7M, False: 21.1M]
  ------------------
  910|       |
  911|  21.3M|                        u4_prefix = u4_prefix - 1;
  912|  21.3M|                        if(u4_prefix < 3)
  ------------------
  |  Branch (912:28): [True: 20.2M, False: 1.14M]
  ------------------
  913|  20.2M|                        {
  914|  20.2M|                            UWORD32 u4_suffix;
  915|       |
  916|  20.2M|                            coeff_abs_level_remaining = (u4_prefix << rice_param);
  917|  20.2M|                            if(rice_param)
  ------------------
  |  Branch (917:32): [True: 2.47M, False: 17.7M]
  ------------------
  918|  2.47M|                            {
  919|  2.47M|                                IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, rice_param);
  ------------------
  |  |  156|  2.47M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  2.47M|{                                                                               \
  |  |  158|  2.47M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  2.47M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  2.47M|    UWORD32 u4_bits;                                                            \
  |  |  161|  2.47M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  2.47M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|  2.47M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  2.47M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|  2.47M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  2.47M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|  2.47M|    {                                                                           \
  |  |  165|  2.47M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  2.47M|        /* Sanity checks */                                                     \
  |  |  167|  2.47M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  2.47M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|  2.47M|                                                                                \
  |  |  169|  2.47M|        u4_bins = 0;                                                            \
  |  |  170|  2.47M|                                                                                \
  |  |  171|  2.47M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  2.47M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  2.47M|{                                                               \
  |  |  |  |  152|  2.47M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  2.47M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.47M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  2.47M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  2.47M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.94M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 30.1k, False: 2.44M]
  |  |  |  |  ------------------
  |  |  |  |  156|  2.47M|    {                                                           \
  |  |  |  |  157|  30.1k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  30.1k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 30.1k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  30.1k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  30.1k|    }                                                           \
  |  |  |  |  160|  2.47M|                                                                \
  |  |  |  |  161|  2.47M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.94M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 108k, False: 2.36M]
  |  |  |  |  ------------------
  |  |  |  |  162|  2.47M|    {                                                           \
  |  |  |  |  163|   108k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   108k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   108k|        /* Getting the next word */                             \
  |  |  |  |  166|   108k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   108k|                                                                \
  |  |  |  |  168|   108k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   108k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   108k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   108k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   108k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   108k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   108k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   108k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   108k|    }                                                           \
  |  |  |  |  172|  2.47M|}
  |  |  ------------------
  |  |  172|  2.47M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  2.47M|        do                                                                      \
  |  |  174|  3.44M|        {                                                                       \
  |  |  175|  3.44M|            UWORD32 u4_bit;                                                     \
  |  |  176|  3.44M|            numbins_tmp--;                                                      \
  |  |  177|  3.44M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  3.44M|            u4_ofst <<= 1;                                                      \
  |  |  179|  3.44M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  3.44M|                                                                                \
  |  |  181|  3.44M|            u4_bins <<= 1;                                                      \
  |  |  182|  3.44M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 1.72M, False: 1.71M]
  |  |  ------------------
  |  |  183|  3.44M|            {                                                                   \
  |  |  184|  1.72M|                u4_bins += 1;                                                   \
  |  |  185|  1.72M|                u4_ofst -= u4_range;                                            \
  |  |  186|  1.72M|            }                                                                   \
  |  |  187|  3.44M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 974k, False: 2.47M]
  |  |  ------------------
  |  |  188|  2.47M|                                                                                \
  |  |  189|  2.47M|        /* Update the cabac context */                                          \
  |  |  190|  2.47M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  2.47M|    }                                                                           \
  |  |  192|  2.47M|}
  ------------------
  920|       |
  921|  2.47M|                                coeff_abs_level_remaining |= u4_suffix;
  922|  2.47M|                            }
  923|  20.2M|                        }
  924|  1.14M|                        else
  925|  1.14M|                        {
  926|  1.14M|                            UWORD32 u4_suffix;
  927|  1.14M|                            UWORD32 u4_numbins;
  928|       |
  929|       |                            //u4_prefix = CLIP3(u4_prefix, 0, 19 - rice_param);
  930|       |
  931|  1.14M|                            u4_numbins = (u4_prefix - 3 + rice_param);
  932|  1.14M|                            coeff_abs_level_remaining = (((1 << (u4_prefix - 3)) + 3 - 1) << rice_param);
  933|  1.14M|                            if(u4_numbins)
  ------------------
  |  Branch (933:32): [True: 858k, False: 287k]
  ------------------
  934|   858k|                            {
  935|   858k|                                IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, u4_numbins);
  ------------------
  |  |  156|   858k|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|   858k|{                                                                               \
  |  |  158|   858k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|   858k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|   858k|    UWORD32 u4_bits;                                                            \
  |  |  161|   858k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   858k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|   858k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   858k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|   858k|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|   858k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|   858k|    {                                                                           \
  |  |  165|   858k|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|   858k|        /* Sanity checks */                                                     \
  |  |  167|   858k|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|   858k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|   858k|                                                                                \
  |  |  169|   858k|        u4_bins = 0;                                                            \
  |  |  170|   858k|                                                                                \
  |  |  171|   858k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   858k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   858k|{                                                               \
  |  |  |  |  152|   858k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   858k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   858k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   858k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   858k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.71M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 121k, False: 737k]
  |  |  |  |  ------------------
  |  |  |  |  156|   858k|    {                                                           \
  |  |  |  |  157|   121k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   121k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 121k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   121k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   121k|    }                                                           \
  |  |  |  |  160|   858k|                                                                \
  |  |  |  |  161|   858k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.71M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 147k, False: 710k]
  |  |  |  |  ------------------
  |  |  |  |  162|   858k|    {                                                           \
  |  |  |  |  163|   147k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   147k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   147k|        /* Getting the next word */                             \
  |  |  |  |  166|   147k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   147k|                                                                \
  |  |  |  |  168|   147k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   147k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   147k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   147k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   147k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   147k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   147k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   147k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   147k|    }                                                           \
  |  |  |  |  172|   858k|}
  |  |  ------------------
  |  |  172|   858k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|   858k|        do                                                                      \
  |  |  174|  4.55M|        {                                                                       \
  |  |  175|  4.55M|            UWORD32 u4_bit;                                                     \
  |  |  176|  4.55M|            numbins_tmp--;                                                      \
  |  |  177|  4.55M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  4.55M|            u4_ofst <<= 1;                                                      \
  |  |  179|  4.55M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  4.55M|                                                                                \
  |  |  181|  4.55M|            u4_bins <<= 1;                                                      \
  |  |  182|  4.55M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 3.73M, False: 814k]
  |  |  ------------------
  |  |  183|  4.55M|            {                                                                   \
  |  |  184|  3.73M|                u4_bins += 1;                                                   \
  |  |  185|  3.73M|                u4_ofst -= u4_range;                                            \
  |  |  186|  3.73M|            }                                                                   \
  |  |  187|  4.55M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 3.69M, False: 858k]
  |  |  ------------------
  |  |  188|   858k|                                                                                \
  |  |  189|   858k|        /* Update the cabac context */                                          \
  |  |  190|   858k|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|   858k|    }                                                                           \
  |  |  192|   858k|}
  ------------------
  936|   858k|                                coeff_abs_level_remaining += u4_suffix;
  937|   858k|                            }
  938|  1.14M|                        }
  939|       |
  940|       |
  941|  21.3M|                        AEV_TRACE("coeff_abs_level_remaining", coeff_abs_level_remaining, ps_cabac->u4_range);
  942|  21.3M|                        base_lvl += coeff_abs_level_remaining;
  943|       |
  944|  21.3M|#ifdef ENABLE_MAIN_REXT_PROFILE
  945|  21.3M|                        if(i1_update_stats)
  ------------------
  |  Branch (945:28): [True: 67.3k, False: 21.2M]
  ------------------
  946|  67.3k|                        {
  947|  67.3k|                            if(coeff_abs_level_remaining
  ------------------
  |  Branch (947:32): [True: 2.26k, False: 65.1k]
  ------------------
  948|  67.3k|                                            >= (3 << (ps_cabac->ai4_rice_stat_coeff[sb_type] / 4)))
  949|  2.26k|                            {
  950|  2.26k|                                ps_cabac->ai4_rice_stat_coeff[sb_type]++;
  951|  2.26k|                            }
  952|  65.1k|                            else if((2 * coeff_abs_level_remaining
  ------------------
  |  Branch (952:37): [True: 59.7k, False: 5.41k]
  ------------------
  953|  65.1k|                                            < (1 << (ps_cabac->ai4_rice_stat_coeff[sb_type] / 4)))
  954|  59.7k|                                            && ps_cabac->ai4_rice_stat_coeff[sb_type] > 0)
  ------------------
  |  Branch (954:48): [True: 1.73k, False: 57.9k]
  ------------------
  955|  1.73k|                            {
  956|  1.73k|                                ps_cabac->ai4_rice_stat_coeff[sb_type]--;
  957|  1.73k|                            }
  958|  67.3k|                            i1_update_stats = 0;
  959|  67.3k|                        }
  960|  21.3M|#endif
  961|  21.3M|                    }
  962|       |
  963|       |                    /* update the rice param based on coeff level */
  964|  62.2M|                    if(base_lvl > (3 << rice_param))
  ------------------
  |  Branch (964:24): [True: 1.91M, False: 60.2M]
  ------------------
  965|  1.91M|                    {
  966|  1.91M|#ifdef ENABLE_MAIN_REXT_PROFILE
  967|  1.91M|                        if(ps_sps->i1_persistent_rice_adaptation_enabled_flag)
  ------------------
  |  Branch (967:28): [True: 14.1k, False: 1.90M]
  ------------------
  968|  14.1k|                        {
  969|  14.1k|                            rice_param += 1;
  970|  14.1k|                        }
  971|  1.90M|                        else
  972|  1.90M|#endif
  973|  1.90M|                        {
  974|  1.90M|                            rice_param = MIN((rice_param + 1), 4);
  ------------------
  |  |   43|  1.90M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.78M, False: 116k]
  |  |  ------------------
  ------------------
  975|  1.90M|                        }
  976|  1.91M|                    }
  977|       |
  978|       |                    /* Compute absolute level */
  979|  62.2M|                    level = base_lvl;
  980|       |
  981|       |                    /* Update level with the sign */
  982|  62.2M|                    if((u4_coeff_sign_map >> 31) & 1)
  ------------------
  |  Branch (982:24): [True: 12.9M, False: 49.2M]
  ------------------
  983|  12.9M|                        level = -level;
  984|       |
  985|  62.2M|                    u4_coeff_sign_map <<= 1;
  986|       |                    /* Update sign in case sign is hidden */
  987|  62.2M|                    if(sign_data_hiding_flag && sign_hidden)
  ------------------
  |  Branch (987:24): [True: 44.5M, False: 17.6M]
  |  Branch (987:49): [True: 34.3M, False: 10.2M]
  ------------------
  988|  34.3M|                    {
  989|  34.3M|                        sum_abs_level += base_lvl;
  990|       |
  991|  34.3M|                        if(n == first_sig_scan_pos && ((sum_abs_level % 2) == 1))
  ------------------
  |  Branch (991:28): [True: 4.53M, False: 29.7M]
  |  Branch (991:55): [True: 1.84M, False: 2.69M]
  ------------------
  992|  1.84M|                            level = -level;
  993|  34.3M|                    }
  994|       |
  995|       |                    /* Store the resulting level in non-zero level array */
  996|  62.2M|                    ps_tu_sblk_coeff_data->ai2_level[num_sig_coeff++] = level;
  997|       |                    //AEV_TRACE("level", level, 0);
  998|  62.2M|                }
  999|  62.2M|                u4_sig_coeff_map_shift <<= 1;
 1000|  62.2M|                n--;
 1001|       |                /* If there are zero coeffs, then shift by as many zero coeffs and decrement n */
 1002|  62.2M|                clz = CLZ(u4_sig_coeff_map_shift);
 1003|  62.2M|                u4_sig_coeff_map_shift <<= clz;
 1004|  62.2M|                n -= (WORD32)clz;
 1005|       |
 1006|       |
 1007|  62.2M|            }while(u4_sig_coeff_map_shift);
  ------------------
  |  Branch (1007:20): [True: 47.4M, False: 14.7M]
  ------------------
 1008|  14.7M|        }
 1009|       |
 1010|       |        /* Increment the pv_tu_sblk_coeff_data */
 1011|  14.7M|        {
 1012|  14.7M|            UWORD8 *pu1_buf = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
 1013|  14.7M|            pu1_buf += sizeof(tu_sblk_coeff_data_t) - SUBBLK_COEFF_CNT * sizeof(WORD16);
  ------------------
  |  |  422|  14.7M|#define SUBBLK_COEFF_CNT    16
  ------------------
 1014|  14.7M|            pu1_buf += num_coeff * sizeof(WORD16);
 1015|  14.7M|            ps_codec->s_parse.pv_tu_coeff_data = pu1_buf;
 1016|       |
 1017|  14.7M|        }
 1018|       |
 1019|  14.7M|    }
 1020|       |    /* Set number of coded sub blocks in the current TU */
 1021|  10.3M|    *pi1_num_coded_subblks = num_subblks;
 1022|       |
 1023|  10.3M|    return ret;
 1024|  10.3M|}

ihevcd_parse_transform_tree:
  125|  11.9M|{
  126|  11.9M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  127|  11.9M|    sps_t *ps_sps;
  128|  11.9M|    pps_t *ps_pps;
  129|  11.9M|#ifdef ENABLE_MAIN_REXT_PROFILE
  130|  11.9M|    slice_header_t *ps_slice_hdr;
  131|  11.9M|#endif
  132|  11.9M|    WORD32 value;
  133|  11.9M|    WORD32 x1, y1;
  134|  11.9M|    WORD32 max_trafo_depth;
  135|       |
  136|  11.9M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  137|  11.9M|    WORD32 intra_split_flag;
  138|  11.9M|    WORD32 split_transform_flag;
  139|  11.9M|    WORD32 ctxt_idx;
  140|  11.9M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  141|       |
  142|  11.9M|    max_trafo_depth = ps_codec->s_parse.s_cu.i4_max_trafo_depth;
  143|  11.9M|    ps_sps = ps_codec->s_parse.ps_sps;
  144|  11.9M|    ps_pps = ps_codec->s_parse.ps_pps;
  145|  11.9M|#ifdef ENABLE_MAIN_REXT_PROFILE
  146|  11.9M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  147|  11.9M|#endif
  148|  11.9M|    intra_split_flag = ps_codec->s_parse.s_cu.i4_intra_split_flag;
  149|       |
  150|  11.9M|    {
  151|  11.9M|        split_transform_flag = 0;
  152|  11.9M|        if((log2_trafo_size <= ps_sps->i1_log2_max_transform_block_size) &&
  ------------------
  |  Branch (152:12): [True: 11.0M, False: 927k]
  ------------------
  153|  11.0M|                        (log2_trafo_size > ps_sps->i1_log2_min_transform_block_size) &&
  ------------------
  |  Branch (153:25): [True: 6.00M, False: 5.00M]
  ------------------
  154|  6.00M|                        (trafo_depth < max_trafo_depth) &&
  ------------------
  |  Branch (154:25): [True: 1.66M, False: 4.33M]
  ------------------
  155|  1.66M|                        !(intra_split_flag && (trafo_depth == 0)))
  ------------------
  |  Branch (155:27): [True: 759k, False: 907k]
  |  Branch (155:47): [True: 749k, False: 9.85k]
  ------------------
  156|   917k|        {
  157|       |            /* encode the split transform flag, context derived as per Table9-37 */
  158|   917k|            ctxt_idx = IHEVC_CAB_SPLIT_TFM + (5 - log2_trafo_size);
  159|       |
  160|   917k|            TRACE_CABAC_CTXT("split_transform_flag", ps_cabac->u4_range, ctxt_idx);
  161|   917k|            split_transform_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  162|   917k|            AEV_TRACE("split_transform_flag", split_transform_flag,
  163|   917k|                      ps_cabac->u4_range);
  164|       |
  165|   917k|        }
  166|  11.0M|        else
  167|  11.0M|        {
  168|  11.0M|            WORD32 inter_split_flag = 0;
  169|       |
  170|  11.0M|            if((0 == ps_sps->i1_max_transform_hierarchy_depth_inter) &&
  ------------------
  |  Branch (170:16): [True: 3.16M, False: 7.85M]
  ------------------
  171|  3.16M|                            (PRED_MODE_INTER == ps_codec->s_parse.s_cu.i4_pred_mode) &&
  ------------------
  |  Branch (171:29): [True: 353k, False: 2.81M]
  ------------------
  172|   353k|                            (PART_2Nx2N != ps_codec->s_parse.s_cu.i4_part_mode) &&
  ------------------
  |  Branch (172:29): [True: 99.7k, False: 253k]
  ------------------
  173|  99.7k|                            (0 == trafo_depth))
  ------------------
  |  Branch (173:29): [True: 14.7k, False: 84.9k]
  ------------------
  174|  14.7k|            {
  175|  14.7k|                inter_split_flag = 1;
  176|  14.7k|            }
  177|       |
  178|  11.0M|            if((log2_trafo_size > ps_sps->i1_log2_max_transform_block_size) ||
  ------------------
  |  Branch (178:16): [True: 927k, False: 10.0M]
  ------------------
  179|  10.0M|                            ((1 == intra_split_flag) && (0 == trafo_depth)) ||
  ------------------
  |  Branch (179:30): [True: 3.86M, False: 6.22M]
  |  Branch (179:57): [True: 749k, False: 3.11M]
  ------------------
  180|  9.34M|                            (1 == inter_split_flag))
  ------------------
  |  Branch (180:29): [True: 5.09k, False: 9.34M]
  ------------------
  181|  1.68M|            {
  182|  1.68M|                split_transform_flag = 1;
  183|  1.68M|            }
  184|  11.0M|        }
  185|       |
  186|  11.9M|        if(0 == trafo_depth)
  ------------------
  |  Branch (186:12): [True: 4.01M, False: 7.92M]
  ------------------
  187|  4.01M|        {
  188|  4.01M|            ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = 0;
  189|  4.01M|            ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = 0;
  190|  4.01M|#ifdef ENABLE_MAIN_REXT_PROFILE
  191|  4.01M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (191:16): [True: 1.30M, False: 2.71M]
  ------------------
  192|  1.30M|            {
  193|  1.30M|                ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] = 0;
  194|  1.30M|                ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] = 0;
  195|  1.30M|            }
  196|  4.01M|#endif
  197|  4.01M|        }
  198|  7.92M|        else
  199|  7.92M|        {
  200|  7.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|  7.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|  7.92M|#ifdef ENABLE_MAIN_REXT_PROFILE
  203|  7.92M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (203:16): [True: 1.82M, False: 6.09M]
  ------------------
  204|  1.82M|            {
  205|  1.82M|                ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] =
  206|  1.82M|                                ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth - 1];
  207|  1.82M|                ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] =
  208|  1.82M|                                ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth - 1];
  209|  1.82M|            }
  210|  7.92M|#endif
  211|  7.92M|        }
  212|  11.9M|        if ((CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && log2_trafo_size > 2) ||
  ------------------
  |  Branch (212:14): [True: 11.8M, False: 90.8k]
  |  Branch (212:75): [True: 7.04M, False: 4.81M]
  ------------------
  213|  4.90M|            ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (213:13): [True: 0, False: 4.90M]
  ------------------
  214|  7.04M|        {
  215|  7.04M|            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|  7.04M|            if((trafo_depth == 0) || ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth - 1])
  ------------------
  |  Branch (217:16): [True: 4.00M, False: 3.03M]
  |  Branch (217:38): [True: 1.01M, False: 2.02M]
  ------------------
  218|  5.01M|            {
  219|  5.01M|                TRACE_CABAC_CTXT("cbf_cb", ps_cabac->u4_range, ctxt_idx);
  220|  5.01M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  221|  5.01M|                AEV_TRACE("cbf_cb", value, ps_cabac->u4_range);
  222|  5.01M|                ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = value;
  223|  5.01M|#ifdef ENABLE_MAIN_REXT_PROFILE
  224|  5.01M|                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422
  ------------------
  |  Branch (224:20): [True: 1.44M, False: 3.57M]
  ------------------
  225|  1.44M|                                && (!split_transform_flag || log2_trafo_size == 3))
  ------------------
  |  Branch (225:37): [True: 1.02M, False: 419k]
  |  Branch (225:62): [True: 293k, False: 125k]
  ------------------
  226|  1.31M|                {
  227|  1.31M|                    TRACE_CABAC_CTXT("cbf_cb", ps_cabac->u4_range, ctxt_idx);
  228|  1.31M|                    value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  229|  1.31M|                    AEV_TRACE("cbf_cb", value, ps_cabac->u4_range);
  230|  1.31M|                    ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] = value;
  231|  1.31M|                }
  232|  5.01M|#endif
  233|  5.01M|            }
  234|       |
  235|  7.04M|            if((trafo_depth == 0) || ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth - 1])
  ------------------
  |  Branch (235:16): [True: 4.00M, False: 3.03M]
  |  Branch (235:38): [True: 1.04M, False: 1.98M]
  ------------------
  236|  5.05M|            {
  237|  5.05M|                TRACE_CABAC_CTXT("cbf_cr", ps_cabac->u4_range, ctxt_idx);
  238|  5.05M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  239|  5.05M|                AEV_TRACE("cbf_cr", value, ps_cabac->u4_range);
  240|  5.05M|                ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = value;
  241|  5.05M|#ifdef ENABLE_MAIN_REXT_PROFILE
  242|  5.05M|                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422
  ------------------
  |  Branch (242:20): [True: 1.45M, False: 3.59M]
  ------------------
  243|  1.45M|                                && (!split_transform_flag || log2_trafo_size == 3))
  ------------------
  |  Branch (243:37): [True: 1.03M, False: 419k]
  |  Branch (243:62): [True: 293k, False: 125k]
  ------------------
  244|  1.33M|                {
  245|  1.33M|                    TRACE_CABAC_CTXT("cbf_cr", ps_cabac->u4_range, ctxt_idx);
  246|  1.33M|                    value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  247|  1.33M|                    AEV_TRACE("cbf_cr", value, ps_cabac->u4_range);
  248|  1.33M|                    ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] = value;
  249|  1.33M|                }
  250|  5.05M|#endif
  251|  5.05M|            }
  252|  7.04M|        }
  253|  11.9M|        if(split_transform_flag)
  ------------------
  |  Branch (253:12): [True: 1.98M, False: 9.95M]
  ------------------
  254|  1.98M|        {
  255|  1.98M|            WORD32 intra_pred_mode_tmp;
  256|  1.98M|            WORD32 chroma_intra_pred_mode_tmp_idx = ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0];
  257|  1.98M|            x1 = x0 + ((1 << log2_trafo_size) >> 1);
  258|  1.98M|            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.98M|            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: 488k, False: 1.49M]
  ------------------
  265|  1.98M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (265:17): [True: 0, False: 1.98M]
  ------------------
  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.98M|            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.98M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.98M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 920, False: 1.98M]
  |  |  ------------------
  ------------------
  269|       |
  270|  1.98M|            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: 487k, False: 1.49M]
  ------------------
  271|  1.98M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (271:17): [True: 0, False: 1.98M]
  ------------------
  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.98M|            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.98M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.98M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 149, False: 1.98M]
  |  |  ------------------
  ------------------
  275|       |
  276|  1.98M|            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: 487k, False: 1.49M]
  ------------------
  277|  1.98M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (277:17): [True: 0, False: 1.98M]
  ------------------
  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.98M|            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.98M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.98M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 237, False: 1.97M]
  |  |  ------------------
  ------------------
  281|       |
  282|  1.97M|            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: 487k, False: 1.49M]
  ------------------
  283|  1.97M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (283:17): [True: 0, False: 1.97M]
  ------------------
  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.97M|            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.97M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.97M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 76, False: 1.97M]
  |  |  ------------------
  ------------------
  287|       |
  288|  1.97M|        }
  289|  9.95M|        else
  290|  9.95M|        {
  291|  9.95M|            WORD32 ctb_x_base;
  292|  9.95M|            WORD32 ctb_y_base;
  293|  9.95M|            WORD32 cu_qp_delta_abs;
  294|  9.95M|            WORD32 cbf_chroma;
  295|       |
  296|       |
  297|       |
  298|  9.95M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
  299|  9.95M|            cu_qp_delta_abs = 0;
  300|  9.95M|            ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
  301|  9.95M|            ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
  302|  9.95M|            cbf_chroma = ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth]
  ------------------
  |  Branch (302:26): [True: 3.01M, False: 6.94M]
  ------------------
  303|  6.94M|                            || ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth];
  ------------------
  |  Branch (303:32): [True: 609k, False: 6.33M]
  ------------------
  304|  9.95M|#ifdef ENABLE_MAIN_REXT_PROFILE
  305|  9.95M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (305:16): [True: 2.67M, False: 7.28M]
  ------------------
  306|  2.67M|            {
  307|  2.67M|                cbf_chroma |= ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth]
  ------------------
  |  Branch (307:31): [True: 906k, False: 1.77M]
  ------------------
  308|  1.77M|                                || ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth];
  ------------------
  |  Branch (308:36): [True: 177k, False: 1.59M]
  ------------------
  309|  2.67M|            }
  310|  9.95M|#endif
  311|       |
  312|  9.95M|            if((ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTRA) ||
  ------------------
  |  Branch (312:16): [True: 8.67M, False: 1.28M]
  ------------------
  313|  1.28M|                            (trafo_depth != 0) ||
  ------------------
  |  Branch (313:29): [True: 1.18M, False: 92.7k]
  ------------------
  314|  92.7k|                            (cbf_chroma))
  ------------------
  |  Branch (314:29): [True: 14.4k, False: 78.2k]
  ------------------
  315|  9.88M|            {
  316|  9.88M|                ctxt_idx = IHEVC_CAB_CBF_LUMA_IDX;
  317|  9.88M|                ctxt_idx += (trafo_depth == 0) ? 1 : 0;
  ------------------
  |  Branch (317:29): [True: 2.44M, False: 7.43M]
  ------------------
  318|       |
  319|  9.88M|                TRACE_CABAC_CTXT("cbf_luma", ps_cabac->u4_range, ctxt_idx);
  320|  9.88M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  321|  9.88M|                AEV_TRACE("cbf_luma", value, ps_cabac->u4_range);
  322|       |
  323|  9.88M|                ps_codec->s_parse.s_cu.i1_cbf_luma = value;
  324|  9.88M|            }
  325|  78.2k|            else
  326|  78.2k|            {
  327|  78.2k|                ps_codec->s_parse.s_cu.i1_cbf_luma = 1;
  328|  78.2k|            }
  329|       |
  330|       |            /* Initialize ps_tu to default values */
  331|       |            /* If required change this to WORD32 packed write */
  332|  9.95M|            ps_tu->b1_cb_cbf = 0;
  333|  9.95M|#ifdef ENABLE_MAIN_REXT_PROFILE
  334|  9.95M|            ps_tu->b1_cb_cbf_subtu1 = 0;
  335|  9.95M|#endif
  336|  9.95M|            ps_tu->b1_cr_cbf = 0;
  337|  9.95M|#ifdef ENABLE_MAIN_REXT_PROFILE
  338|  9.95M|            ps_tu->b1_cr_cbf_subtu1 = 0;
  339|  9.95M|#endif
  340|  9.95M|            ps_tu->b1_y_cbf = 0;
  341|  9.95M|            ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
  342|  9.95M|            ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
  343|  9.95M|            ps_tu->b1_transquant_bypass = ps_codec->s_parse.s_cu.i4_cu_transquant_bypass;
  344|  9.95M|            ps_tu->b3_size = (log2_trafo_size - 2);
  345|  9.95M|            ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
  346|  9.95M|#ifdef ENABLE_MAIN_REXT_PROFILE
  347|  9.95M|            ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
  348|  9.95M|            ps_tu->b1_cb_log2_res_sign = 0;
  349|  9.95M|            ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
  350|  9.95M|            ps_tu->b1_cr_log2_res_sign = 0;
  351|  9.95M|            ps_tu->b1_cu_chroma_qp_offset_flag = 0;
  352|  9.95M|            ps_tu->b3_cu_chroma_qp_offset_idx = 0;
  353|  9.95M|#endif
  354|       |
  355|  9.95M|            ps_tu->b6_luma_intra_mode = intra_pred_mode;
  356|  9.95M|            ps_tu->b3_chroma_intra_mode_idx = chroma_intra_pred_mode_idx;
  357|       |
  358|       |            /* Section:7.3.12  Transform unit syntax inlined here */
  359|  9.95M|            if(ps_codec->s_parse.s_cu.i1_cbf_luma || cbf_chroma)
  ------------------
  |  Branch (359:16): [True: 5.87M, False: 4.08M]
  |  Branch (359:54): [True: 1.32M, False: 2.76M]
  ------------------
  360|  7.19M|            {
  361|  7.19M|                WORD32 intra_pred_mode_chroma;
  362|  7.19M|                if(ps_pps->i1_cu_qp_delta_enabled_flag && !ps_codec->s_parse.i4_is_cu_qp_delta_coded)
  ------------------
  |  Branch (362:20): [True: 3.40M, False: 3.79M]
  |  Branch (362:59): [True: 282k, False: 3.12M]
  ------------------
  363|   282k|                {
  364|       |
  365|       |
  366|   282k|                    WORD32 c_max        = TU_MAX_QP_DELTA_ABS;
  ------------------
  |  |  160|   282k|#define TU_MAX_QP_DELTA_ABS     5
  ------------------
  367|   282k|                    WORD32 ctxt_inc     = IHEVC_CAB_QP_DELTA_ABS;
  368|   282k|                    WORD32 ctxt_inc_max = CTXT_MAX_QP_DELTA_ABS;
  ------------------
  |  |  163|   282k|#define CTXT_MAX_QP_DELTA_ABS   1
  ------------------
  369|       |
  370|   282k|                    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|   282k|                    cu_qp_delta_abs = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  374|   282k|                                                                      ps_bitstrm,
  375|   282k|                                                                      c_max,
  376|   282k|                                                                      ctxt_inc,
  377|   282k|                                                                      0,
  378|   282k|                                                                      ctxt_inc_max);
  379|   282k|                    if(cu_qp_delta_abs >= c_max)
  ------------------
  |  Branch (379:24): [True: 76.5k, False: 206k]
  ------------------
  380|  76.5k|                    {
  381|  76.5k|                        value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 0);
  382|  76.5k|                        cu_qp_delta_abs += value;
  383|  76.5k|                    }
  384|   282k|                    AEV_TRACE("cu_qp_delta_abs", cu_qp_delta_abs, ps_cabac->u4_range);
  385|       |
  386|   282k|                    ps_codec->s_parse.i4_is_cu_qp_delta_coded = 1;
  387|       |
  388|       |
  389|   282k|                    if(cu_qp_delta_abs)
  ------------------
  |  Branch (389:24): [True: 185k, False: 97.3k]
  ------------------
  390|   185k|                    {
  391|   185k|                        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  392|   185k|                        AEV_TRACE("cu_qp_delta_sign", value, ps_cabac->u4_range);
  393|       |
  394|   185k|                        if(value)
  ------------------
  |  Branch (394:28): [True: 44.1k, False: 141k]
  ------------------
  395|  44.1k|                            cu_qp_delta_abs = -cu_qp_delta_abs;
  396|       |
  397|   185k|                    }
  398|       |
  399|   282k|                    if (cu_qp_delta_abs < MIN_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8)
  ------------------
  |  |   85|   565k|#define MIN_CU_QP_DELTA_ABS(x) (-26 + ((x) * 6) / 2)
  ------------------
  |  Branch (399:25): [True: 447, False: 282k]
  ------------------
  400|   282k|                                    || cu_qp_delta_abs > MAX_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8))
  ------------------
  |  |   86|   282k|#define MAX_CU_QP_DELTA_ABS(x) (25 + ((x) * 6) / 2)
  ------------------
  |  Branch (400:40): [True: 702, False: 281k]
  ------------------
  401|  1.14k|                    {
  402|  1.14k|                        return IHEVCD_INVALID_PARAMETER;
  403|  1.14k|                    }
  404|       |
  405|   281k|                    ps_codec->s_parse.s_cu.i4_cu_qp_delta = cu_qp_delta_abs;
  406|       |
  407|   281k|                }
  408|       |
  409|  7.19M|#ifdef ENABLE_MAIN_REXT_PROFILE
  410|  7.19M|                if(ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag
  ------------------
  |  Branch (410:20): [True: 148k, False: 7.04M]
  ------------------
  411|   148k|                    && !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass)
  ------------------
  |  Branch (411:24): [True: 147k, False: 1.23k]
  ------------------
  412|   147k|                {
  413|   147k|                    if(!ps_codec->s_parse.i4_is_cu_chroma_qp_offset_coded
  ------------------
  |  Branch (413:24): [True: 85.3k, False: 61.8k]
  ------------------
  414|  85.3k|                        && cbf_chroma)
  ------------------
  |  Branch (414:28): [True: 6.66k, False: 78.7k]
  ------------------
  415|  6.66k|                    {
  416|  6.66k|                        ctxt_idx = IHEVC_CAB_CHROMA_QP_OFF_FLAG;
  417|  6.66k|                        TRACE_CABAC_CTXT("cu_chroma_qp_offset_flag", ps_cabac->u4_range, ctxt_idx);
  418|  6.66k|                        value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  419|  6.66k|                        AEV_TRACE("cu_chroma_qp_offset_flag", value, ps_cabac->u4_range);
  420|  6.66k|                        ps_codec->s_parse.i4_cu_chroma_qp_offset_flag = value;
  421|       |
  422|  6.66k|                        ps_codec->s_parse.i4_cu_chroma_qp_offset_idx = 0;
  423|  6.66k|                        if(ps_codec->s_parse.i4_cu_chroma_qp_offset_flag &&
  ------------------
  |  Branch (423:28): [True: 3.21k, False: 3.45k]
  ------------------
  424|  3.21k|                           ps_pps->i4_chroma_qp_offset_list_len_minus1 > 0)
  ------------------
  |  Branch (424:28): [True: 635, False: 2.58k]
  ------------------
  425|    635|                        {
  426|    635|                            ctxt_idx = IHEVC_CAB_CHROMA_QP_OFF_IDX;
  427|    635|                            TRACE_CABAC_CTXT("cu_chroma_qp_offset_idx", ps_cabac->u4_range, ctxt_idx);
  428|    635|                            value = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  429|    635|                                                                    ps_bitstrm,
  430|    635|                                                                    ps_pps->i4_chroma_qp_offset_list_len_minus1,
  431|    635|                                                                    ctxt_idx,
  432|    635|                                                                    0,
  433|    635|                                                                    0);
  434|    635|                            AEV_TRACE("cu_chroma_qp_offset_idx", value, ps_cabac->u4_range);
  435|    635|                            ps_codec->s_parse.i4_cu_chroma_qp_offset_idx = value;
  436|    635|                        }
  437|       |
  438|  6.66k|                        ps_codec->s_parse.i4_is_cu_chroma_qp_offset_coded = 1;
  439|  6.66k|                    }
  440|   147k|                    ps_tu->b1_cu_chroma_qp_offset_flag =
  441|   147k|                            ps_codec->s_parse.i4_cu_chroma_qp_offset_flag;
  442|   147k|                    ps_tu->b3_cu_chroma_qp_offset_idx =
  443|   147k|                            ps_codec->s_parse.i4_cu_chroma_qp_offset_idx;
  444|   147k|                }
  445|  7.19M|#endif
  446|       |
  447|  7.19M|                if(ps_codec->s_parse.s_cu.i1_cbf_luma)
  ------------------
  |  Branch (447:20): [True: 5.87M, False: 1.32M]
  ------------------
  448|  5.87M|                {
  449|  5.87M|                    ps_tu->b1_y_cbf = 1;
  450|  5.87M|                    ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 0, intra_pred_mode);
  451|  5.87M|                }
  452|       |
  453|  7.19M|                WORD32 chroma_blk_luma_intra_pred_mode =
  454|  7.19M|                                ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ?
  ------------------
  |  Branch (454:33): [True: 0, False: 7.19M]
  ------------------
  455|      0|                                                intra_pred_mode :
  456|  7.19M|                                                ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
  457|  7.19M|                if(4 == chroma_intra_pred_mode_idx)
  ------------------
  |  Branch (457:20): [True: 5.64M, False: 1.55M]
  ------------------
  458|  5.64M|                    intra_pred_mode_chroma = chroma_blk_luma_intra_pred_mode;
  459|  1.55M|                else
  460|  1.55M|                {
  461|  1.55M|                    intra_pred_mode_chroma = gau1_intra_pred_chroma_modes[chroma_intra_pred_mode_idx];
  462|       |
  463|  1.55M|                    if(intra_pred_mode_chroma == chroma_blk_luma_intra_pred_mode)
  ------------------
  |  Branch (463:24): [True: 316k, False: 1.23M]
  ------------------
  464|   316k|                    {
  465|   316k|                        intra_pred_mode_chroma = INTRA_ANGULAR(34);
  ------------------
  |  |  517|   316k|#define INTRA_ANGULAR(x) (x)
  ------------------
  466|   316k|                    }
  467|  1.55M|                }
  468|  7.19M|                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (468:20): [True: 2.10M, False: 5.08M]
  ------------------
  469|  2.10M|                {
  470|  2.10M|                    intra_pred_mode_chroma = gau1_intra_pred_chroma_modes_422[intra_pred_mode_chroma];
  471|  2.10M|                }
  472|  7.19M|                if(log2_trafo_size > 2 || ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (472:20): [True: 3.83M, False: 3.36M]
  |  Branch (472:43): [True: 0, False: 3.36M]
  ------------------
  473|  3.83M|                {
  474|  3.83M|                    WORD32 trafo_offset = (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 0 : 1);
  ------------------
  |  Branch (474:44): [True: 0, False: 3.83M]
  ------------------
  475|  3.83M|                    WORD32 log2_trafo_size_c = MAX(2, log2_trafo_size - trafo_offset);
  ------------------
  |  |   42|  3.83M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 3.83M]
  |  |  ------------------
  ------------------
  476|       |
  477|  3.83M|#ifdef ENABLE_MAIN_REXT_PROFILE
  478|  3.83M|                    if(ps_pps->i1_cross_component_prediction_enabled_flag
  ------------------
  |  Branch (478:24): [True: 247k, False: 3.58M]
  ------------------
  479|   247k|                                    && ps_codec->s_parse.s_cu.i1_cbf_luma
  ------------------
  |  Branch (479:40): [True: 236k, False: 10.7k]
  ------------------
  480|   236k|                                    && (ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTER
  ------------------
  |  Branch (480:41): [True: 459, False: 235k]
  ------------------
  481|   235k|                                                    || chroma_intra_pred_mode_idx == 4))
  ------------------
  |  Branch (481:56): [True: 213k, False: 22.4k]
  ------------------
  482|   213k|                    {
  483|   213k|                        ctxt_idx = IHEVC_CAB_CCP_LOG2_RES_ABS;
  484|   213k|                        TRACE_CABAC_CTXT("log2_res_scale_abs_plus1", ps_cabac->u4_range, ctxt_idx);
  485|   213k|                        value = ihevcd_cabac_decode_bins_tunary(ps_cabac, ps_bitstrm, 4, ctxt_idx,
  486|   213k|                                                                0, 3);
  487|   213k|                        AEV_TRACE("log2_res_scale_abs_plus1", value, ps_cabac->u4_range);
  488|       |
  489|   213k|                        if(value != 0)
  ------------------
  |  Branch (489:28): [True: 154k, False: 59.6k]
  ------------------
  490|   154k|                        {
  491|   154k|                            ctxt_idx = IHEVC_CAB_CCP_RES_SIGN_FLAG;
  492|   154k|                            TRACE_CABAC_CTXT("res_scale_sign_flag", ps_cabac->u4_range, ctxt_idx);
  493|   154k|                            ps_tu->b1_cb_log2_res_sign = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  494|   154k|                            AEV_TRACE("res_scale_sign_flag", value, ps_cabac->u4_range);
  495|   154k|                            ps_tu->b3_cb_log2_res_scale_abs_plus1 = value;
  496|   154k|                        }
  497|   213k|                    }
  498|  3.83M|#endif
  499|  3.83M|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth])
  ------------------
  |  Branch (499:24): [True: 1.32M, False: 2.51M]
  ------------------
  500|  1.32M|                    {
  501|  1.32M|                        ps_tu->b1_cb_cbf = 1;
  502|  1.32M|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size_c, 1, intra_pred_mode_chroma);
  503|  1.32M|                    }
  504|  3.83M|#ifdef ENABLE_MAIN_REXT_PROFILE
  505|  3.83M|                    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: 1.08M, False: 2.74M]
  |  Branch (505:81): [True: 333k, False: 751k]
  ------------------
  506|   333k|                    {
  507|   333k|                        ps_tu->b1_cb_cbf_subtu1 = 1;
  508|   333k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0 + (1 << log2_trafo_size_c), log2_trafo_size_c, 1, intra_pred_mode_chroma);
  509|   333k|                    }
  510|  3.83M|#endif
  511|  3.83M|#ifdef ENABLE_MAIN_REXT_PROFILE
  512|  3.83M|                    if(ps_pps->i1_cross_component_prediction_enabled_flag
  ------------------
  |  Branch (512:24): [True: 247k, False: 3.58M]
  ------------------
  513|   247k|                                    && ps_codec->s_parse.s_cu.i1_cbf_luma
  ------------------
  |  Branch (513:40): [True: 236k, False: 10.7k]
  ------------------
  514|   236k|                                    && (ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTER
  ------------------
  |  Branch (514:41): [True: 459, False: 235k]
  ------------------
  515|   235k|                                                    || chroma_intra_pred_mode_idx == 4))
  ------------------
  |  Branch (515:56): [True: 213k, False: 22.4k]
  ------------------
  516|   213k|                    {
  517|   213k|                        ctxt_idx = IHEVC_CAB_CCP_LOG2_RES_ABS + 4;
  518|   213k|                        TRACE_CABAC_CTXT("log2_res_scale_abs_plus1", ps_cabac->u4_range, ctxt_idx);
  519|   213k|                        value = ihevcd_cabac_decode_bins_tunary(ps_cabac, ps_bitstrm, 4, ctxt_idx,
  520|   213k|                                                                0, 3);
  521|   213k|                        AEV_TRACE("log2_res_scale_abs_plus1", value, ps_cabac->u4_range);
  522|       |
  523|   213k|                        if(value != 0)
  ------------------
  |  Branch (523:28): [True: 140k, False: 73.5k]
  ------------------
  524|   140k|                        {
  525|   140k|                            ctxt_idx = IHEVC_CAB_CCP_RES_SIGN_FLAG + 1;
  526|   140k|                            TRACE_CABAC_CTXT("res_scale_sign_flag", ps_cabac->u4_range, ctxt_idx);
  527|   140k|                            ps_tu->b1_cr_log2_res_sign = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  528|   140k|                            AEV_TRACE("res_scale_sign_flag", value, ps_cabac->u4_range);
  529|   140k|                            ps_tu->b3_cr_log2_res_scale_abs_plus1 = value;
  530|   140k|                        }
  531|   213k|                    }
  532|  3.83M|#endif
  533|  3.83M|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])
  ------------------
  |  Branch (533:24): [True: 1.34M, False: 2.49M]
  ------------------
  534|  1.34M|                    {
  535|  1.34M|                        ps_tu->b1_cr_cbf = 1;
  536|  1.34M|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size_c, 2, intra_pred_mode_chroma);
  537|  1.34M|                    }
  538|  3.83M|#ifdef ENABLE_MAIN_REXT_PROFILE
  539|  3.83M|                    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: 1.08M, False: 2.74M]
  |  Branch (539:81): [True: 344k, False: 739k]
  ------------------
  540|   344k|                    {
  541|   344k|                        ps_tu->b1_cr_cbf_subtu1 = 1;
  542|   344k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0 + (1 << log2_trafo_size_c), log2_trafo_size_c, 2, intra_pred_mode_chroma);
  543|   344k|                    }
  544|  3.83M|#endif
  545|  3.83M|                }
  546|  3.36M|                else if(blk_idx == 3)
  ------------------
  |  Branch (546:25): [True: 832k, False: 2.52M]
  ------------------
  547|   832k|                {
  548|   832k|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth])
  ------------------
  |  Branch (548:24): [True: 424k, False: 408k]
  ------------------
  549|   424k|                    {
  550|   424k|                        ps_tu->b1_cb_cbf = 1;
  551|   424k|                        ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 1, intra_pred_mode_chroma);
  552|   424k|                    }
  553|   832k|#ifdef ENABLE_MAIN_REXT_PROFILE
  554|   832k|                    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: 255k, False: 577k]
  |  Branch (554:81): [True: 143k, False: 112k]
  ------------------
  555|   143k|                    {
  556|   143k|                        ps_tu->b1_cb_cbf_subtu1 = 1;
  557|   143k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 1, intra_pred_mode_chroma);
  558|   143k|                    }
  559|   832k|#endif
  560|       |
  561|   832k|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])
  ------------------
  |  Branch (561:24): [True: 434k, False: 398k]
  ------------------
  562|   434k|                    {
  563|   434k|                        ps_tu->b1_cr_cbf = 1;
  564|   434k|                        ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 2, intra_pred_mode_chroma);
  565|   434k|                    }
  566|   832k|#ifdef ENABLE_MAIN_REXT_PROFILE
  567|   832k|                    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: 255k, False: 577k]
  |  Branch (567:81): [True: 141k, False: 113k]
  ------------------
  568|   141k|                    {
  569|   141k|                        ps_tu->b1_cr_cbf_subtu1 = 1;
  570|   141k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 2, intra_pred_mode_chroma);
  571|   141k|                    }
  572|   832k|#endif
  573|   832k|                }
  574|  2.52M|                else
  575|  2.52M|                {
  576|       |                    //ps_tu->b1_chroma_present = 0;
  577|  2.52M|                    ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  2.52M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
  578|  2.52M|                }
  579|  7.19M|            }
  580|  2.76M|            else
  581|  2.76M|            {
  582|  2.76M|                if((3 != blk_idx) && (2 == log2_trafo_size && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (582:20): [True: 2.14M, False: 615k]
  |  Branch (582:39): [True: 1.12M, False: 1.02M]
  |  Branch (582:63): [True: 1.12M, False: 0]
  ------------------
  583|  1.12M|                {
  584|  1.12M|                    ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  1.12M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
  585|  1.12M|                }
  586|  2.76M|            }
  587|       |
  588|       |            /* Set the first TU in CU flag */
  589|  9.95M|            {
  590|  9.95M|                if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (590:20): [True: 5.67M, False: 4.28M]
  ------------------
  591|  5.67M|                                (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (591:33): [True: 4.01M, False: 1.65M]
  ------------------
  592|  4.01M|                {
  593|  4.01M|                    ps_tu->b1_first_tu_in_cu = 1;
  594|  4.01M|                }
  595|  5.93M|                else
  596|  5.93M|                {
  597|  5.93M|                    ps_tu->b1_first_tu_in_cu = 0;
  598|  5.93M|                }
  599|  9.95M|            }
  600|  9.95M|            ps_codec->s_parse.ps_tu++;
  601|  9.95M|            ps_codec->s_parse.s_cu.i4_tu_cnt++;
  602|  9.95M|            ps_codec->s_parse.i4_pic_tu_idx++;
  603|  9.95M|        }
  604|  11.9M|    }
  605|  11.9M|    return ret;
  606|  11.9M|}
ihevcd_parse_mvd:
  627|   760k|{
  628|   760k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  629|   760k|    WORD32 value;
  630|   760k|    WORD32 abs_mvd;
  631|   760k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  632|   760k|    WORD32 abs_mvd_greater0_flag[2];
  633|   760k|    WORD32 abs_mvd_greater1_flag[2];
  634|   760k|    WORD32 ctxt_idx;
  635|   760k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  636|       |
  637|       |
  638|   760k|    ctxt_idx  = IHEVC_CAB_MVD_GRT0;
  639|       |    /* encode absmvd_x > 0 */
  640|   760k|    TRACE_CABAC_CTXT("abs_mvd_greater0_flag[0]", ps_cabac->u4_range, ctxt_idx);
  641|   760k|    abs_mvd_greater0_flag[0] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  642|   760k|    AEV_TRACE("abs_mvd_greater0_flag[0]", abs_mvd_greater0_flag[0], ps_cabac->u4_range);
  643|       |
  644|       |    /* encode absmvd_y > 0 */
  645|   760k|    TRACE_CABAC_CTXT("abs_mvd_greater0_flag[1]", ps_cabac->u4_range, ctxt_idx);
  646|   760k|    abs_mvd_greater0_flag[1] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  647|   760k|    AEV_TRACE("abs_mvd_greater0_flag[1]", abs_mvd_greater0_flag[1], ps_cabac->u4_range);
  648|       |
  649|   760k|    ctxt_idx  = IHEVC_CAB_MVD_GRT1;
  650|   760k|    abs_mvd_greater1_flag[0] = 0;
  651|   760k|    abs_mvd_greater1_flag[1] = 0;
  652|       |
  653|   760k|    if(abs_mvd_greater0_flag[0])
  ------------------
  |  Branch (653:8): [True: 329k, False: 431k]
  ------------------
  654|   329k|    {
  655|   329k|        TRACE_CABAC_CTXT("abs_mvd_greater1_flag[0]", ps_cabac->u4_range, ctxt_idx);
  656|   329k|        abs_mvd_greater1_flag[0] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  657|   329k|        AEV_TRACE("abs_mvd_greater1_flag[0]", abs_mvd_greater1_flag[0], ps_cabac->u4_range);
  658|   329k|    }
  659|   760k|    if(abs_mvd_greater0_flag[1])
  ------------------
  |  Branch (659:8): [True: 330k, False: 430k]
  ------------------
  660|   330k|    {
  661|   330k|        TRACE_CABAC_CTXT("abs_mvd_greater1_flag[1]", ps_cabac->u4_range, ctxt_idx);
  662|   330k|        abs_mvd_greater1_flag[1] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  663|   330k|        AEV_TRACE("abs_mvd_greater1_flag[1]", abs_mvd_greater1_flag[1], ps_cabac->u4_range);
  664|   330k|    }
  665|   760k|    abs_mvd = 0;
  666|   760k|    if(abs_mvd_greater0_flag[0])
  ------------------
  |  Branch (666:8): [True: 329k, False: 431k]
  ------------------
  667|   329k|    {
  668|   329k|        abs_mvd = 1;
  669|   329k|        if(abs_mvd_greater1_flag[0])
  ------------------
  |  Branch (669:12): [True: 133k, False: 195k]
  ------------------
  670|   133k|        {
  671|   133k|            value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 1);
  672|   133k|            AEV_TRACE("abs_mvd_minus2[0]", value, ps_cabac->u4_range);
  673|   133k|            abs_mvd = value + 2;
  674|   133k|        }
  675|   329k|        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  676|   329k|        AEV_TRACE("mvd_sign_flag[0]", value, ps_cabac->u4_range);
  677|   329k|        if(value)
  ------------------
  |  Branch (677:12): [True: 160k, False: 168k]
  ------------------
  678|   160k|        {
  679|   160k|            abs_mvd = -abs_mvd;
  680|   160k|        }
  681|       |
  682|   329k|    }
  683|   760k|    ps_mv->i2_mvx = abs_mvd;
  684|   760k|    abs_mvd = 0;
  685|   760k|    if(abs_mvd_greater0_flag[1])
  ------------------
  |  Branch (685:8): [True: 330k, False: 430k]
  ------------------
  686|   330k|    {
  687|   330k|        abs_mvd = 1;
  688|   330k|        if(abs_mvd_greater1_flag[1])
  ------------------
  |  Branch (688:12): [True: 135k, False: 195k]
  ------------------
  689|   135k|        {
  690|   135k|            value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 1);
  691|   135k|            AEV_TRACE("abs_mvd_minus2[1]", value, ps_cabac->u4_range);
  692|   135k|            abs_mvd = value + 2;
  693|       |
  694|   135k|        }
  695|   330k|        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  696|   330k|        AEV_TRACE("mvd_sign_flag[1]", value, ps_cabac->u4_range);
  697|       |
  698|   330k|        if(value)
  ------------------
  |  Branch (698:12): [True: 159k, False: 170k]
  ------------------
  699|   159k|        {
  700|   159k|            abs_mvd = -abs_mvd;
  701|   159k|        }
  702|   330k|    }
  703|   760k|    ps_mv->i2_mvy = abs_mvd;
  704|       |
  705|   760k|    return ret;
  706|   760k|}
ihevcd_parse_pcm_sample:
  733|  2.47k|{
  734|  2.47k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  735|  2.47k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  736|  2.47k|    sps_t *ps_sps;
  737|       |
  738|  2.47k|    WORD32 value;
  739|  2.47k|    WORD32 i;
  740|       |
  741|  2.47k|    WORD32 num_bits;
  742|  2.47k|    UWORD32 u4_sig_coeff_map;
  743|  2.47k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  744|  2.47k|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
  745|  2.47k|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  746|  2.47k|    UWORD8 *pu1_coeff_data;
  747|  2.47k|    WORD32 bit_depth;
  748|  2.47k|    ps_sps = ps_codec->s_parse.ps_sps;
  749|       |
  750|  2.47k|    UNUSED(value);
  ------------------
  |  |   38|  2.47k|#define UNUSED(x) ((void)(x))
  ------------------
  751|  2.47k|    UNUSED(ps_tu);
  ------------------
  |  |   38|  2.47k|#define UNUSED(x) ((void)(x))
  ------------------
  752|  2.47k|    UNUSED(ps_cabac);
  ------------------
  |  |   38|  2.47k|#define UNUSED(x) ((void)(x))
  ------------------
  753|  2.47k|    UNUSED(x0);
  ------------------
  |  |   38|  2.47k|#define UNUSED(x) ((void)(x))
  ------------------
  754|  2.47k|    UNUSED(y0);
  ------------------
  |  |   38|  2.47k|#define UNUSED(x) ((void)(x))
  ------------------
  755|       |
  756|  2.47k|    {
  757|  2.47k|        WORD8 *pi1_scan_idx;
  758|  2.47k|        WORD8 *pi1_buf = (WORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
  759|  2.47k|        WORD8 *pi1_num_coded_subblks;
  760|       |
  761|       |        /* First WORD8 gives number of coded subblocks */
  762|  2.47k|        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.47k|        *pi1_num_coded_subblks = 1;
  767|       |
  768|       |        /* Second WORD8 gives (scan idx << 1) | trans_skip */
  769|  2.47k|        pi1_scan_idx = pi1_buf++;
  770|  2.47k|        *pi1_scan_idx = (0 << 1) | 1;
  771|       |
  772|       |        /* Store the incremented pointer in pv_tu_coeff_data */
  773|  2.47k|        ps_codec->s_parse.pv_tu_coeff_data = pi1_buf;
  774|       |
  775|  2.47k|    }
  776|       |
  777|  2.47k|    u4_sig_coeff_map = 0xFFFFFFFF;
  778|  2.47k|    ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)ps_codec->s_parse.pv_tu_coeff_data;
  779|  2.47k|    ps_tu_sblk_coeff_data->u2_sig_coeff_map = u4_sig_coeff_map;
  780|  2.47k|    ps_tu_sblk_coeff_data->u2_subblk_pos = 0;
  781|       |
  782|  2.47k|    pu1_coeff_data = (UWORD8 *)&ps_tu_sblk_coeff_data->ai2_level[0];
  783|       |
  784|  2.47k|    num_bits = ps_sps->i1_pcm_sample_bit_depth_luma;
  785|  2.47k|    bit_depth = ps_codec->i4_bit_depth_luma;
  786|       |
  787|  2.47k|    WORD32 luma_samples = 1 << (log2_cb_size << 1);
  788|   381k|    for(i = 0; i < luma_samples; i++)
  ------------------
  |  Branch (788:16): [True: 379k, False: 2.47k]
  ------------------
  789|   379k|    {
  790|   379k|        TRACE_CABAC_CTXT("pcm_sample_luma", ps_cabac->u4_range, 0);
  791|   379k|        BITS_PARSE("pcm_sample_luma", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|   379k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  792|       |
  793|       |        //ps_pcmsample_t->i1_pcm_sample_luma[i] = value;
  794|   379k|        if (bit_depth > 8)
  ------------------
  |  Branch (794:13): [True: 5.69k, False: 373k]
  ------------------
  795|  5.69k|        {
  796|  5.69k|            *(UWORD16 *)pu1_coeff_data = value << (bit_depth - num_bits);
  797|  5.69k|            pu1_coeff_data += 2;
  798|  5.69k|        }
  799|   373k|        else
  800|   373k|        {
  801|   373k|            *pu1_coeff_data++ = value << (bit_depth - num_bits);
  802|   373k|        }
  803|   379k|    }
  804|       |
  805|  2.47k|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (805:8): [True: 2.41k, False: 67]
  ------------------
  806|  2.41k|    {
  807|  2.41k|        WORD32 chroma_samples = 0;
  808|  2.41k|        bit_depth = ps_codec->i4_bit_depth_chroma;
  809|       |
  810|  2.41k|        if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (810:12): [True: 0, False: 2.41k]
  ------------------
  811|      0|            chroma_samples = luma_samples << 1;
  812|  2.41k|        else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (812:17): [True: 72, False: 2.33k]
  ------------------
  813|     72|            chroma_samples = luma_samples;
  814|  2.33k|        else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (814:17): [True: 2.33k, False: 0]
  ------------------
  815|  2.33k|            chroma_samples = luma_samples >> 1;
  816|  2.41k|        num_bits = ps_sps->i1_pcm_sample_bit_depth_chroma;
  817|   191k|        for(i = 0; i < chroma_samples; i++)
  ------------------
  |  Branch (817:20): [True: 189k, False: 2.41k]
  ------------------
  818|   189k|        {
  819|   189k|            TRACE_CABAC_CTXT("pcm_sample_chroma", ps_cabac->u4_range, 0);
  820|   189k|            BITS_PARSE("pcm_sample_chroma", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|   189k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  821|   189k|            if (bit_depth > 8)
  ------------------
  |  Branch (821:17): [True: 5.53k, False: 183k]
  ------------------
  822|  5.53k|            {
  823|  5.53k|                *(UWORD16 *)pu1_coeff_data = value << (bit_depth - num_bits);
  824|  5.53k|                pu1_coeff_data += 2;
  825|  5.53k|            }
  826|   183k|            else
  827|   183k|            {
  828|   183k|                *pu1_coeff_data++ = value << (bit_depth - num_bits);
  829|   183k|            }
  830|   189k|        }
  831|  2.41k|    }
  832|       |
  833|  2.47k|    ps_codec->s_parse.pv_tu_coeff_data = pu1_coeff_data;
  834|       |
  835|  2.47k|    return ret;
  836|  2.47k|}
ihevcd_parse_pu_mvp:
  858|   677k|{
  859|   677k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  860|   677k|    WORD32 value;
  861|   677k|    slice_header_t *ps_slice_hdr;
  862|   677k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  863|   677k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  864|   677k|    WORD32 inter_pred_idc;
  865|       |
  866|   677k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  867|       |
  868|   677k|    if(ps_slice_hdr->i1_slice_type == BSLICE)
  ------------------
  |  Branch (868:8): [True: 673k, False: 3.67k]
  ------------------
  869|   673k|    {
  870|   673k|        WORD32 pu_w_plus_pu_h;
  871|   673k|        WORD32 ctxt_idx;
  872|       |        /* required to check if w+h==12 case */
  873|   673k|        pu_w_plus_pu_h = ((ps_pu->b4_wd + 1) << 2) + ((ps_pu->b4_ht + 1) << 2);
  874|   673k|        if(12 == pu_w_plus_pu_h)
  ------------------
  |  Branch (874:12): [True: 367k, False: 306k]
  ------------------
  875|   367k|        {
  876|   367k|            ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + 4;
  877|   367k|            TRACE_CABAC_CTXT("inter_pred_idc", ps_cabac->u4_range, ctxt_idx);
  878|   367k|            inter_pred_idc = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
  879|   367k|                                                     ctxt_idx);
  880|   367k|        }
  881|   306k|        else
  882|   306k|        {
  883|       |            /* larger PUs can be encoded as bi_pred/l0/l1 inter_pred_idc */
  884|   306k|            WORD32 is_bipred;
  885|       |
  886|   306k|            ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + ps_codec->s_parse.i4_ct_depth;
  887|   306k|            TRACE_CABAC_CTXT("inter_pred_idc", ps_cabac->u4_range, ctxt_idx);
  888|   306k|            is_bipred = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  889|   306k|            inter_pred_idc = PRED_BI;
  890|   306k|            if(!is_bipred)
  ------------------
  |  Branch (890:16): [True: 199k, False: 106k]
  ------------------
  891|   199k|            {
  892|   199k|                ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + 4;
  893|   199k|                inter_pred_idc = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
  894|   199k|                                                         ctxt_idx);
  895|   199k|            }
  896|   306k|        }
  897|       |
  898|   673k|        AEV_TRACE("inter_pred_idc", inter_pred_idc, ps_cabac->u4_range);
  899|   673k|    }
  900|  3.67k|    else
  901|  3.67k|        inter_pred_idc = PRED_L0;
  902|   677k|    ps_pu->mv.i1_l0_ref_idx = 0;
  903|   677k|    ps_pu->mv.i1_l1_ref_idx = 0;
  904|       |    /* Decode MVD for L0 for PRED_L0 or PRED_BI */
  905|   677k|    if(inter_pred_idc != PRED_L1)
  ------------------
  |  Branch (905:8): [True: 551k, False: 125k]
  ------------------
  906|   551k|    {
  907|   551k|        WORD32 active_refs = ps_slice_hdr->i1_num_ref_idx_l0_active;
  908|   551k|        WORD32 ref_idx = 0;
  909|   551k|        WORD32 ctxt_idx;
  910|       |
  911|   551k|        if(active_refs > 1)
  ------------------
  |  Branch (911:12): [True: 478k, False: 73.1k]
  ------------------
  912|   478k|        {
  913|   478k|            ctxt_idx = IHEVC_CAB_INTER_REF_IDX;
  914|       |            /* encode the context modelled first bin */
  915|   478k|            TRACE_CABAC_CTXT("ref_idx", ps_cabac->u4_range, ctxt_idx);
  916|   478k|            ref_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  917|       |
  918|   478k|            if((active_refs > 2) && ref_idx)
  ------------------
  |  Branch (918:16): [True: 177k, False: 301k]
  |  Branch (918:37): [True: 59.6k, False: 117k]
  ------------------
  919|  59.6k|            {
  920|  59.6k|                WORD32 value;
  921|       |                /* encode the context modelled second bin */
  922|  59.6k|                ctxt_idx++;
  923|  59.6k|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  924|  59.6k|                ref_idx += value;
  925|  59.6k|                if((active_refs > 3) && value)
  ------------------
  |  Branch (925:20): [True: 56.7k, False: 2.87k]
  |  Branch (925:41): [True: 14.8k, False: 41.9k]
  ------------------
  926|  14.8k|                {
  927|       |                    /* encode remaining bypass bins */
  928|  14.8k|                    ref_idx = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac,
  929|  14.8k|                                                                     ps_bitstrm,
  930|  14.8k|                                                                     (active_refs - 3)
  931|  14.8k|                    );
  932|  14.8k|                    ref_idx += 2;
  933|  14.8k|                }
  934|  59.6k|            }
  935|   478k|            AEV_TRACE("ref_idx", ref_idx, ps_cabac->u4_range);
  936|   478k|        }
  937|       |
  938|   551k|        ref_idx = CLIP3(ref_idx, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   40|   551k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 551k]
  |  |  |  Branch (40:53): [True: 0, False: 551k]
  |  |  ------------------
  ------------------
  939|   551k|        ps_pu->mv.i1_l0_ref_idx = ref_idx;
  940|       |
  941|   551k|        ihevcd_parse_mvd(ps_codec, &ps_pu->mv.s_l0_mv);
  942|       |
  943|   551k|        ctxt_idx = IHEVC_CAB_MVP_L0L1;
  944|   551k|        value = ihevcd_cabac_decode_bin(ps_cabac,
  945|   551k|                                        ps_bitstrm,
  946|   551k|                                        ctxt_idx);
  947|       |
  948|   551k|        AEV_TRACE("mvp_l0/l1_flag", value, ps_cabac->u4_range);
  949|       |
  950|   551k|        ps_pu->b1_l0_mvp_idx = value;
  951|       |
  952|   551k|    }
  953|       |    /* Decode MVD for L1 for PRED_L1 or PRED_BI */
  954|   677k|    if(inter_pred_idc != PRED_L0)
  ------------------
  |  Branch (954:8): [True: 232k, False: 444k]
  ------------------
  955|   232k|    {
  956|   232k|        WORD32 active_refs = ps_slice_hdr->i1_num_ref_idx_l1_active;
  957|   232k|        WORD32 ref_idx = 0;
  958|   232k|        WORD32 ctxt_idx;
  959|       |
  960|   232k|        if(active_refs > 1)
  ------------------
  |  Branch (960:12): [True: 203k, False: 29.2k]
  ------------------
  961|   203k|        {
  962|       |
  963|   203k|            ctxt_idx = IHEVC_CAB_INTER_REF_IDX;
  964|   203k|            TRACE_CABAC_CTXT("ref_idx", ps_cabac->u4_range, ctxt_idx);
  965|       |            /* encode the context modelled first bin */
  966|   203k|            ref_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  967|       |
  968|   203k|            if((active_refs > 2) && ref_idx)
  ------------------
  |  Branch (968:16): [True: 75.3k, False: 127k]
  |  Branch (968:37): [True: 34.0k, False: 41.2k]
  ------------------
  969|  34.0k|            {
  970|  34.0k|                WORD32 value;
  971|       |                /* encode the context modelled second bin */
  972|  34.0k|                ctxt_idx++;
  973|  34.0k|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  974|  34.0k|                ref_idx += value;
  975|  34.0k|                if((active_refs > 3) && value)
  ------------------
  |  Branch (975:20): [True: 31.1k, False: 2.94k]
  |  Branch (975:41): [True: 5.73k, False: 25.4k]
  ------------------
  976|  5.73k|                {
  977|       |                    /* encode remaining bypass bins */
  978|  5.73k|                    ref_idx = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac,
  979|  5.73k|                                                                     ps_bitstrm,
  980|  5.73k|                                                                     (active_refs - 3)
  981|  5.73k|                    );
  982|  5.73k|                    ref_idx += 2;
  983|  5.73k|                }
  984|  34.0k|            }
  985|       |
  986|   203k|            AEV_TRACE("ref_idx", ref_idx, ps_cabac->u4_range);
  987|   203k|        }
  988|       |
  989|   232k|        ref_idx = CLIP3(ref_idx, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   40|   232k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 232k]
  |  |  |  Branch (40:53): [True: 0, False: 232k]
  |  |  ------------------
  ------------------
  990|   232k|        ps_pu->mv.i1_l1_ref_idx = ref_idx;
  991|       |
  992|   232k|        if(ps_slice_hdr->i1_mvd_l1_zero_flag && inter_pred_idc == PRED_BI)
  ------------------
  |  Branch (992:12): [True: 46.4k, False: 186k]
  |  Branch (992:49): [True: 23.2k, False: 23.1k]
  ------------------
  993|  23.2k|        {
  994|  23.2k|            ps_pu->mv.s_l1_mv.i2_mvx = 0;
  995|  23.2k|            ps_pu->mv.s_l1_mv.i2_mvy = 0;
  996|  23.2k|        }
  997|   209k|        else
  998|   209k|        {
  999|   209k|            ihevcd_parse_mvd(ps_codec, &ps_pu->mv.s_l1_mv);
 1000|   209k|        }
 1001|       |
 1002|   232k|        ctxt_idx = IHEVC_CAB_MVP_L0L1;
 1003|   232k|        value = ihevcd_cabac_decode_bin(ps_cabac,
 1004|   232k|                                        ps_bitstrm,
 1005|   232k|                                        ctxt_idx);
 1006|       |
 1007|   232k|        AEV_TRACE("mvp_l0/l1_flag", value, ps_cabac->u4_range);
 1008|   232k|        ps_pu->b1_l1_mvp_idx = value;
 1009|       |
 1010|   232k|    }
 1011|       |
 1012|   677k|    ps_pu->b2_pred_mode = inter_pred_idc;
 1013|   677k|    return ret;
 1014|   677k|}
ihevcd_parse_prediction_unit:
 1040|  2.40M|{
 1041|  2.40M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1042|  2.40M|    slice_header_t *ps_slice_hdr;
 1043|  2.40M|    sps_t *ps_sps;
 1044|  2.40M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1045|  2.40M|    WORD32 ctb_x_base;
 1046|  2.40M|    WORD32 ctb_y_base;
 1047|       |
 1048|  2.40M|    pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1049|  2.40M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1050|       |
 1051|  2.40M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1052|       |
 1053|       |    /* Set PU structure to default values */
 1054|  2.40M|    memset(ps_pu, 0, sizeof(pu_t));
 1055|       |
 1056|  2.40M|    ps_sps = ps_codec->s_parse.ps_sps;
 1057|  2.40M|    ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1058|  2.40M|    ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1059|       |
 1060|  2.40M|    ps_pu->b4_pos_x = (x0 - ctb_x_base) >> 2;
 1061|  2.40M|    ps_pu->b4_pos_y = (y0 - ctb_y_base) >> 2;
 1062|  2.40M|    ps_pu->b4_wd = (wd >> 2) - 1;
 1063|  2.40M|    ps_pu->b4_ht = (ht >> 2) - 1;
 1064|       |
 1065|  2.40M|    ps_pu->b1_intra_flag = 0;
 1066|  2.40M|    ps_pu->b3_part_mode = ps_codec->s_parse.s_cu.i4_part_mode;
 1067|       |
 1068|  2.40M|    if(PRED_MODE_SKIP == ps_codec->s_parse.s_cu.i4_pred_mode)
  ------------------
  |  Branch (1068:8): [True: 1.21M, False: 1.19M]
  ------------------
 1069|  1.21M|    {
 1070|  1.21M|        WORD32 merge_idx = 0;
 1071|  1.21M|        if(ps_slice_hdr->i1_max_num_merge_cand > 1)
  ------------------
  |  Branch (1071:12): [True: 1.21M, False: 2.82k]
  ------------------
 1072|  1.21M|        {
 1073|  1.21M|            WORD32 ctxt_idx = IHEVC_CAB_MERGE_IDX_EXT;
 1074|  1.21M|            WORD32 bin;
 1075|       |
 1076|  1.21M|            TRACE_CABAC_CTXT("merge_idx", ps_cabac->u4_range, ctxt_idx);
 1077|  1.21M|            bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1078|  1.21M|            if(bin)
  ------------------
  |  Branch (1078:16): [True: 338k, False: 872k]
  ------------------
 1079|   338k|            {
 1080|   338k|                if(ps_slice_hdr->i1_max_num_merge_cand > 2)
  ------------------
  |  Branch (1080:20): [True: 327k, False: 10.1k]
  ------------------
 1081|   327k|                {
 1082|   327k|                    merge_idx = ihevcd_cabac_decode_bypass_bins_tunary(
 1083|   327k|                                    ps_cabac, ps_bitstrm,
 1084|   327k|                                    (ps_slice_hdr->i1_max_num_merge_cand - 2));
 1085|   327k|                }
 1086|   338k|                merge_idx++;
 1087|   338k|            }
 1088|  1.21M|            AEV_TRACE("merge_idx", merge_idx, ps_cabac->u4_range);
 1089|  1.21M|        }
 1090|  1.21M|        ps_pu->b1_merge_flag = 1;
 1091|  1.21M|        ps_pu->b3_merge_idx = merge_idx;
 1092|       |
 1093|  1.21M|    }
 1094|  1.19M|    else
 1095|  1.19M|    {
 1096|       |        /* MODE_INTER */
 1097|  1.19M|        WORD32 merge_flag;
 1098|  1.19M|        WORD32 ctxt_idx = IHEVC_CAB_MERGE_FLAG_EXT;
 1099|  1.19M|        TRACE_CABAC_CTXT("merge_flag", ps_cabac->u4_range, ctxt_idx);
 1100|  1.19M|        merge_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1101|  1.19M|        AEV_TRACE("merge_flag", merge_flag, ps_cabac->u4_range);
 1102|       |
 1103|  1.19M|        ps_pu->b1_merge_flag = merge_flag;
 1104|       |
 1105|  1.19M|        if(merge_flag)
  ------------------
  |  Branch (1105:12): [True: 515k, False: 677k]
  ------------------
 1106|   515k|        {
 1107|   515k|            WORD32 merge_idx = 0;
 1108|   515k|            if(ps_slice_hdr->i1_max_num_merge_cand > 1)
  ------------------
  |  Branch (1108:16): [True: 510k, False: 4.48k]
  ------------------
 1109|   510k|            {
 1110|   510k|                WORD32 ctxt_idx = IHEVC_CAB_MERGE_IDX_EXT;
 1111|   510k|                WORD32 bin;
 1112|   510k|                TRACE_CABAC_CTXT("merge_idx", ps_cabac->u4_range, ctxt_idx);
 1113|   510k|                bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1114|   510k|                if(bin)
  ------------------
  |  Branch (1114:20): [True: 166k, False: 344k]
  ------------------
 1115|   166k|                {
 1116|   166k|                    if(ps_slice_hdr->i1_max_num_merge_cand > 2)
  ------------------
  |  Branch (1116:24): [True: 148k, False: 17.9k]
  ------------------
 1117|   148k|                    {
 1118|   148k|                        merge_idx = ihevcd_cabac_decode_bypass_bins_tunary(
 1119|   148k|                                        ps_cabac, ps_bitstrm,
 1120|   148k|                                        (ps_slice_hdr->i1_max_num_merge_cand - 2));
 1121|   148k|                    }
 1122|   166k|                    merge_idx++;
 1123|   166k|                }
 1124|   510k|                AEV_TRACE("merge_idx", merge_idx, ps_cabac->u4_range);
 1125|   510k|            }
 1126|       |
 1127|   515k|            ps_pu->b3_merge_idx = merge_idx;
 1128|   515k|        }
 1129|   677k|        else
 1130|   677k|        {
 1131|   677k|            ihevcd_parse_pu_mvp(ps_codec, ps_pu);
 1132|   677k|        }
 1133|       |
 1134|  1.19M|    }
 1135|  2.40M|    STATS_UPDATE_PU_SIZE(ps_pu);
  ------------------
  |  |  145|  2.40M|#define STATS_UPDATE_PU_SIZE(ps_pu) ;
  ------------------
 1136|       |    /* Increment PU pointer */
 1137|  2.40M|    ps_codec->s_parse.ps_pu++;
 1138|  2.40M|    ps_codec->s_parse.i4_pic_pu_idx++;
 1139|  2.40M|    return ret;
 1140|  2.40M|}
ihevcd_parse_part_mode_amp:
 1144|   173k|{
 1145|   173k|    WORD32 ctxt_idx = IHEVC_CAB_PART_MODE;
 1146|   173k|    WORD32 part_mode_idx;
 1147|   173k|    WORD32 part_mode;
 1148|   173k|    WORD32 bin;
 1149|       |
 1150|   173k|    part_mode = 0;
 1151|   173k|    TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, ctxt_idx);
 1152|   173k|    bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx++);
 1153|       |
 1154|   173k|    if(!bin)
  ------------------
  |  Branch (1154:8): [True: 107k, False: 65.1k]
  ------------------
 1155|   107k|    {
 1156|   107k|        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx++);
 1157|   107k|        part_mode_idx = bin;
 1158|   107k|        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|   107k|        ctxt_idx += 1;
 1164|       |
 1165|   107k|        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1166|   107k|        part_mode_idx |= bin;
 1167|       |
 1168|   107k|        part_mode_idx <<= 1;
 1169|   107k|        if(!bin)
  ------------------
  |  Branch (1169:12): [True: 64.7k, False: 43.1k]
  ------------------
 1170|  64.7k|        {
 1171|       |
 1172|  64.7k|            bin = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 1173|  64.7k|            part_mode_idx |= bin;
 1174|  64.7k|        }
 1175|   107k|        part_mode = gau1_part_mode_amp[part_mode_idx];
 1176|   107k|    }
 1177|   173k|    return part_mode;
 1178|   173k|}
ihevcd_parse_coding_unit_intra:
 1183|  3.77M|{
 1184|  3.77M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1185|  3.77M|    sps_t *ps_sps;
 1186|  3.77M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1187|  3.77M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1188|  3.77M|    WORD32 pcm_flag;
 1189|  3.77M|    WORD32 value;
 1190|  3.77M|    WORD32 cb_size = 1 << log2_cb_size;
 1191|  3.77M|    WORD32 part_mode =  ps_codec->s_parse.s_cu.i4_part_mode;
 1192|  3.77M|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 1193|  3.77M|    pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1194|  3.77M|    WORD32 ctb_x_base;
 1195|  3.77M|    WORD32 ctb_y_base;
 1196|  3.77M|    ps_sps = ps_codec->s_parse.ps_sps;
 1197|  3.77M|    ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1198|  3.77M|    ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1199|       |
 1200|  3.77M|    memset(ps_pu, 0, sizeof(pu_t));
 1201|  3.77M|    ps_pu->b1_intra_flag = 1;
 1202|  3.77M|    ps_pu->b4_wd = (cb_size >> 2) - 1;
 1203|  3.77M|    ps_pu->b4_ht = (cb_size >> 2) - 1;
 1204|  3.77M|    ps_pu->b4_pos_x = (x0 - ctb_x_base) >> 2;
 1205|  3.77M|    ps_pu->b4_pos_y = (y0 - ctb_y_base) >> 2;
 1206|       |
 1207|  3.77M|    pcm_flag = 0;
 1208|  3.77M|    if((PART_2Nx2N == part_mode) && (ps_sps->i1_pcm_enabled_flag)
  ------------------
  |  Branch (1208:8): [True: 2.99M, False: 778k]
  |  Branch (1208:37): [True: 30.9k, False: 2.96M]
  ------------------
 1209|  30.9k|                    && (log2_cb_size
  ------------------
  |  Branch (1209:24): [True: 29.8k, False: 1.17k]
  ------------------
 1210|  30.9k|                                    >= ps_sps->i1_log2_min_pcm_coding_block_size)
 1211|  29.8k|                    && (log2_cb_size
  ------------------
  |  Branch (1211:24): [True: 27.3k, False: 2.48k]
  ------------------
 1212|  29.8k|                                    <= (ps_sps->i1_log2_min_pcm_coding_block_size + ps_sps->i1_log2_diff_max_min_pcm_coding_block_size)))
 1213|  27.3k|    {
 1214|  27.3k|        TRACE_CABAC_CTXT("pcm_flag", ps_cabac->u4_range, 0);
 1215|  27.3k|        pcm_flag = ihevcd_cabac_decode_terminate(ps_cabac, ps_bitstrm);
 1216|  27.3k|        AEV_TRACE("pcm_flag", pcm_flag, ps_cabac->u4_range);
 1217|  27.3k|    }
 1218|       |
 1219|  3.77M|    ps_codec->s_parse.i4_cu_pcm_flag = pcm_flag;
 1220|  3.77M|    if(pcm_flag)
  ------------------
  |  Branch (1220:8): [True: 2.47k, False: 3.77M]
  ------------------
 1221|  2.47k|    {
 1222|  2.47k|        UWORD8 *pu1_luma_intra_pred_mode_top, *pu1_luma_intra_pred_mode_left;
 1223|  2.47k|        WORD32 i,  num_pred_blocks;
 1224|       |
 1225|  2.47k|        if(ps_codec->s_parse.s_bitstrm.u4_bit_ofst % 8)
  ------------------
  |  Branch (1225:12): [True: 2.21k, False: 258]
  ------------------
 1226|  2.21k|        {
 1227|  2.21k|            TRACE_CABAC_CTXT("pcm_alignment_zero_bit", ps_cabac->u4_range, 0);
 1228|  2.21k|            ihevcd_bits_flush_to_byte_boundary(&ps_codec->s_parse.s_bitstrm);
 1229|  2.21k|            AEV_TRACE("pcm_alignment_zero_bit", 0, ps_cabac->u4_range);
 1230|  2.21k|        }
 1231|       |
 1232|  2.47k|        ihevcd_parse_pcm_sample(ps_codec, x0, y0, log2_cb_size);
 1233|       |
 1234|  2.47k|        ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac,
 1235|  2.47k|                           &ps_codec->s_parse.s_bitstrm);
 1236|       |
 1237|  2.47k|        ps_tu = ps_codec->s_parse.ps_tu;
 1238|  2.47k|        ps_tu->b1_cb_cbf = 1;
 1239|  2.47k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1240|  2.47k|        ps_tu->b1_cb_cbf_subtu1 = 1;
 1241|  2.47k|#endif
 1242|  2.47k|        ps_tu->b1_cr_cbf = 1;
 1243|  2.47k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1244|  2.47k|        ps_tu->b1_cr_cbf_subtu1 = 1;
 1245|  2.47k|#endif
 1246|  2.47k|        ps_tu->b1_y_cbf = 1;
 1247|  2.47k|        ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1248|  2.47k|        ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1249|  2.47k|        ps_tu->b1_transquant_bypass = 1;
 1250|  2.47k|        ps_tu->b3_size = (log2_cb_size - 2);
 1251|  2.47k|        ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1252|  2.47k|        ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  2.47k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1253|  2.47k|        ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  521|  2.47k|#define INTRA_PRED_NONE  63
  ------------------
 1254|  2.47k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1255|  2.47k|        ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 1256|  2.47k|        ps_tu->b1_cb_log2_res_sign = 0;
 1257|  2.47k|        ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 1258|  2.47k|        ps_tu->b1_cr_log2_res_sign = 0;
 1259|  2.47k|#endif
 1260|       |
 1261|       |        /* Set the first TU in CU flag */
 1262|  2.47k|        {
 1263|  2.47k|            if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1263:16): [True: 2.47k, False: 0]
  ------------------
 1264|  2.47k|                            (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1264:29): [True: 2.47k, False: 0]
  ------------------
 1265|  2.47k|            {
 1266|  2.47k|                ps_tu->b1_first_tu_in_cu = 1;
 1267|  2.47k|            }
 1268|      0|            else
 1269|      0|            {
 1270|      0|                ps_tu->b1_first_tu_in_cu = 0;
 1271|      0|            }
 1272|  2.47k|        }
 1273|       |
 1274|       |        /* Update the intra pred mode for PCM to INTRA_DC(default mode) */
 1275|  2.47k|        pu1_luma_intra_pred_mode_top = ps_codec->s_parse.pu1_luma_intra_pred_mode_top
 1276|  2.47k|                        + (ps_codec->s_parse.s_cu.i4_pos_x * 2);
 1277|       |
 1278|  2.47k|        pu1_luma_intra_pred_mode_left = ps_codec->s_parse.pu1_luma_intra_pred_mode_left
 1279|  2.47k|                        + (ps_codec->s_parse.s_cu.i4_pos_y * 2);
 1280|       |
 1281|  2.47k|        num_pred_blocks = 1; /* Because PCM part mode will be 2Nx2N */
 1282|       |
 1283|  2.47k|        memset(pu1_luma_intra_pred_mode_left, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  514|  2.47k|#define INTRA_DC                 1
  ------------------
                      memset(pu1_luma_intra_pred_mode_left, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  367|  2.47k|#define MIN_PU_SIZE         4
  ------------------
 1284|  2.47k|        memset(pu1_luma_intra_pred_mode_top, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  514|  2.47k|#define INTRA_DC                 1
  ------------------
                      memset(pu1_luma_intra_pred_mode_top, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  367|  2.47k|#define MIN_PU_SIZE         4
  ------------------
 1285|       |
 1286|       |
 1287|       |        /* Set no_loop_filter appropriately */
 1288|  2.47k|        if(1 == ps_sps->i1_pcm_loop_filter_disable_flag)
  ------------------
  |  Branch (1288:12): [True: 1.99k, False: 485]
  ------------------
 1289|  1.99k|        {
 1290|  1.99k|            UWORD8 *pu1_pic_no_loop_filter_flag;
 1291|  1.99k|            WORD32 numbytes_row;
 1292|  1.99k|            UWORD32 u4_mask;
 1293|       |
 1294|  1.99k|            pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1295|  1.99k|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1296|  1.99k|            pu1_pic_no_loop_filter_flag += (y0 / 8) * numbytes_row;
 1297|  1.99k|            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|  1.99k|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|  1.99k|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1301|  5.00k|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1301:24): [True: 3.01k, False: 1.99k]
  ------------------
 1302|  3.01k|            {
 1303|  3.01k|                *pu1_pic_no_loop_filter_flag |= (u4_mask << (((x0) / 8) % 8));
 1304|  3.01k|                pu1_pic_no_loop_filter_flag += numbytes_row;
 1305|  3.01k|            }
 1306|  1.99k|        }
 1307|       |        /* Increment ps_tu and tu_idx */
 1308|  2.47k|        ps_codec->s_parse.ps_tu++;
 1309|  2.47k|        ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1310|  2.47k|        ps_codec->s_parse.i4_pic_tu_idx++;
 1311|       |
 1312|  2.47k|    }
 1313|  3.77M|    else
 1314|  3.77M|    {
 1315|  3.77M|        WORD32 cnt = 0;
 1316|  3.77M|        WORD32 i;
 1317|  3.77M|        WORD32 part_cnt;
 1318|       |
 1319|  3.77M|        part_cnt = (part_mode == PART_NxN) ? 4 : 1;
  ------------------
  |  Branch (1319:20): [True: 778k, False: 2.99M]
  ------------------
 1320|       |
 1321|  9.88M|        for(i = 0; i < part_cnt; i++)
  ------------------
  |  Branch (1321:20): [True: 6.10M, False: 3.77M]
  ------------------
 1322|  6.10M|        {
 1323|  6.10M|            TRACE_CABAC_CTXT("prev_intra_pred_luma_flag", ps_cabac->u4_range, IHEVC_CAB_INTRA_LUMA_PRED_FLAG);
 1324|  6.10M|            value = ihevcd_cabac_decode_bin(ps_cabac,
 1325|  6.10M|                                            ps_bitstrm,
 1326|  6.10M|                                            IHEVC_CAB_INTRA_LUMA_PRED_FLAG);
 1327|       |
 1328|  6.10M|            ps_codec->s_parse.s_cu.ai4_prev_intra_luma_pred_flag[i] =
 1329|  6.10M|                            value;
 1330|  6.10M|            AEV_TRACE("prev_intra_pred_luma_flag", value, ps_cabac->u4_range);
 1331|  6.10M|        }
 1332|       |
 1333|  9.88M|        for(i = 0; i < part_cnt; i++)
  ------------------
  |  Branch (1333:20): [True: 6.10M, False: 3.77M]
  ------------------
 1334|  6.10M|        {
 1335|  6.10M|            if(ps_codec->s_parse.s_cu.ai4_prev_intra_luma_pred_flag[cnt])
  ------------------
  |  Branch (1335:16): [True: 3.43M, False: 2.67M]
  ------------------
 1336|  3.43M|            {
 1337|  3.43M|                value = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac, ps_bitstrm, 2);
 1338|  3.43M|                AEV_TRACE("mpm_idx", value, ps_cabac->u4_range);
 1339|  3.43M|                ps_codec->s_parse.s_cu.ai4_mpm_idx[cnt] = value;
 1340|  3.43M|            }
 1341|  2.67M|            else
 1342|  2.67M|            {
 1343|  2.67M|                value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 5);
 1344|  2.67M|                AEV_TRACE("rem_intra_luma_pred_mode", value,
 1345|  2.67M|                          ps_cabac->u4_range);
 1346|  2.67M|                ps_codec->s_parse.s_cu.ai4_rem_intra_luma_pred_mode[cnt] =
 1347|  2.67M|                                value;
 1348|  2.67M|            }
 1349|  6.10M|            cnt++;
 1350|  6.10M|        }
 1351|  3.77M|        if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1351:12): [True: 0, False: 3.77M]
  ------------------
 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.77M|        else if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1371:17): [True: 3.75M, False: 15.1k]
  ------------------
 1372|  3.75M|        {
 1373|  3.75M|            TRACE_CABAC_CTXT("intra_chroma_pred_mode", ps_cabac->u4_range, IHEVC_CAB_CHROMA_PRED_MODE);
 1374|  3.75M|            value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1375|  3.75M|                    IHEVC_CAB_CHROMA_PRED_MODE);
 1376|  3.75M|            ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0] = 4;
 1377|  3.75M|            if (value) {
  ------------------
  |  Branch (1377:17): [True: 523k, False: 3.23M]
  ------------------
 1378|   523k|                ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0] =
 1379|   523k|                        ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm,
 1380|   523k|                                2);
 1381|   523k|            }
 1382|  3.75M|            AEV_TRACE("intra_chroma_pred_mode",
 1383|  3.75M|                    ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0],
 1384|  3.75M|                    ps_cabac->u4_range);
 1385|       |
 1386|  3.75M|        }
 1387|  3.77M|        ihevcd_intra_pred_mode_prediction(ps_codec, log2_cb_size, x0, y0);
 1388|       |
 1389|  3.77M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && part_mode != PART_NxN)
  ------------------
  |  Branch (1389:12): [True: 3.75M, False: 15.1k]
  |  Branch (1389:73): [True: 2.98M, False: 774k]
  ------------------
 1390|  2.98M|        {
 1391|       |            // Only required for YUV444, but done for all formats to simplify calling arguments for ihevcd_parse_transform_tree
 1392|  2.98M|            parse_cu_t *ps_cu = &ps_codec->s_parse.s_cu;
 1393|  2.98M|            ps_cu->ai4_intra_chroma_pred_mode_idx[1] = ps_cu->ai4_intra_chroma_pred_mode_idx[0];
 1394|  2.98M|            ps_cu->ai4_intra_chroma_pred_mode_idx[2] = ps_cu->ai4_intra_chroma_pred_mode_idx[0];
 1395|  2.98M|            ps_cu->ai4_intra_chroma_pred_mode_idx[3] = ps_cu->ai4_intra_chroma_pred_mode_idx[0];
 1396|  2.98M|        }
 1397|  3.77M|    }
 1398|  3.77M|    STATS_UPDATE_PU_SIZE(ps_pu);
  ------------------
  |  |  145|  3.77M|#define STATS_UPDATE_PU_SIZE(ps_pu) ;
  ------------------
 1399|       |    /* Increment PU pointer */
 1400|  3.77M|    ps_codec->s_parse.ps_pu++;
 1401|  3.77M|    ps_codec->s_parse.i4_pic_pu_idx++;
 1402|       |
 1403|  3.77M|    return ret;
 1404|  3.77M|}
ihevcd_parse_coding_unit:
 1429|  5.73M|{
 1430|  5.73M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1431|  5.73M|    sps_t *ps_sps;
 1432|  5.73M|    pps_t *ps_pps;
 1433|  5.73M|    WORD32 cb_size;
 1434|  5.73M|    slice_header_t *ps_slice_hdr;
 1435|  5.73M|    WORD32 skip_flag;
 1436|  5.73M|    WORD32 pcm_flag;
 1437|  5.73M|    UWORD32 *pu4_skip_top = ps_codec->s_parse.pu4_skip_cu_top;
 1438|  5.73M|    UWORD32 u4_skip_left = ps_codec->s_parse.u4_skip_cu_left;
 1439|  5.73M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1440|  5.73M|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 1441|       |
 1442|  5.73M|    WORD32 cu_pos_x;
 1443|  5.73M|    WORD32 cu_pos_y;
 1444|  5.73M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1445|       |
 1446|  5.73M|    ASSERT(0 == (x0 % 8));
  ------------------
  |  |   55|  5.73M|#define ASSERT(x) {}
  ------------------
 1447|  5.73M|    ASSERT(0 == (y0 % 8));
  ------------------
  |  |   55|  5.73M|#define ASSERT(x) {}
  ------------------
 1448|       |
 1449|  5.73M|    ps_codec->s_parse.s_cu.i4_tu_cnt = 0;
 1450|  5.73M|    ps_sps = ps_codec->s_parse.ps_sps;
 1451|  5.73M|    ps_pps = ps_codec->s_parse.ps_pps;
 1452|       |
 1453|  5.73M|    cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x;
 1454|  5.73M|    cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y;
 1455|       |
 1456|       |
 1457|       |
 1458|  5.73M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1459|       |
 1460|       |
 1461|  5.73M|    cb_size = 1 << log2_cb_size;
 1462|       |
 1463|  5.73M|    ps_codec->s_parse.s_cu.i4_cu_transquant_bypass = 0;
 1464|       |
 1465|  5.73M|    if(ps_pps->i1_transquant_bypass_enable_flag)
  ------------------
  |  Branch (1465:8): [True: 1.11M, False: 4.62M]
  ------------------
 1466|  1.11M|    {
 1467|  1.11M|        TRACE_CABAC_CTXT("cu_transquant_bypass_flag", ps_cabac->u4_range, IHEVC_CAB_CU_TQ_BYPASS_FLAG);
 1468|  1.11M|        ps_codec->s_parse.s_cu.i4_cu_transquant_bypass =
 1469|  1.11M|                        ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1470|  1.11M|                                                IHEVC_CAB_CU_TQ_BYPASS_FLAG);
 1471|       |        /* Update transquant_bypass in ps_tu */
 1472|       |
 1473|  1.11M|        AEV_TRACE("cu_transquant_bypass_flag", ps_codec->s_parse.s_cu.i4_cu_transquant_bypass,
 1474|  1.11M|                  ps_cabac->u4_range);
 1475|       |
 1476|  1.11M|        if(ps_codec->s_parse.s_cu.i4_cu_transquant_bypass)
  ------------------
  |  Branch (1476:12): [True: 407k, False: 703k]
  ------------------
 1477|   407k|        {
 1478|   407k|            UWORD8 *pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1479|   407k|            UWORD32 u4_mask;
 1480|   407k|            WORD32 i;
 1481|   407k|            WORD32 numbytes_row;
 1482|   407k|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1483|   407k|            pu1_pic_no_loop_filter_flag += (y0 / 8) * numbytes_row;
 1484|   407k|            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|   407k|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|   407k|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1489|  1.22M|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1489:24): [True: 821k, False: 407k]
  ------------------
 1490|   821k|            {
 1491|   821k|                *pu1_pic_no_loop_filter_flag |= (u4_mask << (((x0) / 8) % 8));
 1492|   821k|                pu1_pic_no_loop_filter_flag += numbytes_row;
 1493|   821k|            }
 1494|   407k|        }
 1495|  1.11M|    }
 1496|       |
 1497|  5.73M|    {
 1498|  5.73M|        UWORD32 u4_skip_top = 0;
 1499|  5.73M|        UWORD32 u4_mask;
 1500|  5.73M|        UWORD32 u4_top_mask, u4_left_mask;
 1501|  5.73M|        UWORD32 u4_min_cu_x = x0 / 8;
 1502|  5.73M|        UWORD32 u4_min_cu_y = y0 / 8;
 1503|       |
 1504|  5.73M|        pu4_skip_top += (u4_min_cu_x / 32);
 1505|       |
 1506|       |
 1507|  5.73M|        if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1507:12): [True: 2.05M, False: 3.67M]
  ------------------
 1508|  2.05M|        {
 1509|  2.05M|            WORD32 ctx_idx_inc;
 1510|  2.05M|            ctx_idx_inc = 0;
 1511|       |
 1512|  2.05M|            if((0 != cu_pos_y) ||
  ------------------
  |  Branch (1512:16): [True: 1.31M, False: 741k]
  ------------------
 1513|   741k|                            ((0 != ps_codec->s_parse.i4_ctb_slice_y) &&
  ------------------
  |  Branch (1513:30): [True: 568k, False: 172k]
  ------------------
 1514|   568k|                                            (0 != ps_codec->s_parse.i4_ctb_tile_y)))
  ------------------
  |  Branch (1514:45): [True: 539k, False: 29.2k]
  ------------------
 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.07M, False: 779k]
  ------------------
 1519|  1.07M|                    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.05M|            if((0 != cu_pos_x) ||
  ------------------
  |  Branch (1528:16): [True: 1.25M, False: 805k]
  ------------------
 1529|   805k|                            (((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (1529:31): [True: 687k, False: 118k]
  |  Branch (1529:74): [True: 86.3k, False: 31.8k]
  ------------------
 1530|   773k|                                            (0 != ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (1530:45): [True: 676k, False: 96.4k]
  ------------------
 1531|  1.93M|            {
 1532|  1.93M|                u4_skip_left >>= (u4_min_cu_y % 32);
 1533|  1.93M|                if(u4_skip_left & 1)
  ------------------
  |  Branch (1533:20): [True: 1.12M, False: 803k]
  ------------------
 1534|  1.12M|                    ctx_idx_inc++;
 1535|  1.93M|            }
 1536|  2.05M|            TRACE_CABAC_CTXT("cu_skip_flag", ps_cabac->u4_range, (IHEVC_CAB_SKIP_FLAG + ctx_idx_inc));
 1537|  2.05M|            skip_flag = ihevcd_cabac_decode_bin(ps_cabac,
 1538|  2.05M|                                                ps_bitstrm,
 1539|  2.05M|                                                (IHEVC_CAB_SKIP_FLAG + ctx_idx_inc));
 1540|       |
 1541|  2.05M|            AEV_TRACE("cu_skip_flag", skip_flag, ps_cabac->u4_range);
 1542|  2.05M|        }
 1543|  3.67M|        else
 1544|  3.67M|            skip_flag = 0;
 1545|       |
 1546|       |        /* Update top skip_flag */
 1547|  5.73M|        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.73M|        u4_mask = LSB_ONES(cb_size / 8);
  ------------------
  |  |   72|  5.73M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1553|  5.73M|        u4_top_mask = u4_mask << (u4_min_cu_x % 32);
 1554|       |
 1555|       |
 1556|  5.73M|        if(skip_flag)
  ------------------
  |  Branch (1556:12): [True: 1.21M, False: 4.51M]
  ------------------
 1557|  1.21M|        {
 1558|  1.21M|            u4_skip_top |= u4_top_mask;
 1559|  1.21M|        }
 1560|  4.51M|        else
 1561|  4.51M|        {
 1562|  4.51M|            u4_skip_top &= ~u4_top_mask;
 1563|  4.51M|        }
 1564|  5.73M|        *pu4_skip_top = u4_skip_top;
 1565|       |
 1566|       |        /* Update left skip_flag */
 1567|  5.73M|        u4_skip_left = ps_codec->s_parse.u4_skip_cu_left;
 1568|  5.73M|        u4_mask = LSB_ONES(cb_size / 8);
  ------------------
  |  |   72|  5.73M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1569|  5.73M|        u4_left_mask = u4_mask << (u4_min_cu_y % 32);
 1570|       |
 1571|  5.73M|        if(skip_flag)
  ------------------
  |  Branch (1571:12): [True: 1.21M, False: 4.51M]
  ------------------
 1572|  1.21M|        {
 1573|  1.21M|            u4_skip_left |= u4_left_mask;
 1574|  1.21M|        }
 1575|  4.51M|        else
 1576|  4.51M|        {
 1577|  4.51M|            u4_skip_left &= ~u4_left_mask;
 1578|  4.51M|        }
 1579|  5.73M|        ps_codec->s_parse.u4_skip_cu_left = u4_skip_left;
 1580|  5.73M|    }
 1581|  5.73M|    ps_codec->s_parse.i4_cu_pcm_flag = 0;
 1582|       |
 1583|  5.73M|    if(skip_flag)
  ------------------
  |  Branch (1583:8): [True: 1.21M, False: 4.51M]
  ------------------
 1584|  1.21M|    {
 1585|  1.21M|        WORD32 ctb_x_base;
 1586|  1.21M|        WORD32 ctb_y_base;
 1587|       |
 1588|  1.21M|        ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1589|  1.21M|        ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1590|       |
 1591|  1.21M|        ps_tu->b1_cb_cbf = 0;
 1592|  1.21M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1593|  1.21M|        ps_tu->b1_cb_cbf_subtu1 = 0;
 1594|  1.21M|#endif
 1595|  1.21M|        ps_tu->b1_cr_cbf = 0;
 1596|  1.21M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1597|  1.21M|        ps_tu->b1_cr_cbf_subtu1 = 0;
 1598|  1.21M|#endif
 1599|  1.21M|        ps_tu->b1_y_cbf = 0;
 1600|  1.21M|        ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1601|  1.21M|        ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1602|  1.21M|        ps_tu->b1_transquant_bypass = 0;
 1603|  1.21M|        ps_tu->b3_size = (log2_cb_size - 2);
 1604|  1.21M|        ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1605|  1.21M|        ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  1.21M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1606|  1.21M|        ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  521|  1.21M|#define INTRA_PRED_NONE  63
  ------------------
 1607|  1.21M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1608|  1.21M|        ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 1609|  1.21M|        ps_tu->b1_cb_log2_res_sign = 0;
 1610|  1.21M|        ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 1611|  1.21M|        ps_tu->b1_cr_log2_res_sign = 0;
 1612|  1.21M|#endif
 1613|       |
 1614|       |        /* Set the first TU in CU flag */
 1615|  1.21M|        {
 1616|  1.21M|            if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1616:16): [True: 1.21M, False: 0]
  ------------------
 1617|  1.21M|                            (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1617:29): [True: 1.21M, False: 0]
  ------------------
 1618|  1.21M|            {
 1619|  1.21M|                ps_tu->b1_first_tu_in_cu = 1;
 1620|  1.21M|            }
 1621|      0|            else
 1622|      0|            {
 1623|      0|                ps_tu->b1_first_tu_in_cu = 0;
 1624|      0|            }
 1625|  1.21M|        }
 1626|       |
 1627|  1.21M|        ps_codec->s_parse.ps_tu++;
 1628|  1.21M|        ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1629|  1.21M|        ps_codec->s_parse.i4_pic_tu_idx++;
 1630|       |
 1631|  1.21M|        ps_codec->s_parse.s_cu.i4_pred_mode = PRED_MODE_SKIP;
 1632|  1.21M|        ps_codec->s_parse.s_cu.i4_part_mode = PART_2Nx2N;
 1633|  1.21M|        {
 1634|  1.21M|            pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1635|  1.21M|            ps_pu->b2_part_idx = 0;
 1636|  1.21M|            ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size);
 1637|  1.21M|            STATS_UPDATE_PU_SKIP_SIZE(ps_pu);
  ------------------
  |  |  146|  1.21M|#define STATS_UPDATE_PU_SKIP_SIZE(ps_pu) ;
  ------------------
 1638|  1.21M|        }
 1639|  1.21M|    }
 1640|  4.51M|    else
 1641|  4.51M|    {
 1642|  4.51M|        WORD32 pred_mode;
 1643|  4.51M|        WORD32 part_mode;
 1644|  4.51M|        WORD32 intra_split_flag;
 1645|  4.51M|        WORD32 is_mincb;
 1646|  4.51M|        cb_size = (1 << log2_cb_size);
 1647|  4.51M|        is_mincb = (cb_size == (1 << ps_sps->i1_log2_min_coding_block_size));
 1648|  4.51M|        pcm_flag = 0;
 1649|  4.51M|        if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1649:12): [True: 845k, False: 3.67M]
  ------------------
 1650|   845k|        {
 1651|   845k|            TRACE_CABAC_CTXT("pred_mode_flag", ps_cabac->u4_range, IHEVC_CAB_PRED_MODE);
 1652|   845k|            pred_mode = ihevcd_cabac_decode_bin(ps_cabac,
 1653|   845k|                                                ps_bitstrm,
 1654|   845k|                                                IHEVC_CAB_PRED_MODE);
 1655|       |
 1656|   845k|            AEV_TRACE("pred_mode_flag", pred_mode, ps_cabac->u4_range);
 1657|   845k|        }
 1658|  3.67M|        else
 1659|  3.67M|        {
 1660|  3.67M|            pred_mode = PRED_MODE_INTRA;
 1661|  3.67M|        }
 1662|       |
 1663|       |        /* If current CU is intra then set corresponging bit in picture level intra map */
 1664|  4.51M|        if(PRED_MODE_INTRA == pred_mode)
  ------------------
  |  Branch (1664:12): [True: 3.77M, False: 743k]
  ------------------
 1665|  3.77M|        {
 1666|  3.77M|            UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 1667|  3.77M|            UWORD32 u4_mask;
 1668|  3.77M|            WORD32 i;
 1669|  3.77M|            WORD32 numbytes_row;
 1670|  3.77M|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1671|  3.77M|            pu1_pic_intra_flag += (y0 / 8) * numbytes_row;
 1672|  3.77M|            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.77M|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|  3.77M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1677|  12.5M|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1677:24): [True: 8.73M, False: 3.77M]
  ------------------
 1678|  8.73M|            {
 1679|  8.73M|                *pu1_pic_intra_flag |= (u4_mask << (((x0) / 8) % 8));
 1680|  8.73M|                pu1_pic_intra_flag += numbytes_row;
 1681|  8.73M|            }
 1682|  3.77M|        }
 1683|       |
 1684|  4.51M|        ps_codec->s_parse.s_cu.i4_pred_mode = pred_mode;
 1685|  4.51M|        intra_split_flag = 0;
 1686|  4.51M|        if((PRED_MODE_INTRA != pred_mode) ||
  ------------------
  |  Branch (1686:12): [True: 743k, False: 3.77M]
  ------------------
 1687|  3.77M|                        is_mincb)
  ------------------
  |  Branch (1687:25): [True: 2.66M, False: 1.11M]
  ------------------
 1688|  3.40M|        {
 1689|  3.40M|            UWORD32 bin;
 1690|  3.40M|            if(PRED_MODE_INTRA == pred_mode)
  ------------------
  |  Branch (1690:16): [True: 2.66M, False: 743k]
  ------------------
 1691|  2.66M|            {
 1692|  2.66M|                TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, IHEVC_CAB_PART_MODE);
 1693|  2.66M|                bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, IHEVC_CAB_PART_MODE);
 1694|  2.66M|                part_mode = (bin) ? PART_2Nx2N : PART_NxN;
  ------------------
  |  Branch (1694:29): [True: 1.88M, False: 778k]
  ------------------
 1695|  2.66M|            }
 1696|   743k|            else
 1697|   743k|            {
 1698|   743k|                WORD32 amp_enabled = ps_sps->i1_amp_enabled_flag;
 1699|       |
 1700|   743k|                UWORD32 u4_max_bin_cnt = 0;
 1701|       |
 1702|       |
 1703|       |
 1704|   743k|                if(amp_enabled && !is_mincb)
  ------------------
  |  Branch (1704:20): [True: 656k, False: 86.1k]
  |  Branch (1704:35): [True: 173k, False: 483k]
  ------------------
 1705|   173k|                {
 1706|   173k|                    part_mode = ihevcd_parse_part_mode_amp(ps_cabac, ps_bitstrm);
 1707|   173k|                }
 1708|   569k|                else
 1709|   569k|                {
 1710|   569k|                    WORD32 ctxt_inc = IHEVC_CAB_PART_MODE;
 1711|       |
 1712|   569k|                    u4_max_bin_cnt = 2;
 1713|   569k|                    if((is_mincb) && (cb_size > 8))
  ------------------
  |  Branch (1713:24): [True: 536k, False: 33.1k]
  |  Branch (1713:38): [True: 17.7k, False: 519k]
  ------------------
 1714|  17.7k|                    {
 1715|  17.7k|                        u4_max_bin_cnt++;
 1716|  17.7k|                    }
 1717|       |
 1718|   569k|                    part_mode = -1;
 1719|   569k|                    TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, IHEVC_CAB_PART_MODE);
 1720|   569k|                    do
 1721|   910k|                    {
 1722|   910k|                        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1723|   910k|                                                      ctxt_inc++);
 1724|   910k|                        part_mode++;
 1725|   910k|                    }while(--u4_max_bin_cnt && !bin);
  ------------------
  |  Branch (1725:28): [True: 576k, False: 334k]
  |  Branch (1725:48): [True: 340k, False: 235k]
  ------------------
 1726|       |
 1727|       |                    /* If the last bin was zero, then increment part mode by 1 */
 1728|   569k|                    if(!bin)
  ------------------
  |  Branch (1728:24): [True: 194k, False: 374k]
  ------------------
 1729|   194k|                        part_mode++;
 1730|   569k|                }
 1731|       |
 1732|       |
 1733|   743k|            }
 1734|       |
 1735|  3.40M|            AEV_TRACE("part_mode", part_mode, ps_cabac->u4_range);
 1736|       |
 1737|  3.40M|        }
 1738|  1.11M|        else
 1739|  1.11M|        {
 1740|  1.11M|            part_mode = 0;
 1741|  1.11M|            intra_split_flag = 0;
 1742|  1.11M|        }
 1743|  4.51M|        ps_codec->s_parse.s_cu.i4_part_mode = part_mode;
 1744|       |
 1745|  4.51M|        if((PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode) &&
  ------------------
  |  Branch (1745:12): [True: 3.77M, False: 743k]
  ------------------
 1746|  3.77M|                        (PART_NxN == ps_codec->s_parse.s_cu.i4_part_mode))
  ------------------
  |  Branch (1746:25): [True: 778k, False: 2.99M]
  ------------------
 1747|   778k|        {
 1748|   778k|            intra_split_flag = 1;
 1749|   778k|        }
 1750|  4.51M|        ps_codec->s_parse.s_cu.i4_part_mode = part_mode;
 1751|  4.51M|        ps_codec->s_parse.s_cu.i4_intra_split_flag = intra_split_flag;
 1752|  4.51M|        if(pred_mode == PRED_MODE_INTRA)
  ------------------
  |  Branch (1752:12): [True: 3.77M, False: 743k]
  ------------------
 1753|  3.77M|        {
 1754|  3.77M|            ps_codec->s_parse.i4_cu_pcm_flag = 0;
 1755|  3.77M|            ihevcd_parse_coding_unit_intra(ps_codec, x0, y0, log2_cb_size);
 1756|  3.77M|            pcm_flag = ps_codec->s_parse.i4_cu_pcm_flag;
 1757|       |
 1758|  3.77M|        }
 1759|   743k|        else
 1760|   743k|        {
 1761|   743k|            if(part_mode == PART_2Nx2N)
  ------------------
  |  Branch (1761:16): [True: 297k, False: 445k]
  ------------------
 1762|   297k|            {
 1763|   297k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1764|   297k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size);
 1765|   297k|                ps_pu->b2_part_idx = 0;
 1766|   297k|            }
 1767|   445k|            else if(part_mode == PART_2NxN)
  ------------------
  |  Branch (1767:21): [True: 159k, False: 285k]
  ------------------
 1768|   159k|            {
 1769|   159k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1770|       |
 1771|   159k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size / 2);
 1772|   159k|                ps_pu->b2_part_idx = 0;
 1773|       |
 1774|   159k|                ps_pu = ps_codec->s_parse.ps_pu;
 1775|   159k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 2), cb_size, cb_size / 2);
 1776|       |
 1777|   159k|                ps_pu->b2_part_idx = 1;
 1778|   159k|            }
 1779|   285k|            else if(part_mode == PART_Nx2N)
  ------------------
  |  Branch (1779:21): [True: 218k, False: 66.9k]
  ------------------
 1780|   218k|            {
 1781|   218k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1782|   218k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 2, cb_size);
 1783|   218k|                ps_pu->b2_part_idx = 0;
 1784|   218k|                ps_pu = ps_codec->s_parse.ps_pu;
 1785|   218k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0, cb_size / 2, cb_size);
 1786|       |
 1787|   218k|                ps_pu->b2_part_idx = 1;
 1788|   218k|            }
 1789|  66.9k|            else if(part_mode == PART_2NxnU)
  ------------------
  |  Branch (1789:21): [True: 12.4k, False: 54.4k]
  ------------------
 1790|  12.4k|            {
 1791|  12.4k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1792|  12.4k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size / 4);
 1793|  12.4k|                ps_pu->b2_part_idx = 0;
 1794|  12.4k|                ps_pu = ps_codec->s_parse.ps_pu;
 1795|  12.4k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 4), cb_size, cb_size * 3 / 4);
 1796|       |
 1797|  12.4k|                ps_pu->b2_part_idx = 1;
 1798|  12.4k|            }
 1799|  54.4k|            else if(part_mode == PART_2NxnD)
  ------------------
  |  Branch (1799:21): [True: 9.96k, False: 44.5k]
  ------------------
 1800|  9.96k|            {
 1801|  9.96k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1802|  9.96k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size * 3 / 4);
 1803|  9.96k|                ps_pu->b2_part_idx = 0;
 1804|  9.96k|                ps_pu = ps_codec->s_parse.ps_pu;
 1805|  9.96k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size * 3 / 4), cb_size, cb_size / 4);
 1806|       |
 1807|  9.96k|                ps_pu->b2_part_idx = 1;
 1808|  9.96k|            }
 1809|  44.5k|            else if(part_mode == PART_nLx2N)
  ------------------
  |  Branch (1809:21): [True: 29.5k, False: 14.9k]
  ------------------
 1810|  29.5k|            {
 1811|  29.5k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1812|  29.5k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 4, cb_size);
 1813|  29.5k|                ps_pu->b2_part_idx = 0;
 1814|  29.5k|                ps_pu = ps_codec->s_parse.ps_pu;
 1815|  29.5k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 4), y0, cb_size * 3 / 4, cb_size);
 1816|       |
 1817|  29.5k|                ps_pu->b2_part_idx = 1;
 1818|  29.5k|            }
 1819|  14.9k|            else if(part_mode == PART_nRx2N)
  ------------------
  |  Branch (1819:21): [True: 12.8k, False: 2.14k]
  ------------------
 1820|  12.8k|            {
 1821|  12.8k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1822|  12.8k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size * 3 / 4, cb_size);
 1823|  12.8k|                ps_pu->b2_part_idx = 0;
 1824|  12.8k|                ps_pu = ps_codec->s_parse.ps_pu;
 1825|  12.8k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size * 3 / 4), y0, cb_size / 4, cb_size);
 1826|  12.8k|                ps_pu->b2_part_idx = 1;
 1827|  12.8k|            }
 1828|  2.14k|            else
 1829|  2.14k|            { /* PART_NxN */
 1830|  2.14k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1831|       |
 1832|  2.14k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 2, cb_size / 2);
 1833|  2.14k|                ps_pu->b2_part_idx = 0;
 1834|  2.14k|                ps_pu = ps_codec->s_parse.ps_pu;
 1835|  2.14k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0, cb_size / 2, cb_size / 2);
 1836|       |
 1837|  2.14k|                ps_pu->b2_part_idx = 1;
 1838|  2.14k|                ps_pu = ps_codec->s_parse.ps_pu;
 1839|  2.14k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 2), cb_size / 2, cb_size / 2);
 1840|       |
 1841|  2.14k|                ps_pu->b2_part_idx = 2;
 1842|  2.14k|                ps_pu = ps_codec->s_parse.ps_pu;
 1843|  2.14k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0 + (cb_size / 2), cb_size / 2, cb_size / 2);
 1844|       |
 1845|  2.14k|                ps_pu->b2_part_idx = 3;
 1846|  2.14k|            }
 1847|   743k|        }
 1848|       |
 1849|  4.51M|        if(!pcm_flag)
  ------------------
  |  Branch (1849:12): [True: 4.51M, False: 2.47k]
  ------------------
 1850|  4.51M|        {
 1851|  4.51M|            WORD32 no_residual_syntax_flag = 0;
 1852|  4.51M|            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|  4.51M|            ps_pu = ps_codec->s_parse.ps_pu - 1;
 1857|  4.51M|            if((PRED_MODE_INTRA != pred_mode) &&
  ------------------
  |  Branch (1857:16): [True: 743k, False: 3.77M]
  ------------------
 1858|   743k|                            (!((part_mode == PART_2Nx2N) && ps_pu->b1_merge_flag)))
  ------------------
  |  Branch (1858:32): [True: 297k, False: 445k]
  |  Branch (1858:61): [True: 117k, False: 179k]
  ------------------
 1859|   625k|            {
 1860|       |
 1861|   625k|                TRACE_CABAC_CTXT("rqt_root_cbf", ps_cabac->u4_range, IHEVC_CAB_NORES_IDX);
 1862|   625k|                no_residual_syntax_flag = ihevcd_cabac_decode_bin(ps_cabac,
 1863|   625k|                                                                  ps_bitstrm,
 1864|   625k|                                                                  IHEVC_CAB_NORES_IDX);
 1865|       |
 1866|   625k|                AEV_TRACE("rqt_root_cbf", no_residual_syntax_flag,
 1867|   625k|                          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|   625k|                no_residual_syntax_flag = 1 - no_residual_syntax_flag;
 1875|   625k|            }
 1876|       |
 1877|  4.51M|            if(!no_residual_syntax_flag)
  ------------------
  |  Branch (1877:16): [True: 4.01M, False: 496k]
  ------------------
 1878|  4.01M|            {
 1879|       |
 1880|  4.01M|                ps_codec->s_parse.s_cu.i4_max_trafo_depth = (pred_mode == PRED_MODE_INTRA) ?
  ------------------
  |  Branch (1880:61): [True: 3.77M, False: 246k]
  ------------------
 1881|  3.77M|                                (ps_sps->i1_max_transform_hierarchy_depth_intra + intra_split_flag) :
 1882|  4.01M|                                (ps_sps->i1_max_transform_hierarchy_depth_inter);
 1883|  4.01M|                ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0,
 1884|  4.01M|                                                  log2_cb_size, 0, 0,
 1885|  4.01M|                                                  ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0],
 1886|  4.01M|                                                  ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0]);
 1887|  4.01M|                RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  4.01M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 1.14k, False: 4.01M]
  |  |  ------------------
  ------------------
 1888|  4.01M|            }
 1889|   496k|            else
 1890|   496k|            {
 1891|   496k|                WORD32 ctb_x_base;
 1892|   496k|                WORD32 ctb_y_base;
 1893|       |
 1894|   496k|                ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1895|   496k|                ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1896|       |
 1897|   496k|                ps_tu = ps_codec->s_parse.ps_tu;
 1898|   496k|                ps_tu->b1_cb_cbf = 0;
 1899|   496k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1900|   496k|                ps_tu->b1_cb_cbf_subtu1 = 0;
 1901|   496k|#endif
 1902|   496k|                ps_tu->b1_cr_cbf = 0;
 1903|   496k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1904|   496k|                ps_tu->b1_cr_cbf_subtu1 = 0;
 1905|   496k|#endif
 1906|   496k|                ps_tu->b1_y_cbf = 0;
 1907|   496k|                ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1908|   496k|                ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1909|   496k|                ps_tu->b1_transquant_bypass = 0;
 1910|   496k|                ps_tu->b3_size = (log2_cb_size - 2);
 1911|   496k|                ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1912|   496k|                ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|   496k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1913|   496k|                ps_tu->b6_luma_intra_mode   = ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
 1914|   496k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1915|   496k|                ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 1916|   496k|                ps_tu->b1_cb_log2_res_sign = 0;
 1917|   496k|                ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 1918|   496k|                ps_tu->b1_cr_log2_res_sign = 0;
 1919|   496k|#endif
 1920|       |
 1921|       |                /* Set the first TU in CU flag */
 1922|   496k|                {
 1923|   496k|                    if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1923:24): [True: 496k, False: 0]
  ------------------
 1924|   496k|                                    (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1924:37): [True: 496k, False: 0]
  ------------------
 1925|   496k|                    {
 1926|   496k|                        ps_tu->b1_first_tu_in_cu = 1;
 1927|   496k|                    }
 1928|      0|                    else
 1929|      0|                    {
 1930|      0|                        ps_tu->b1_first_tu_in_cu = 0;
 1931|      0|                    }
 1932|   496k|                }
 1933|   496k|                ps_codec->s_parse.ps_tu++;
 1934|   496k|                ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1935|   496k|                ps_codec->s_parse.i4_pic_tu_idx++;
 1936|       |
 1937|   496k|            }
 1938|  4.51M|        }
 1939|       |
 1940|  4.51M|    }
 1941|       |
 1942|       |
 1943|       |
 1944|       |
 1945|  5.73M|    return ret;
 1946|  5.73M|}
ihevcd_parse_coding_quadtree:
 1975|  7.46M|{
 1976|  7.46M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1977|  7.46M|    sps_t *ps_sps;
 1978|  7.46M|    pps_t *ps_pps;
 1979|  7.46M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1980|  7.46M|    slice_header_t *ps_slice_hdr;
 1981|  7.46M|#endif
 1982|  7.46M|    WORD32 split_cu_flag;
 1983|  7.46M|    WORD32 x1, y1;
 1984|  7.46M|    WORD32 cu_pos_x;
 1985|  7.46M|    WORD32 cu_pos_y;
 1986|  7.46M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1987|  7.46M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1988|  7.46M|    WORD32 cb_size = 1 << log2_cb_size;
 1989|  7.46M|    ps_sps = ps_codec->s_parse.ps_sps;
 1990|  7.46M|    ps_pps = ps_codec->s_parse.ps_pps;
 1991|  7.46M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1992|  7.46M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1993|  7.46M|#endif
 1994|       |
 1995|       |    /* Compute CU position with respect to current CTB in (8x8) units */
 1996|  7.46M|    cu_pos_x = (x0 - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size)) >> 3;
 1997|  7.46M|    cu_pos_y = (y0 - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size)) >> 3;
 1998|       |
 1999|  7.46M|    ps_codec->s_parse.s_cu.i4_pos_x = cu_pos_x;
 2000|  7.46M|    ps_codec->s_parse.s_cu.i4_pos_y = cu_pos_y;
 2001|       |
 2002|  7.46M|    ps_codec->s_parse.s_cu.i4_log2_cb_size = log2_cb_size;
 2003|       |
 2004|  7.46M|    ps_codec->s_parse.i4_ct_depth = ct_depth;
 2005|  7.46M|    {
 2006|  7.46M|        UWORD32 *pu4_ct_depth_top = ps_codec->s_parse.pu4_ct_depth_top;
 2007|  7.46M|        UWORD32 u4_ct_depth_left = ps_codec->s_parse.u4_ct_depth_left;
 2008|  7.46M|        UWORD32 u4_ct_depth_top = 0;
 2009|  7.46M|        UWORD32 u4_mask;
 2010|  7.46M|        UWORD32 u4_top_mask, u4_left_mask;
 2011|  7.46M|        WORD32  ctxt_idx;
 2012|  7.46M|        UWORD32 u4_min_cu_x = x0 / 8;
 2013|  7.46M|        UWORD32 u4_min_cu_y = y0 / 8;
 2014|       |
 2015|  7.46M|        pu4_ct_depth_top += (u4_min_cu_x / 16);
 2016|       |
 2017|       |
 2018|       |
 2019|       |
 2020|  7.46M|        if(((x0 + (1 << log2_cb_size)) <= ps_sps->i2_pic_width_in_luma_samples) &&
  ------------------
  |  Branch (2020:12): [True: 7.26M, False: 199k]
  ------------------
 2021|  7.26M|                        ((y0 + (1 << log2_cb_size)) <= ps_sps->i2_pic_height_in_luma_samples) &&
  ------------------
  |  Branch (2021:25): [True: 7.14M, False: 127k]
  ------------------
 2022|  7.14M|                        (log2_cb_size > ps_sps->i1_log2_min_coding_block_size))
  ------------------
  |  Branch (2022:25): [True: 3.19M, False: 3.94M]
  ------------------
 2023|  3.19M|        {
 2024|       |
 2025|  3.19M|            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|  3.19M|            if((0 != cu_pos_y) ||
  ------------------
  |  Branch (2030:16): [True: 1.33M, False: 1.86M]
  ------------------
 2031|  1.86M|                            ((0 != ps_codec->s_parse.i4_ctb_slice_y) &&
  ------------------
  |  Branch (2031:30): [True: 1.22M, False: 632k]
  ------------------
 2032|  1.22M|                                            (0 != ps_codec->s_parse.i4_ctb_tile_y)))
  ------------------
  |  Branch (2032:45): [True: 1.20M, False: 29.0k]
  ------------------
 2033|  2.53M|            {
 2034|  2.53M|                u4_ct_depth_top = *pu4_ct_depth_top;
 2035|  2.53M|                u4_ct_depth_top >>= ((u4_min_cu_x % 16) * 2);
 2036|  2.53M|                u4_ct_depth_top &= 3;
 2037|       |
 2038|  2.53M|                if((WORD32)u4_ct_depth_top > ct_depth)
  ------------------
  |  Branch (2038:20): [True: 967k, False: 1.56M]
  ------------------
 2039|   967k|                    ctxt_idx++;
 2040|  2.53M|            }
 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|  3.19M|            if((0 != cu_pos_x) ||
  ------------------
  |  Branch (2049:16): [True: 1.36M, False: 1.82M]
  ------------------
 2050|  1.82M|                            (((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (2050:31): [True: 1.55M, False: 276k]
  |  Branch (2050:74): [True: 128k, False: 147k]
  ------------------
 2051|  1.68M|                                            (0 != ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (2051:45): [True: 1.54M, False: 141k]
  ------------------
 2052|  2.90M|            {
 2053|  2.90M|                u4_ct_depth_left >>= ((u4_min_cu_y % 16) * 2);
 2054|  2.90M|                u4_ct_depth_left &= 3;
 2055|  2.90M|                if((WORD32)u4_ct_depth_left > ct_depth)
  ------------------
  |  Branch (2055:20): [True: 1.13M, False: 1.76M]
  ------------------
 2056|  1.13M|                    ctxt_idx++;
 2057|  2.90M|            }
 2058|  3.19M|            TRACE_CABAC_CTXT("split_cu_flag", ps_cabac->u4_range, ctxt_idx);
 2059|  3.19M|            split_cu_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2060|  3.19M|            AEV_TRACE("split_cu_flag", split_cu_flag, ps_cabac->u4_range);
 2061|  3.19M|        }
 2062|  4.27M|        else
 2063|  4.27M|        {
 2064|  4.27M|            if(log2_cb_size > ps_sps->i1_log2_min_coding_block_size)
  ------------------
  |  Branch (2064:16): [True: 326k, False: 3.94M]
  ------------------
 2065|   326k|                split_cu_flag = 1;
 2066|  3.94M|            else
 2067|  3.94M|                split_cu_flag = 0;
 2068|  4.27M|        }
 2069|       |
 2070|  7.46M|        if(0 == split_cu_flag)
  ------------------
  |  Branch (2070:12): [True: 5.73M, False: 1.73M]
  ------------------
 2071|  5.73M|        {
 2072|       |            /* Update top ct_depth */
 2073|  5.73M|            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.73M|            u4_mask = DUP_LSB_11(cb_size / 8);
  ------------------
  |  |   81|  5.73M|#define DUP_LSB_11(x) ((UWORD32)0xFFFFFFFF >> (32 - ((x) * 2)))
  ------------------
 2079|       |
 2080|  5.73M|            u4_top_mask = u4_mask << ((u4_min_cu_x % 16) * 2);
 2081|  5.73M|            u4_ct_depth_top &= ~u4_top_mask;
 2082|       |
 2083|  5.73M|            if(ct_depth)
  ------------------
  |  Branch (2083:16): [True: 4.99M, False: 737k]
  ------------------
 2084|  4.99M|            {
 2085|  4.99M|                u4_top_mask = gau4_ct_depth_mask[ct_depth] & u4_mask;
 2086|       |
 2087|  4.99M|                u4_top_mask = u4_top_mask << ((u4_min_cu_x % 16) * 2);
 2088|  4.99M|                u4_ct_depth_top |= u4_top_mask;
 2089|  4.99M|            }
 2090|       |
 2091|  5.73M|            *pu4_ct_depth_top = u4_ct_depth_top;
 2092|       |
 2093|       |            /* Update left ct_depth */
 2094|  5.73M|            u4_ct_depth_left = ps_codec->s_parse.u4_ct_depth_left;
 2095|       |
 2096|  5.73M|            u4_left_mask = u4_mask << ((u4_min_cu_y % 16) * 2);
 2097|       |
 2098|  5.73M|            u4_ct_depth_left &= ~u4_left_mask;
 2099|  5.73M|            if(ct_depth)
  ------------------
  |  Branch (2099:16): [True: 4.99M, False: 737k]
  ------------------
 2100|  4.99M|            {
 2101|  4.99M|                u4_left_mask = gau4_ct_depth_mask[ct_depth] & u4_mask;
 2102|       |
 2103|  4.99M|                u4_left_mask = u4_left_mask << ((u4_min_cu_y % 16) * 2);
 2104|  4.99M|                u4_ct_depth_left |= u4_left_mask;
 2105|  4.99M|            }
 2106|       |
 2107|  5.73M|            ps_codec->s_parse.u4_ct_depth_left = u4_ct_depth_left;
 2108|  5.73M|        }
 2109|  7.46M|    }
 2110|  7.46M|    if((ps_pps->i1_cu_qp_delta_enabled_flag) &&
  ------------------
  |  Branch (2110:8): [True: 3.63M, False: 3.83M]
  ------------------
 2111|  3.63M|                    (log2_cb_size >= ps_pps->i1_log2_min_cu_qp_delta_size))
  ------------------
  |  Branch (2111:21): [True: 986k, False: 2.64M]
  ------------------
 2112|   986k|    {
 2113|   986k|        ps_codec->s_parse.i4_is_cu_qp_delta_coded = 0;
 2114|   986k|        ps_codec->s_parse.i4_cu_qp_delta = 0;
 2115|   986k|    }
 2116|  7.46M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2117|  7.46M|    if(ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag
  ------------------
  |  Branch (2117:8): [True: 62.1k, False: 7.40M]
  ------------------
 2118|  62.1k|        && log2_cb_size >= (ps_sps->i1_log2_ctb_size
  ------------------
  |  Branch (2118:12): [True: 19.6k, False: 42.5k]
  ------------------
 2119|  62.1k|                        - ps_pps->i4_diff_cu_chroma_qp_offset_depth))
 2120|  19.6k|    {
 2121|  19.6k|        ps_codec->s_parse.i4_is_cu_chroma_qp_offset_coded = 0;
 2122|  19.6k|        ps_codec->s_parse.i4_cu_chroma_qp_offset_flag = 0;
 2123|  19.6k|        ps_codec->s_parse.i4_cu_chroma_qp_offset_idx = 0;
 2124|  19.6k|    }
 2125|  7.46M|#endif
 2126|  7.46M|    if(split_cu_flag)
  ------------------
  |  Branch (2126:8): [True: 1.73M, False: 5.73M]
  ------------------
 2127|  1.73M|    {
 2128|  1.73M|        x1 = x0 + ((1 << log2_cb_size) >> 1);
 2129|  1.73M|        y1 = y0 + ((1 << log2_cb_size) >> 1);
 2130|       |
 2131|  1.73M|        ret = ihevcd_parse_coding_quadtree(ps_codec, x0, y0, log2_cb_size - 1, ct_depth + 1);
 2132|  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: 911, False: 1.73M]
  |  |  ------------------
  ------------------
 2133|       |
 2134|       |        /* At frame boundaries coding quadtree nodes are sent only if they fall within the frame */
 2135|  1.73M|        if(x1 < ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (2135:12): [True: 1.54M, False: 190k]
  ------------------
 2136|  1.54M|        {
 2137|  1.54M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x1, y0, log2_cb_size - 1, ct_depth + 1);
 2138|  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: 454, False: 1.54M]
  |  |  ------------------
  ------------------
 2139|  1.54M|        }
 2140|       |
 2141|  1.73M|        if(y1 < ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (2141:12): [True: 1.61M, False: 119k]
  ------------------
 2142|  1.61M|        {
 2143|  1.61M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x0, y1, log2_cb_size - 1, ct_depth + 1);
 2144|  1.61M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.61M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 819, False: 1.61M]
  |  |  ------------------
  ------------------
 2145|  1.61M|        }
 2146|       |
 2147|  1.73M|        if((x1 < ps_sps->i2_pic_width_in_luma_samples) &&
  ------------------
  |  Branch (2147:12): [True: 1.54M, False: 190k]
  ------------------
 2148|  1.54M|                        (y1 < ps_sps->i2_pic_height_in_luma_samples))
  ------------------
  |  Branch (2148:25): [True: 1.43M, False: 107k]
  ------------------
 2149|  1.43M|        {
 2150|  1.43M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x1, y1, log2_cb_size - 1, ct_depth + 1);
 2151|  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: 417, False: 1.43M]
  |  |  ------------------
  ------------------
 2152|  1.43M|        }
 2153|  1.73M|    }
 2154|  5.73M|    else
 2155|  5.73M|    {
 2156|  5.73M|        WORD32 qp = ps_codec->s_parse.u4_qp;
 2157|       |        /* Set current group QP if current CU is aligned with the group */
 2158|  5.73M|        {
 2159|  5.73M|            WORD32 cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x << 3;
 2160|  5.73M|            WORD32 cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y << 3;
 2161|       |
 2162|  5.73M|            WORD32 qpg_x = (cu_pos_x - (cu_pos_x & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1)));
 2163|  5.73M|            WORD32 qpg_y = (cu_pos_y - (cu_pos_y & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1)));
 2164|       |
 2165|  5.73M|            if((cu_pos_x == qpg_x) &&
  ------------------
  |  Branch (2165:16): [True: 2.29M, False: 3.43M]
  ------------------
 2166|  2.29M|                            (cu_pos_y == qpg_y))
  ------------------
  |  Branch (2166:29): [True: 1.49M, False: 798k]
  ------------------
 2167|  1.49M|            {
 2168|  1.49M|                ps_codec->s_parse.u4_qpg = ps_codec->s_parse.u4_qp;
 2169|       |
 2170|  1.49M|                ps_codec->s_parse.s_cu.i4_cu_qp_delta = 0;
 2171|       |
 2172|  1.49M|            }
 2173|  5.73M|        }
 2174|       |
 2175|  5.73M|        ret = ihevcd_parse_coding_unit(ps_codec, x0, y0, log2_cb_size);
 2176|  5.73M|        RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  5.73M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 1.14k, False: 5.73M]
  |  |  ------------------
  ------------------
 2177|       |
 2178|  5.73M|        if(ps_pps->i1_cu_qp_delta_enabled_flag)
  ------------------
  |  Branch (2178:12): [True: 2.77M, False: 2.95M]
  ------------------
 2179|  2.77M|        {
 2180|  2.77M|            WORD32 qp_pred, qp_left, qp_top;
 2181|  2.77M|            WORD32 cu_pos_x;
 2182|  2.77M|            WORD32 cu_pos_y;
 2183|  2.77M|            WORD32 qpg_x;
 2184|  2.77M|            WORD32 qpg_y;
 2185|  2.77M|            WORD32 i, j;
 2186|  2.77M|            WORD32 cur_cu_offset;
 2187|  2.77M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 2188|  2.77M|            WORD32 cb_size = 1 << ps_codec->s_parse.s_cu.i4_log2_cb_size;
 2189|  2.77M|            WORD32 i4_qp_bd_offset_y = ps_codec->i4_qp_bd_offset_y;
 2190|       |
 2191|  2.77M|            cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x << 3;
 2192|  2.77M|            cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y << 3;
 2193|       |
 2194|  2.77M|            qpg_x = (cu_pos_x - (cu_pos_x & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1))) >> 3;
 2195|  2.77M|            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.77M|            qp_left = ps_codec->s_parse.u4_qpg;
 2199|  2.77M|            qp_top = ps_codec->s_parse.u4_qpg;
 2200|       |
 2201|  2.77M|            if(qpg_x > 0)
  ------------------
  |  Branch (2201:16): [True: 352k, False: 2.41M]
  ------------------
 2202|   352k|            {
 2203|   352k|                qp_left = ps_codec->s_parse.ai1_8x8_cu_qp[qpg_x - 1 + (qpg_y * 8)];
 2204|   352k|            }
 2205|  2.77M|            if(qpg_y > 0)
  ------------------
  |  Branch (2205:16): [True: 393k, False: 2.37M]
  ------------------
 2206|   393k|            {
 2207|   393k|                qp_top = ps_codec->s_parse.ai1_8x8_cu_qp[qpg_x + ((qpg_y - 1) * 8)];
 2208|   393k|            }
 2209|       |
 2210|  2.77M|            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.77M|            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.77M|                        i4_qp_bd_offset_y;
 2215|       |
 2216|  2.77M|            cur_cu_offset = (cu_pos_x >> 3) + cu_pos_y;
 2217|  7.81M|            for(i = 0; i < (cb_size >> 3); i++)
  ------------------
  |  Branch (2217:24): [True: 5.04M, False: 2.77M]
  ------------------
 2218|  5.04M|            {
 2219|  21.7M|                for(j = 0; j < (cb_size >> 3); j++)
  ------------------
  |  Branch (2219:28): [True: 16.6M, False: 5.04M]
  ------------------
 2220|  16.6M|                {
 2221|  16.6M|                    ps_codec->s_parse.ai1_8x8_cu_qp[cur_cu_offset + (i * 8) + j] = qp;
 2222|  16.6M|                }
 2223|  5.04M|            }
 2224|       |
 2225|  2.77M|            ps_codec->s_parse.u4_qp = qp;
 2226|  2.77M|            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.77M|            {
 2231|  2.77M|                tu_t *ps_tu_tmp;
 2232|  2.77M|                ps_tu_tmp = ps_tu - ps_codec->s_parse.s_cu.i4_tu_cnt;
 2233|  2.77M|                ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 2234|  8.83M|                while(ps_tu_tmp != ps_tu)
  ------------------
  |  Branch (2234:23): [True: 6.06M, False: 2.77M]
  ------------------
 2235|  6.06M|                {
 2236|  6.06M|                    ps_tu_tmp->b7_qp = ps_codec->s_parse.u4_qp;
 2237|       |
 2238|  6.06M|                    ps_tu_tmp++;
 2239|  6.06M|                }
 2240|  2.77M|            }
 2241|  2.77M|            if(ps_codec->s_parse.s_cu.i4_cu_qp_delta)
  ------------------
  |  Branch (2241:16): [True: 947k, False: 1.82M]
  ------------------
 2242|   947k|            {
 2243|   947k|                WORD32 ctb_indx;
 2244|   947k|                ctb_indx = ps_codec->s_parse.i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_codec->s_parse.i4_ctb_y;
 2245|   947k|                ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb[ctb_indx >> 3] &= (~(1 << (ctb_indx & 7)));
 2246|   947k|            }
 2247|       |
 2248|  2.77M|        }
 2249|       |        /* Populate CU_info maps for current CU*/
 2250|  5.73M|        if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2250:12): [True: 0, False: 5.73M]
  ------------------
 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.73M|    }
 2277|       |
 2278|       |
 2279|       |
 2280|       |
 2281|  7.46M|    return ret;
 2282|  7.46M|}
ihevcd_parse_sao:
 2305|   547k|{
 2306|   547k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2307|   547k|    sps_t *ps_sps;
 2308|   547k|    sao_t *ps_sao;
 2309|   547k|    WORD32 rx;
 2310|   547k|    WORD32 ry;
 2311|   547k|    WORD32 value;
 2312|   547k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 2313|   547k|    WORD32 sao_merge_left_flag;
 2314|   547k|    WORD32 sao_merge_up_flag;
 2315|   547k|    slice_header_t *ps_slice_hdr;
 2316|   547k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 2317|   547k|    WORD32 ctxt_idx;
 2318|   547k|    WORD32 bit_depth = ps_codec->i4_bit_depth_luma;
 2319|       |
 2320|   547k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base;
 2321|   547k|    ps_slice_hdr += (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|   547k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   547k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2322|       |
 2323|   547k|    ps_sps = (ps_codec->s_parse.ps_sps);
 2324|   547k|    rx = ps_codec->s_parse.i4_ctb_x;
 2325|   547k|    ry = ps_codec->s_parse.i4_ctb_y;
 2326|       |
 2327|   547k|    ps_sao = ps_codec->s_parse.ps_pic_sao + rx + ry * ps_sps->i2_pic_wd_in_ctb;
 2328|       |
 2329|       |    /* Default values */
 2330|   547k|    ps_sao->b3_y_type_idx = 0;
 2331|   547k|    ps_sao->b3_cb_type_idx = 0;
 2332|   547k|    ps_sao->b3_cr_type_idx = 0;
 2333|       |
 2334|   547k|    UNUSED(value);
  ------------------
  |  |   38|   547k|#define UNUSED(x) ((void)(x))
  ------------------
 2335|   547k|    ctxt_idx = IHEVC_CAB_SAO_MERGE;
 2336|   547k|    sao_merge_left_flag = 0;
 2337|   547k|    sao_merge_up_flag = 0;
 2338|   547k|    if(rx > 0)
  ------------------
  |  Branch (2338:8): [True: 456k, False: 91.1k]
  ------------------
 2339|   456k|    {
 2340|       |        /*TODO:Implemented only for slice. condition for tile is not tested*/
 2341|   456k|        if(((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (2341:13): [True: 454k, False: 1.78k]
  |  Branch (2341:56): [True: 557, False: 1.22k]
  ------------------
 2342|   455k|                        (0 != ps_codec->s_parse.i4_ctb_tile_x))
  ------------------
  |  Branch (2342:25): [True: 450k, False: 4.78k]
  ------------------
 2343|   450k|        {
 2344|       |
 2345|   450k|            TRACE_CABAC_CTXT("sao_merge_flag", ps_cabac->u4_range, ctxt_idx);
 2346|   450k|            sao_merge_left_flag = ihevcd_cabac_decode_bin(ps_cabac,
 2347|   450k|                                                          ps_bitstrm,
 2348|   450k|                                                          ctxt_idx);
 2349|   450k|            AEV_TRACE("sao_merge_flag", sao_merge_left_flag, ps_cabac->u4_range);
 2350|   450k|        }
 2351|       |
 2352|   456k|    }
 2353|   547k|    if(ry > 0 && !sao_merge_left_flag)
  ------------------
  |  Branch (2353:8): [True: 386k, False: 161k]
  |  Branch (2353:18): [True: 252k, False: 133k]
  ------------------
 2354|   252k|    {
 2355|   252k|        if((ps_codec->s_parse.i4_ctb_slice_y > 0) && (ps_codec->s_parse.i4_ctb_tile_y > 0))
  ------------------
  |  Branch (2355:12): [True: 247k, False: 4.83k]
  |  Branch (2355:54): [True: 233k, False: 13.5k]
  ------------------
 2356|   233k|        {
 2357|   233k|            TRACE_CABAC_CTXT("sao_merge_flag", ps_cabac->u4_range, ctxt_idx);
 2358|   233k|            sao_merge_up_flag = ihevcd_cabac_decode_bin(ps_cabac,
 2359|   233k|                                                        ps_bitstrm,
 2360|   233k|                                                        ctxt_idx);
 2361|   233k|            AEV_TRACE("sao_merge_flag", sao_merge_up_flag, ps_cabac->u4_range);
 2362|   233k|        }
 2363|   252k|    }
 2364|   547k|    ctxt_idx = IHEVC_CAB_SAO_TYPE;
 2365|       |
 2366|   547k|    if(sao_merge_left_flag)
  ------------------
  |  Branch (2366:8): [True: 182k, False: 365k]
  ------------------
 2367|   182k|    {
 2368|   182k|        *ps_sao = *(ps_sao - 1);
 2369|   182k|    }
 2370|   365k|    else if(sao_merge_up_flag)
  ------------------
  |  Branch (2370:13): [True: 56.3k, False: 309k]
  ------------------
 2371|  56.3k|    {
 2372|  56.3k|        *ps_sao = *(ps_sao - ps_sps->i2_pic_wd_in_ctb);
 2373|  56.3k|    }
 2374|   309k|    else // if(!sao_merge_up_flag && !sao_merge_left_flag)
 2375|   309k|    {
 2376|   309k|        WORD32 c_idx;
 2377|   309k|        WORD32 sao_type_idx = 0;
 2378|  1.23M|        for(c_idx = 0; c_idx < (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc ? 3 : 1); c_idx++)
  ------------------
  |  Branch (2378:24): [True: 926k, False: 309k]
  |  Branch (2378:33): [True: 1.23M, False: 1.42k]
  ------------------
 2379|   926k|        {
 2380|   926k|            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: 846k, False: 79.8k]
  |  Branch (2380:57): [True: 282k, False: 564k]
  |  Branch (2380:73): [True: 590k, False: 53.0k]
  |  Branch (2380:115): [True: 564k, False: 26.6k]
  ------------------
 2381|   847k|            {
 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|   847k|                if(c_idx == 0)
  ------------------
  |  Branch (2386:20): [True: 282k, False: 564k]
  ------------------
 2387|   282k|                {
 2388|   282k|                    sao_type_idx = 0;
 2389|   282k|                    TRACE_CABAC_CTXT("sao_type_idx", ps_cabac->u4_range, ctxt_idx);
 2390|   282k|                    sao_type_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2391|       |
 2392|   282k|                    if(sao_type_idx)
  ------------------
  |  Branch (2392:24): [True: 195k, False: 87.0k]
  ------------------
 2393|   195k|                    {
 2394|   195k|                        sao_type_idx += ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2395|   195k|                    }
 2396|   282k|                    AEV_TRACE("sao_type_idx", sao_type_idx,  ps_cabac->u4_range);
 2397|       |
 2398|   282k|                    ps_sao->b3_y_type_idx = sao_type_idx;
 2399|   282k|                }
 2400|   847k|                if(c_idx == 1)
  ------------------
  |  Branch (2400:20): [True: 282k, False: 564k]
  ------------------
 2401|   282k|                {
 2402|   282k|                    sao_type_idx = 0;
 2403|   282k|                    TRACE_CABAC_CTXT("sao_type_idx", ps_cabac->u4_range, ctxt_idx);
 2404|   282k|                    sao_type_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2405|   282k|                    if(sao_type_idx)
  ------------------
  |  Branch (2405:24): [True: 195k, False: 86.2k]
  ------------------
 2406|   195k|                    {
 2407|   195k|                        sao_type_idx += ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2408|   195k|                    }
 2409|       |
 2410|   282k|                    AEV_TRACE("sao_type_idx", sao_type_idx,  ps_cabac->u4_range);
 2411|       |
 2412|   282k|                    ps_sao->b3_cb_type_idx = sao_type_idx;
 2413|   282k|                    ps_sao->b3_cr_type_idx = sao_type_idx;
 2414|   282k|                }
 2415|       |
 2416|   847k|                if(sao_type_idx != 0)
  ------------------
  |  Branch (2416:20): [True: 587k, False: 259k]
  ------------------
 2417|   587k|                {
 2418|   587k|                    WORD32 i;
 2419|   587k|                    WORD32 sao_offset[4];
 2420|   587k|                    WORD32 sao_band_position = 0;
 2421|   587k|                    WORD32 c_max =  (1 << (MIN(bit_depth, 10) - 5)) - 1;
  ------------------
  |  |   43|   587k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 219k, False: 367k]
  |  |  ------------------
  ------------------
 2422|  2.93M|                    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2422:32): [True: 2.35M, False: 587k]
  ------------------
 2423|  2.35M|                    {
 2424|  2.35M|                        sao_offset[i] = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac, ps_bitstrm, c_max);
 2425|  2.35M|                        AEV_TRACE("sao_offset_abs", sao_offset[i], ps_cabac->u4_range);
 2426|       |
 2427|  2.35M|                        if((2 == sao_type_idx) && (i > 1))
  ------------------
  |  Branch (2427:28): [True: 1.02M, False: 1.32M]
  |  Branch (2427:51): [True: 512k, False: 512k]
  ------------------
 2428|   512k|                        {
 2429|   512k|                            sao_offset[i] = -sao_offset[i];
 2430|   512k|                        }
 2431|  2.35M|                    }
 2432|       |
 2433|   587k|                    if(sao_type_idx == 1)
  ------------------
  |  Branch (2433:24): [True: 331k, False: 256k]
  ------------------
 2434|   331k|                    {
 2435|  1.65M|                        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2435:36): [True: 1.32M, False: 331k]
  ------------------
 2436|  1.32M|                        {
 2437|  1.32M|                            if(sao_offset[i] != 0)
  ------------------
  |  Branch (2437:32): [True: 471k, False: 852k]
  ------------------
 2438|   471k|                            {
 2439|   471k|                                value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2440|   471k|                                AEV_TRACE("sao_offset_sign", value, ps_cabac->u4_range);
 2441|       |
 2442|   471k|                                if(value)
  ------------------
  |  Branch (2442:36): [True: 234k, False: 236k]
  ------------------
 2443|   234k|                                {
 2444|   234k|                                    sao_offset[i] = -sao_offset[i];
 2445|   234k|                                }
 2446|   471k|                            }
 2447|  1.32M|                        }
 2448|   331k|                        value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 5);
 2449|   331k|                        AEV_TRACE("sao_band_position", value, ps_cabac->u4_range);
 2450|       |
 2451|   331k|                        sao_band_position = value;
 2452|   331k|                    }
 2453|   256k|                    else
 2454|   256k|                    {
 2455|   256k|                        if(c_idx == 0)
  ------------------
  |  Branch (2455:28): [True: 80.9k, False: 175k]
  ------------------
 2456|  80.9k|                        {
 2457|  80.9k|                            value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 2);
 2458|  80.9k|                            AEV_TRACE("sao_eo_class", value, ps_cabac->u4_range);
 2459|       |
 2460|  80.9k|                            ps_sao->b3_y_type_idx += value;
 2461|  80.9k|                        }
 2462|       |
 2463|   256k|                        if(c_idx == 1)
  ------------------
  |  Branch (2463:28): [True: 87.6k, False: 168k]
  ------------------
 2464|  87.6k|                        {
 2465|  87.6k|                            value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 2);
 2466|  87.6k|                            AEV_TRACE("sao_eo_class", value, ps_cabac->u4_range);
 2467|       |
 2468|  87.6k|                            ps_sao->b3_cb_type_idx += value;
 2469|  87.6k|                            ps_sao->b3_cr_type_idx += value;
 2470|  87.6k|                        }
 2471|   256k|                    }
 2472|       |
 2473|   587k|                    if(0 == c_idx)
  ------------------
  |  Branch (2473:24): [True: 195k, False: 391k]
  ------------------
 2474|   195k|                    {
 2475|   195k|                        ps_sao->b8_y_offset_1 = sao_offset[0];
 2476|   195k|                        ps_sao->b8_y_offset_2 = sao_offset[1];
 2477|   195k|                        ps_sao->b8_y_offset_3 = sao_offset[2];
 2478|   195k|                        ps_sao->b8_y_offset_4 = sao_offset[3];
 2479|       |
 2480|   195k|                        ps_sao->b5_y_band_pos = sao_band_position;
 2481|   195k|                    }
 2482|   391k|                    else if(1 == c_idx)
  ------------------
  |  Branch (2482:29): [True: 195k, False: 195k]
  ------------------
 2483|   195k|                    {
 2484|   195k|                        ps_sao->b8_cb_offset_1 = sao_offset[0];
 2485|   195k|                        ps_sao->b8_cb_offset_2 = sao_offset[1];
 2486|   195k|                        ps_sao->b8_cb_offset_3 = sao_offset[2];
 2487|   195k|                        ps_sao->b8_cb_offset_4 = sao_offset[3];
 2488|       |
 2489|   195k|                        ps_sao->b5_cb_band_pos = sao_band_position;
 2490|   195k|                    }
 2491|   195k|                    else // 2 == c_idx
 2492|   195k|                    {
 2493|   195k|                        ps_sao->b8_cr_offset_1 = sao_offset[0];
 2494|   195k|                        ps_sao->b8_cr_offset_2 = sao_offset[1];
 2495|   195k|                        ps_sao->b8_cr_offset_3 = sao_offset[2];
 2496|   195k|                        ps_sao->b8_cr_offset_4 = sao_offset[3];
 2497|       |
 2498|   195k|                        ps_sao->b5_cr_band_pos = sao_band_position;
 2499|   195k|                    }
 2500|   587k|                }
 2501|   847k|            }
 2502|       |
 2503|   926k|            bit_depth = ps_codec->i4_bit_depth_chroma;
 2504|   926k|        }
 2505|   309k|    }
 2506|       |
 2507|   547k|    return ret;
 2508|   547k|}
ihevcd_set_ctb_skip:
 2529|  22.5M|{
 2530|  22.5M|    tu_t *ps_tu;
 2531|  22.5M|    pu_t *ps_pu;
 2532|  22.5M|    sps_t *ps_sps = ps_codec->s_parse.ps_sps;
 2533|  22.5M|    WORD32 ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 2534|  22.5M|    WORD32 ctb_skip_wd, ctb_skip_ht;
 2535|  22.5M|    WORD32 rows_remaining, cols_remaining;
 2536|  22.5M|    WORD32 tu_abs_x, tu_abs_y;
 2537|  22.5M|    WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 2538|  22.5M|    UWORD8 *pu1_pic_intra_flag;
 2539|  22.5M|    UWORD32 u4_mask;
 2540|  22.5M|    WORD32 pu_x,pu_y;
 2541|       |
 2542|       |    /* Set pu wd and ht based on whether the ctb is complete or not */
 2543|  22.5M|    rows_remaining = ps_sps->i2_pic_height_in_luma_samples
 2544|  22.5M|                    - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size);
 2545|  22.5M|    ctb_skip_ht = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  22.5M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 21.6M, False: 904k]
  |  |  ------------------
  ------------------
 2546|       |
 2547|  22.5M|    cols_remaining = ps_sps->i2_pic_width_in_luma_samples
 2548|  22.5M|                    - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size);
 2549|  22.5M|    ctb_skip_wd = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  22.5M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 21.6M, False: 858k]
  |  |  ------------------
  ------------------
 2550|       |
 2551|  22.5M|    ps_codec->s_parse.s_cu.i4_pred_mode = PRED_MODE_SKIP;
 2552|  22.5M|    ps_codec->s_parse.s_cu.i4_part_mode = PART_2Nx2N;
 2553|       |
 2554|  97.4M|    for (pu_y = 0; pu_y < ctb_skip_ht ; pu_y += MIN_CU_SIZE)
  ------------------
  |  |  373|  74.9M|#define MIN_CU_SIZE         8
  ------------------
  |  Branch (2554:20): [True: 74.9M, False: 22.5M]
  ------------------
 2555|  74.9M|    {
 2556|   419M|        for (pu_x = 0; pu_x < ctb_skip_wd ; pu_x += MIN_CU_SIZE)
  ------------------
  |  |  373|   344M|#define MIN_CU_SIZE         8
  ------------------
  |  Branch (2556:24): [True: 344M, False: 74.9M]
  ------------------
 2557|   344M|        {
 2558|   344M|            ps_tu = ps_codec->s_parse.ps_tu;
 2559|   344M|            ps_tu->b1_cb_cbf = 0;
 2560|   344M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2561|   344M|            ps_tu->b1_cb_cbf_subtu1 = 0;
 2562|   344M|#endif
 2563|   344M|            ps_tu->b1_cr_cbf = 0;
 2564|   344M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2565|   344M|            ps_tu->b1_cr_cbf_subtu1 = 0;
 2566|   344M|#endif
 2567|   344M|            ps_tu->b1_y_cbf = 0;
 2568|   344M|            ps_tu->b4_pos_x = pu_x >> 2;
 2569|   344M|            ps_tu->b4_pos_y = pu_y >> 2;
 2570|   344M|            ps_tu->b1_transquant_bypass = 0;
 2571|   344M|            ps_tu->b3_size = 1;
 2572|   344M|            ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 2573|   344M|            ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|   344M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 2574|   344M|            ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  521|   344M|#define INTRA_PRED_NONE  63
  ------------------
 2575|   344M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2576|   344M|            ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 2577|   344M|            ps_tu->b1_cb_log2_res_sign = 0;
 2578|   344M|            ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 2579|   344M|            ps_tu->b1_cr_log2_res_sign = 0;
 2580|   344M|#endif
 2581|   344M|            ps_tu->b1_first_tu_in_cu = 1;
 2582|       |
 2583|   344M|            ps_codec->s_parse.ps_tu++;
 2584|   344M|            ps_codec->s_parse.s_cu.i4_tu_cnt++;
 2585|   344M|            ps_codec->s_parse.i4_pic_tu_idx++;
 2586|       |
 2587|   344M|            tu_abs_x = (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size) + pu_x;
 2588|   344M|            tu_abs_y = (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size) + pu_y;
 2589|   344M|            pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 2590|   344M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
 2591|   344M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
 2592|   344M|            u4_mask = (LSB_ONES((MIN_CU_SIZE >> 3)) << (((tu_abs_x) / 8) % 8));
  ------------------
  |  |   72|   344M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 2593|   344M|            u4_mask = ~u4_mask;
 2594|   344M|            *pu1_pic_intra_flag &= u4_mask;
 2595|       |
 2596|   344M|            ps_pu = ps_codec->s_parse.ps_pu;
 2597|   344M|            ps_pu->b2_part_idx = 0;
 2598|   344M|            ps_pu->b4_pos_x = pu_x >> 2;
 2599|   344M|            ps_pu->b4_pos_y = pu_y >> 2;
 2600|   344M|            ps_pu->b4_wd = 1;
 2601|   344M|            ps_pu->b4_ht = 1;
 2602|   344M|            ps_pu->b1_intra_flag = 0;
 2603|   344M|            ps_pu->b3_part_mode = ps_codec->s_parse.s_cu.i4_part_mode;
 2604|   344M|            ps_pu->b1_merge_flag = 1;
 2605|   344M|            ps_pu->b3_merge_idx = 0;
 2606|       |
 2607|   344M|            ps_codec->s_parse.ps_pu++;
 2608|   344M|            ps_codec->s_parse.i4_pic_pu_idx++;
 2609|   344M|        }
 2610|  74.9M|    }
 2611|  22.5M|}
ihevcd_parse_slice_data:
 2633|   146k|{
 2634|       |
 2635|   146k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2636|   146k|    WORD32 end_of_slice_flag = 0;
 2637|   146k|    sps_t *ps_sps;
 2638|   146k|    pps_t *ps_pps;
 2639|   146k|    slice_header_t *ps_slice_hdr;
 2640|   146k|    WORD32 end_of_pic;
 2641|   146k|    tile_t *ps_tile, *ps_tile_prev;
 2642|   146k|    WORD32 i;
 2643|   146k|    WORD32 ctb_addr;
 2644|   146k|    WORD32 tile_idx;
 2645|   146k|    WORD32 cabac_init_idc;
 2646|   146k|    WORD32 cabac_init_qp;
 2647|   146k|    WORD32 ctb_size;
 2648|   146k|    WORD32 num_ctb_in_row;
 2649|   146k|    WORD32 num_min4x4_in_ctb;
 2650|   146k|    WORD32 slice_qp;
 2651|   146k|    WORD32 slice_start_ctb_idx;
 2652|   146k|    WORD32 tile_start_ctb_idx;
 2653|       |
 2654|       |
 2655|   146k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base;
 2656|   146k|    ps_pps = ps_codec->s_parse.ps_pps_base;
 2657|   146k|    ps_sps = ps_codec->s_parse.ps_sps_base;
 2658|       |
 2659|       |    /* Get current slice header, pps and sps */
 2660|   146k|    ps_slice_hdr += (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|   146k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   146k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2661|   146k|    ps_pps  += ps_slice_hdr->i1_pps_id;
 2662|   146k|    ps_sps  += ps_pps->i1_sps_id;
 2663|       |
 2664|   146k|    if(0 != ps_codec->s_parse.i4_cur_slice_idx)
  ------------------
  |  Branch (2664:8): [True: 18.0k, False: 128k]
  ------------------
 2665|  18.0k|    {
 2666|  18.0k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2666:12): [True: 6.33k, False: 11.6k]
  ------------------
 2667|  6.33k|        {
 2668|  6.33k|            ps_codec->s_parse.i4_cur_independent_slice_idx =
 2669|  6.33k|                    ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1);
  ------------------
  |  |  153|  6.33k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  6.33k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2670|  6.33k|        }
 2671|  18.0k|    }
 2672|       |
 2673|       |
 2674|   146k|    ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 2675|   146k|    num_min4x4_in_ctb = (ctb_size / 4) * (ctb_size / 4);
 2676|   146k|    num_ctb_in_row = ps_sps->i2_pic_wd_in_ctb;
 2677|       |
 2678|       |    /* Update the parse context */
 2679|   146k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2679:8): [True: 79.4k, False: 67.0k]
  ------------------
 2680|  79.4k|    {
 2681|  79.4k|        ps_codec->s_parse.i4_ctb_x = ps_slice_hdr->i2_ctb_x;
 2682|  79.4k|        ps_codec->s_parse.i4_ctb_y = ps_slice_hdr->i2_ctb_y;
 2683|  79.4k|    }
 2684|   146k|    ps_codec->s_parse.ps_pps = ps_pps;
 2685|   146k|    ps_codec->s_parse.ps_sps = ps_sps;
 2686|   146k|    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|   146k|    ihevcd_get_tile_pos(ps_pps, ps_sps, ps_codec->s_parse.i4_ctb_x,
 2691|   146k|                        ps_codec->s_parse.i4_ctb_y,
 2692|   146k|                        &ps_codec->s_parse.i4_ctb_tile_x,
 2693|   146k|                        &ps_codec->s_parse.i4_ctb_tile_y,
 2694|   146k|                        &tile_idx);
 2695|   146k|    ps_codec->s_parse.ps_tile = ps_pps->ps_tile + tile_idx;
 2696|   146k|    ps_codec->s_parse.i4_cur_tile_idx = tile_idx;
 2697|   146k|    ps_tile = ps_codec->s_parse.ps_tile;
 2698|   146k|    if(tile_idx)
  ------------------
  |  Branch (2698:8): [True: 7.15k, False: 139k]
  ------------------
 2699|  7.15k|        ps_tile_prev = ps_tile - 1;
 2700|   139k|    else
 2701|   139k|        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|   146k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2705:8): [True: 79.4k, False: 67.0k]
  ------------------
 2706|  79.4k|    {
 2707|  79.4k|        if(1 == ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2707:12): [True: 7.60k, False: 71.8k]
  ------------------
 2708|  7.60k|        {
 2709|       |            /*If slice is present at the start of a new tile*/
 2710|  7.60k|            if((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (2710:16): [True: 2.93k, False: 4.66k]
  |  Branch (2710:58): [True: 1.35k, False: 1.58k]
  ------------------
 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|  7.60k|        }
 2716|       |
 2717|  79.4k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2717:12): [True: 71.8k, False: 7.60k]
  ------------------
 2718|  71.8k|        {
 2719|  71.8k|            ps_codec->s_parse.i4_ctb_slice_x = 0;
 2720|  71.8k|            ps_codec->s_parse.i4_ctb_slice_y = 0;
 2721|  71.8k|        }
 2722|  79.4k|    }
 2723|       |
 2724|       |    /* Frame level initializations */
 2725|   146k|    if((0 == ps_codec->s_parse.i4_ctb_y) &&
  ------------------
  |  Branch (2725:8): [True: 103k, False: 42.9k]
  ------------------
 2726|   103k|                    (0 == ps_codec->s_parse.i4_ctb_x))
  ------------------
  |  Branch (2726:21): [True: 73.9k, False: 29.6k]
  ------------------
 2727|  73.9k|    {
 2728|  73.9k|        ret = ihevcd_parse_pic_init(ps_codec);
 2729|  73.9k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  73.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 1.00k, False: 72.9k]
  |  |  ------------------
  ------------------
 2730|       |
 2731|  72.9k|        ps_codec->s_parse.pu4_pic_tu_idx[0] = 0;
 2732|  72.9k|        ps_codec->s_parse.pu4_pic_pu_idx[0] = 0;
 2733|  72.9k|        ps_codec->s_parse.i4_cur_independent_slice_idx = 0;
 2734|  72.9k|        ps_codec->s_parse.i4_ctb_tile_x = 0;
 2735|  72.9k|        ps_codec->s_parse.i4_ctb_tile_y = 0;
 2736|  72.9k|    }
 2737|       |
 2738|   145k|    {
 2739|       |        /* Updating the poc list of current slice to ps_mv_buf */
 2740|   145k|        mv_buf_t *ps_mv_buf = ps_codec->s_parse.ps_cur_mv_buf;
 2741|       |
 2742|   145k|        if(ps_slice_hdr->i1_num_ref_idx_l1_active != 0)
  ------------------
  |  Branch (2742:12): [True: 31.3k, False: 114k]
  ------------------
 2743|  31.3k|        {
 2744|   100k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (2744:24): [True: 69.5k, False: 31.3k]
  ------------------
 2745|  69.5k|            {
 2746|  69.5k|                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|  69.5k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  69.5k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2747|  69.5k|                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|  69.5k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  69.5k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2748|  69.5k|            }
 2749|  31.3k|        }
 2750|       |
 2751|   145k|        if(ps_slice_hdr->i1_num_ref_idx_l0_active != 0)
  ------------------
  |  Branch (2751:12): [True: 32.8k, False: 112k]
  ------------------
 2752|  32.8k|        {
 2753|   101k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (2753:24): [True: 68.8k, False: 32.8k]
  ------------------
 2754|  68.8k|            {
 2755|  68.8k|                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|  68.8k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  68.8k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2756|  68.8k|                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|  68.8k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  68.8k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2757|  68.8k|            }
 2758|  32.8k|        }
 2759|   145k|    }
 2760|       |
 2761|       |    /*Initialize the low delay flag at the beginning of every slice*/
 2762|   145k|    if((0 == ps_codec->s_parse.i4_ctb_slice_x) || (0 == ps_codec->s_parse.i4_ctb_slice_y))
  ------------------
  |  Branch (2762:8): [True: 98.7k, False: 46.7k]
  |  Branch (2762:51): [True: 30.3k, False: 16.3k]
  ------------------
 2763|   129k|    {
 2764|       |        /* Lowdelay flag */
 2765|   129k|        WORD32 cur_poc, ref_list_poc, flag = 1;
 2766|   129k|        cur_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
 2767|   174k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (2767:20): [True: 50.8k, False: 123k]
  ------------------
 2768|  50.8k|        {
 2769|  50.8k|            ref_list_poc = ((mv_buf_t *)ps_slice_hdr->as_ref_pic_list0[i].pv_mv_buf)->i4_abs_poc;
 2770|  50.8k|            if(ref_list_poc > cur_poc)
  ------------------
  |  Branch (2770:16): [True: 5.14k, False: 45.7k]
  ------------------
 2771|  5.14k|            {
 2772|  5.14k|                flag = 0;
 2773|  5.14k|                break;
 2774|  5.14k|            }
 2775|  50.8k|        }
 2776|   129k|        if(flag && (ps_slice_hdr->i1_slice_type == BSLICE))
  ------------------
  |  Branch (2776:12): [True: 123k, False: 5.14k]
  |  Branch (2776:20): [True: 20.3k, False: 103k]
  ------------------
 2777|  20.3k|        {
 2778|  58.2k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (2778:24): [True: 39.9k, False: 18.2k]
  ------------------
 2779|  39.9k|            {
 2780|  39.9k|                ref_list_poc = ((mv_buf_t *)ps_slice_hdr->as_ref_pic_list1[i].pv_mv_buf)->i4_abs_poc;
 2781|  39.9k|                if(ref_list_poc > cur_poc)
  ------------------
  |  Branch (2781:20): [True: 2.13k, False: 37.8k]
  ------------------
 2782|  2.13k|                {
 2783|  2.13k|                    flag = 0;
 2784|  2.13k|                    break;
 2785|  2.13k|                }
 2786|  39.9k|            }
 2787|  20.3k|        }
 2788|   129k|        ps_slice_hdr->i1_low_delay_flag = flag;
 2789|   129k|    }
 2790|       |
 2791|       |    /* initialize the cabac init idc based on slice type */
 2792|   145k|    if(ps_slice_hdr->i1_slice_type == ISLICE)
  ------------------
  |  Branch (2792:8): [True: 112k, False: 32.8k]
  ------------------
 2793|   112k|    {
 2794|   112k|        cabac_init_idc = 0;
 2795|   112k|    }
 2796|  32.8k|    else if(ps_slice_hdr->i1_slice_type == PSLICE)
  ------------------
  |  Branch (2796:13): [True: 1.51k, False: 31.3k]
  ------------------
 2797|  1.51k|    {
 2798|  1.51k|        cabac_init_idc = ps_slice_hdr->i1_cabac_init_flag ? 2 : 1;
  ------------------
  |  Branch (2798:26): [True: 656, False: 863]
  ------------------
 2799|  1.51k|    }
 2800|  31.3k|    else
 2801|  31.3k|    {
 2802|  31.3k|        cabac_init_idc = ps_slice_hdr->i1_cabac_init_flag ? 1 : 2;
  ------------------
  |  Branch (2802:26): [True: 10.4k, False: 20.9k]
  ------------------
 2803|  31.3k|    }
 2804|       |
 2805|   145k|    slice_qp = ps_slice_hdr->i1_slice_qp_delta + ps_pps->i1_pic_init_qp;
 2806|   145k|    slice_qp = CLIP3(slice_qp, -(ps_codec->i4_qp_bd_offset_y), 51);
  ------------------
  |  |   40|   145k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 145k]
  |  |  |  Branch (40:53): [True: 0, False: 145k]
  |  |  ------------------
  ------------------
 2807|       |
 2808|       |    /*Update QP value for every indepndent slice or for every dependent slice that begins at the start of a new tile*/
 2809|   145k|    if((0 == ps_slice_hdr->i1_dependent_slice_flag) ||
  ------------------
  |  Branch (2809:8): [True: 133k, False: 11.6k]
  ------------------
 2810|  11.6k|                    ((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: 11.6k, False: 0]
  |  Branch (2810:71): [True: 4.66k, False: 7.02k]
  |  Branch (2810:113): [True: 1.94k, False: 2.72k]
  ------------------
 2811|   135k|    {
 2812|   135k|        ps_codec->s_parse.u4_qp = slice_qp;
 2813|   135k|    }
 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|   145k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2817:8): [True: 78.6k, False: 66.8k]
  ------------------
 2818|  78.6k|    {
 2819|  78.6k|        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: 7.60k, False: 71.0k]
  |  Branch (2819:63): [True: 2.93k, False: 4.66k]
  |  Branch (2819:105): [True: 1.35k, False: 1.58k]
  ------------------
 2820|  6.25k|        {
 2821|  6.25k|            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: 5.41k, False: 836]
  |  Branch (2821:71): [True: 836, False: 0]
  |  Branch (2821:118): [True: 358, False: 478]
  ------------------
 2822|  5.77k|            {
 2823|  5.77k|                ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac,
 2824|  5.77k|                                   &ps_codec->s_parse.s_bitstrm);
 2825|  5.77k|            }
 2826|  6.25k|        }
 2827|  72.4k|        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: 64.3k, False: 8.06k]
  |  Branch (2827:72): [True: 8.06k, False: 0]
  |  Branch (2827:119): [True: 617, False: 7.44k]
  ------------------
 2828|  64.9k|        {
 2829|  64.9k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2830|  64.9k|            WORD32 ai4_stats[4] = {0};
 2831|  64.9k|#endif
 2832|  64.9k|            cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  64.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 64.9k]
  |  |  |  Branch (40:53): [True: 1.64k, False: 63.3k]
  |  |  ------------------
  ------------------
 2833|  64.9k|            ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2834|  64.9k|                                    &ps_codec->s_parse.s_bitstrm,
 2835|  64.9k|                                    cabac_init_qp,
 2836|  64.9k|                                    cabac_init_idc,
 2837|  64.9k|                                    &gau1_ihevc_cab_ctxts[cabac_init_idc][cabac_init_qp][0]
 2838|  64.9k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2839|  64.9k|                                    ,
 2840|  64.9k|                                    ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL
  ------------------
  |  Branch (2840:37): [True: 1.25k, False: 63.7k]
  ------------------
 2841|  64.9k|#endif
 2842|  64.9k|                                    );
 2843|  64.9k|            if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2843:16): [True: 960, False: 64.0k]
  ------------------
 2844|    960|            {
 2845|    960|                ps_codec->i4_slice_error = 1;
 2846|    960|                end_of_slice_flag = 1;
 2847|    960|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2848|    960|            }
 2849|  64.9k|        }
 2850|  78.6k|    }
 2851|       |
 2852|       |
 2853|   145k|    do
 2854|  23.6M|    {
 2855|       |
 2856|  23.6M|        {
 2857|  23.6M|            WORD32 cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 2858|  23.6M|                            + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 2859|  23.6M|            if(1 == ps_codec->i4_num_cores && 0 == cur_ctb_idx % RESET_TU_BUF_NCTB)
  ------------------
  |  |  175|  10.4M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  10.4M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  10.4M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  10.4M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2859:16): [True: 10.4M, False: 13.2M]
  |  Branch (2859:47): [True: 21.6k, False: 10.3M]
  ------------------
 2860|  21.6k|            {
 2861|  21.6k|                ps_codec->s_parse.ps_tu = ps_codec->s_parse.ps_pic_tu;
 2862|  21.6k|                ps_codec->s_parse.i4_pic_tu_idx = 0;
 2863|  21.6k|            }
 2864|  23.6M|        }
 2865|       |
 2866|  23.6M|        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|  23.6M|        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|  23.6M|        if(((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (2877:13): [True: 1.92M, False: 21.7M]
  |  Branch (2877:55): [True: 153k, False: 1.77M]
  ------------------
 2878|   153k|                        && (!((ps_tile->u1_pos_x == 0) && (ps_tile->u1_pos_y == 0)))
  ------------------
  |  Branch (2878:31): [True: 92.5k, False: 61.1k]
  |  Branch (2878:59): [True: 72.9k, False: 19.6k]
  ------------------
 2879|  80.7k|                        && (!((0 == ps_codec->s_parse.i4_ctb_slice_x) && (0 == ps_codec->s_parse.i4_ctb_slice_y))))
  ------------------
  |  Branch (2879:31): [True: 20.9k, False: 59.7k]
  |  Branch (2879:74): [True: 2.13k, False: 18.8k]
  ------------------
 2880|  78.6k|        {
 2881|  78.6k|            slice_qp = ps_slice_hdr->i1_slice_qp_delta + ps_pps->i1_pic_init_qp;
 2882|  78.6k|            slice_qp = CLIP3(slice_qp, -(ps_codec->i4_qp_bd_offset_y), 51);
  ------------------
  |  |   40|  78.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 78.6k]
  |  |  |  Branch (40:53): [True: 0, False: 78.6k]
  |  |  ------------------
  ------------------
 2883|  78.6k|            ps_codec->s_parse.u4_qp = slice_qp;
 2884|       |
 2885|  78.6k|            ihevcd_get_tile_pos(ps_pps, ps_sps, ps_codec->s_parse.i4_ctb_x,
 2886|  78.6k|                                ps_codec->s_parse.i4_ctb_y,
 2887|  78.6k|                                &ps_codec->s_parse.i4_ctb_tile_x,
 2888|  78.6k|                                &ps_codec->s_parse.i4_ctb_tile_y,
 2889|  78.6k|                                &tile_idx);
 2890|       |
 2891|  78.6k|            ps_codec->s_parse.ps_tile = ps_pps->ps_tile + tile_idx;
 2892|  78.6k|            ps_codec->s_parse.i4_cur_tile_idx = tile_idx;
 2893|  78.6k|            ps_tile_prev = ps_tile - 1;
 2894|       |
 2895|  78.6k|            tile_start_ctb_idx = ps_tile->u1_pos_x
 2896|  78.6k|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 2897|       |
 2898|  78.6k|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 2899|  78.6k|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 2900|       |
 2901|       |            /*For slices that span across multiple tiles*/
 2902|  78.6k|            if(slice_start_ctb_idx < tile_start_ctb_idx)
  ------------------
  |  Branch (2902:16): [True: 77.7k, False: 887]
  ------------------
 2903|  77.7k|            {       /* 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|  77.7k|                ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y - ps_slice_hdr->i2_ctb_y;
 2908|  77.7k|                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: 55.5k, False: 22.1k]
  ------------------
 2909|  55.5k|                {
 2910|  55.5k|                    if(ps_slice_hdr->i2_ctb_y <= ps_tile->u1_pos_y)
  ------------------
  |  Branch (2910:24): [True: 55.5k, False: 0]
  ------------------
 2911|  55.5k|                    {
 2912|       |                        //Check if ctb x is before or after
 2913|  55.5k|                        if(ps_slice_hdr->i2_ctb_x > ps_tile->u1_pos_x)
  ------------------
  |  Branch (2913:28): [True: 732, False: 54.8k]
  ------------------
 2914|    732|                        {
 2915|    732|                            ps_codec->s_parse.i4_ctb_slice_y -= 1;
 2916|    732|                        }
 2917|  55.5k|                    }
 2918|  55.5k|                }
 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|  77.7k|            }
 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|  78.6k|            if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2932:16): [True: 5.09k, False: 73.5k]
  ------------------
 2933|  5.09k|            {
 2934|  5.09k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2935|  5.09k|            WORD32 ai4_stats[4] = {0};
 2936|  5.09k|#endif
 2937|  5.09k|                cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  5.09k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 5.09k]
  |  |  |  Branch (40:53): [True: 6, False: 5.08k]
  |  |  ------------------
  ------------------
 2938|  5.09k|                ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2939|  5.09k|                                        &ps_codec->s_parse.s_bitstrm,
 2940|  5.09k|                                        cabac_init_qp,
 2941|  5.09k|                                        cabac_init_idc,
 2942|  5.09k|                                        &gau1_ihevc_cab_ctxts[cabac_init_idc][cabac_init_qp][0]
 2943|  5.09k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2944|  5.09k|                                        ,
 2945|  5.09k|                                        ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL
  ------------------
  |  Branch (2945:41): [True: 226, False: 4.86k]
  ------------------
 2946|  5.09k|#endif
 2947|  5.09k|                                        );
 2948|  5.09k|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2948:20): [True: 149, False: 4.94k]
  ------------------
 2949|    149|                {
 2950|    149|                    ps_codec->i4_slice_error = 1;
 2951|    149|                    end_of_slice_flag = 1;
 2952|    149|                    ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2953|    149|                }
 2954|       |
 2955|  5.09k|            }
 2956|  78.6k|        }
 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|  23.6M|        if(0 == ps_codec->s_parse.i4_ctb_tile_x)
  ------------------
  |  Branch (2961:12): [True: 1.92M, False: 21.7M]
  ------------------
 2962|  1.92M|        {
 2963|       |
 2964|  1.92M|            if(1 < ps_codec->i4_num_cores)
  ------------------
  |  Branch (2964:16): [True: 1.42M, False: 506k]
  ------------------
 2965|  1.42M|            {
 2966|  1.42M|                proc_job_t s_job;
 2967|  1.42M|                IHEVCD_ERROR_T ret;
 2968|  1.42M|                s_job.i4_cmd    = CMD_PROCESS;
 2969|  1.42M|                s_job.i2_ctb_cnt = (WORD16)ps_tile->u2_wd;
 2970|  1.42M|                s_job.i2_ctb_x = (WORD16)ps_codec->s_parse.i4_ctb_x;
 2971|  1.42M|                s_job.i2_ctb_y = (WORD16)ps_codec->s_parse.i4_ctb_y;
 2972|  1.42M|                s_job.i2_slice_idx = (WORD16)ps_codec->s_parse.i4_cur_slice_idx;
 2973|  1.42M|                s_job.i4_tu_coeff_data_ofst = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data -
 2974|  1.42M|                                (UWORD8 *)ps_codec->s_parse.pv_pic_tu_coeff_data;
 2975|  1.42M|                ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq, &s_job, sizeof(proc_job_t), 1);
 2976|       |
 2977|  1.42M|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2977:20): [True: 0, False: 1.42M]
  ------------------
 2978|      0|                    return ret;
 2979|  1.42M|            }
 2980|   506k|            else
 2981|   506k|            {
 2982|   506k|                process_ctxt_t *ps_proc = &ps_codec->as_process[0];
 2983|   506k|                WORD32 tu_coeff_data_ofst = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data -
 2984|   506k|                                (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|   506k|                ps_proc->i4_ctb_cnt = ps_tile->u2_wd;
 2992|   506k|                ps_proc->i4_ctb_x   = ps_codec->s_parse.i4_ctb_x;
 2993|   506k|                ps_proc->i4_ctb_y   = ps_codec->s_parse.i4_ctb_y;
 2994|   506k|                ps_proc->i4_cur_slice_idx = ps_codec->s_parse.i4_cur_slice_idx;
 2995|       |
 2996|   506k|                ihevcd_init_proc_ctxt(ps_proc, tu_coeff_data_ofst);
 2997|   506k|            }
 2998|  1.92M|        }
 2999|       |
 3000|       |
 3001|       |        /* Restore cabac context model from top right CTB if entropy sync is enabled */
 3002|  23.6M|        if(ps_pps->i1_entropy_coding_sync_enabled_flag)
  ------------------
  |  Branch (3002:12): [True: 1.72M, False: 21.9M]
  ------------------
 3003|  1.72M|        {
 3004|       |            /*TODO Handle single CTB and top-right belonging to a different slice */
 3005|  1.72M|            if(0 == ps_codec->s_parse.i4_ctb_x && 0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3005:16): [True: 51.8k, False: 1.66M]
  |  Branch (3005:51): [True: 11.3k, False: 40.4k]
  ------------------
 3006|  11.3k|            {
 3007|       |                //WORD32 size = sizeof(ps_codec->s_parse.s_cabac.au1_ctxt_models);
 3008|  11.3k|                WORD32 default_ctxt = 0;
 3009|       |
 3010|  11.3k|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) && (!ps_slice_hdr->i1_dependent_slice_flag))
  ------------------
  |  Branch (3010:20): [True: 7.45k, False: 3.87k]
  |  Branch (3010:63): [True: 6.96k, False: 490]
  ------------------
 3011|  6.96k|                    default_ctxt = 1;
 3012|  11.3k|                if(1 == ps_sps->i2_pic_wd_in_ctb)
  ------------------
  |  Branch (3012:20): [True: 5.04k, False: 6.28k]
  ------------------
 3013|  5.04k|                    default_ctxt = 1;
 3014|       |
 3015|  11.3k|                ps_codec->s_parse.u4_qp = slice_qp;
 3016|  11.3k|                if(default_ctxt)
  ------------------
  |  Branch (3016:20): [True: 8.44k, False: 2.88k]
  ------------------
 3017|  8.44k|                {
 3018|  8.44k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3019|  8.44k|                    WORD32 ai4_stats[4] = {0};
 3020|  8.44k|#endif
 3021|       |                    //memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models, &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0], size);
 3022|  8.44k|                    cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  8.44k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 8.44k]
  |  |  |  Branch (40:53): [True: 106, False: 8.33k]
  |  |  ------------------
  ------------------
 3023|  8.44k|                    ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 3024|  8.44k|                                            &ps_codec->s_parse.s_bitstrm,
 3025|  8.44k|                                            cabac_init_qp,
 3026|  8.44k|                                            cabac_init_idc,
 3027|  8.44k|                                            &gau1_ihevc_cab_ctxts[cabac_init_idc][cabac_init_qp][0]
 3028|  8.44k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3029|  8.44k|                                            ,
 3030|  8.44k|                                            ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL
  ------------------
  |  Branch (3030:45): [True: 308, False: 8.13k]
  ------------------
 3031|  8.44k|#endif
 3032|  8.44k|                                            );
 3033|       |
 3034|  8.44k|                    if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (3034:24): [True: 373, False: 8.06k]
  ------------------
 3035|    373|                    {
 3036|    373|                        ps_codec->i4_slice_error = 1;
 3037|    373|                        end_of_slice_flag = 1;
 3038|    373|                        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3039|    373|                    }
 3040|  8.44k|                }
 3041|  2.88k|                else
 3042|  2.88k|                {
 3043|       |                    //memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models, &ps_codec->s_parse.s_cabac.au1_ctxt_models_sync, size);
 3044|  2.88k|                    cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  2.88k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 2.88k]
  |  |  |  Branch (40:53): [True: 18, False: 2.86k]
  |  |  ------------------
  ------------------
 3045|  2.88k|                    ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 3046|  2.88k|                                            &ps_codec->s_parse.s_bitstrm,
 3047|  2.88k|                                            cabac_init_qp,
 3048|  2.88k|                                            cabac_init_idc,
 3049|  2.88k|                                            (const UWORD8 *)&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync
 3050|  2.88k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3051|  2.88k|                                            ,
 3052|  2.88k|                                            ps_sps->i1_persistent_rice_adaptation_enabled_flag ?
  ------------------
  |  Branch (3052:45): [True: 325, False: 2.55k]
  ------------------
 3053|    325|                                                            ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync :
 3054|  2.88k|                                                            NULL
 3055|  2.88k|#endif
 3056|  2.88k|                                            );
 3057|       |
 3058|  2.88k|                    if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (3058:24): [True: 119, False: 2.76k]
  ------------------
 3059|    119|                    {
 3060|    119|                        ps_codec->i4_slice_error = 1;
 3061|    119|                        end_of_slice_flag = 1;
 3062|    119|                        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3063|    119|                    }
 3064|  2.88k|                }
 3065|  11.3k|            }
 3066|  1.72M|        }
 3067|       |
 3068|       |
 3069|       |
 3070|  23.6M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3070:12): [True: 1.13M, False: 22.5M]
  ------------------
 3071|  1.13M|        {
 3072|  1.13M|            if(ps_slice_hdr->i1_slice_sao_luma_flag || ps_slice_hdr->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (3072:16): [True: 508k, False: 628k]
  |  Branch (3072:56): [True: 39.5k, False: 588k]
  ------------------
 3073|   547k|                ihevcd_parse_sao(ps_codec);
 3074|  1.13M|        }
 3075|  22.5M|        else
 3076|  22.5M|        {
 3077|  22.5M|            sao_t *ps_sao = ps_codec->s_parse.ps_pic_sao +
 3078|  22.5M|                            ps_codec->s_parse.i4_ctb_x +
 3079|  22.5M|                            ps_codec->s_parse.i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 3080|       |
 3081|       |            /* Default values */
 3082|  22.5M|            ps_sao->b3_y_type_idx = 0;
 3083|  22.5M|            ps_sao->b3_cb_type_idx = 0;
 3084|  22.5M|            ps_sao->b3_cr_type_idx = 0;
 3085|  22.5M|        }
 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|  23.6M|        {
 3091|  23.6M|            WORD32 ctb_indx;
 3092|  23.6M|            ctb_indx = ps_codec->s_parse.i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_codec->s_parse.i4_ctb_y;
 3093|  23.6M|            ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb[ctb_indx >> 3] |= (1 << (ctb_indx & 7));
 3094|  23.6M|            {
 3095|  23.6M|                UWORD16 *pu1_slice_idx = ps_codec->s_parse.pu1_slice_idx;
 3096|  23.6M|                pu1_slice_idx[ctb_indx] = ps_codec->s_parse.i4_cur_independent_slice_idx;
 3097|  23.6M|            }
 3098|  23.6M|        }
 3099|       |
 3100|  23.6M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3100:12): [True: 1.13M, False: 22.5M]
  ------------------
 3101|  1.13M|        {
 3102|  1.13M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 3103|  1.13M|            WORD32 i4_tu_cnt = ps_codec->s_parse.s_cu.i4_tu_cnt;
 3104|  1.13M|            WORD32 i4_pic_tu_idx = ps_codec->s_parse.i4_pic_tu_idx;
 3105|       |
 3106|  1.13M|            pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 3107|  1.13M|            WORD32 i4_pic_pu_idx = ps_codec->s_parse.i4_pic_pu_idx;
 3108|       |
 3109|  1.13M|            UWORD8 *pu1_tu_coeff_data = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
 3110|       |
 3111|  1.13M|            ret = ihevcd_parse_coding_quadtree(ps_codec,
 3112|  1.13M|                                               (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size),
 3113|  1.13M|                                               (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size),
 3114|  1.13M|                                               ps_sps->i1_log2_ctb_size,
 3115|  1.13M|                                               0);
 3116|       |            /* Check for error */
 3117|  1.13M|            if (ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (3117:17): [True: 1.14k, False: 1.13M]
  ------------------
 3118|  1.14k|            {
 3119|       |                /* Reset tu and pu parameters, and signal current ctb as skip */
 3120|  1.14k|                WORD32 tu_coeff_data_reset_size;
 3121|       |
 3122|  1.14k|                ps_codec->s_parse.ps_tu = ps_tu;
 3123|  1.14k|                ps_codec->s_parse.s_cu.i4_tu_cnt = i4_tu_cnt;
 3124|  1.14k|                ps_codec->s_parse.i4_pic_tu_idx = i4_pic_tu_idx;
 3125|       |
 3126|  1.14k|                ps_codec->s_parse.ps_pu = ps_pu;
 3127|  1.14k|                ps_codec->s_parse.i4_pic_pu_idx = i4_pic_pu_idx;
 3128|       |
 3129|  1.14k|                tu_coeff_data_reset_size = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data - pu1_tu_coeff_data;
 3130|  1.14k|                memset(pu1_tu_coeff_data, 0, tu_coeff_data_reset_size);
 3131|  1.14k|                ps_codec->s_parse.pv_tu_coeff_data = (void *)pu1_tu_coeff_data;
 3132|       |
 3133|  1.14k|                ihevcd_set_ctb_skip(ps_codec);
 3134|       |
 3135|       |                /* Set slice error to suppress further parsing and
 3136|       |                 * signal end of slice.
 3137|       |                 */
 3138|  1.14k|                ps_codec->i4_slice_error = 1;
 3139|  1.14k|                end_of_slice_flag = 1;
 3140|  1.14k|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3141|  1.14k|            }
 3142|  1.13M|        }
 3143|  22.5M|        else
 3144|  22.5M|        {
 3145|  22.5M|            ihevcd_set_ctb_skip(ps_codec);
 3146|  22.5M|        }
 3147|       |
 3148|  23.6M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3148:12): [True: 1.13M, False: 22.5M]
  ------------------
 3149|  1.13M|            end_of_slice_flag = ihevcd_cabac_decode_terminate(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm);
 3150|       |
 3151|  23.6M|        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|  23.6M|        if(ps_pps->i1_tiles_enabled_flag || ps_pps->i1_entropy_coding_sync_enabled_flag)
  ------------------
  |  Branch (3155:12): [True: 6.55M, False: 17.1M]
  |  Branch (3155:45): [True: 397k, False: 16.7M]
  ------------------
 3156|  6.94M|        {
 3157|  6.94M|            WORD32 end_of_tile = 0;
 3158|  6.94M|            WORD32 end_of_tile_row = 0;
 3159|       |
 3160|       |            /* Take a back up of cabac context models if entropy sync is enabled */
 3161|  6.94M|            if(ps_pps->i1_entropy_coding_sync_enabled_flag || ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3161:16): [True: 1.72M, False: 5.22M]
  |  Branch (3161:63): [True: 5.22M, False: 0]
  ------------------
 3162|  6.94M|            {
 3163|  6.94M|                if(1 == ps_codec->s_parse.i4_ctb_x)
  ------------------
  |  Branch (3163:20): [True: 148k, False: 6.79M]
  ------------------
 3164|   148k|                {
 3165|   148k|                    WORD32 size = sizeof(ps_codec->s_parse.s_cabac.au1_ctxt_models);
 3166|   148k|                    memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync, &ps_codec->s_parse.s_cabac.au1_ctxt_models, size);
 3167|       |
 3168|   148k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3169|   148k|                    size = sizeof(ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync);
 3170|   148k|                    memcpy(&ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync, &ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff, size);
 3171|   148k|#endif
 3172|   148k|                }
 3173|  6.94M|            }
 3174|       |
 3175|       |            /* Since tiles and entropy sync are not enabled simultaneously, the following will not result in any problems */
 3176|  6.94M|            if((ps_codec->s_parse.i4_ctb_tile_x + 1) == (ps_tile->u2_wd))
  ------------------
  |  Branch (3176:16): [True: 1.11M, False: 5.82M]
  ------------------
 3177|  1.11M|            {
 3178|  1.11M|                end_of_tile_row = 1;
 3179|  1.11M|                if((ps_codec->s_parse.i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (3179:20): [True: 93.1k, False: 1.02M]
  ------------------
 3180|  93.1k|                    end_of_tile = 1;
 3181|  1.11M|            }
 3182|  6.94M|            if((0 == end_of_slice_flag) && (0 == ps_codec->i4_slice_error) &&
  ------------------
  |  Branch (3182:16): [True: 6.94M, False: 5.16k]
  |  Branch (3182:44): [True: 300k, False: 6.64M]
  ------------------
 3183|   300k|                            ((ps_pps->i1_tiles_enabled_flag && end_of_tile) ||
  ------------------
  |  Branch (3183:31): [True: 287k, False: 13.0k]
  |  Branch (3183:64): [True: 7.08k, False: 280k]
  ------------------
 3184|   293k|                                            (ps_pps->i1_entropy_coding_sync_enabled_flag && end_of_tile_row)))
  ------------------
  |  Branch (3184:46): [True: 28.0k, False: 265k]
  |  Branch (3184:93): [True: 7.89k, False: 20.1k]
  ------------------
 3185|  14.9k|            {
 3186|  14.9k|                WORD32 end_of_sub_stream_one_bit;
 3187|  14.9k|                end_of_sub_stream_one_bit = ihevcd_cabac_decode_terminate(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm);
 3188|  14.9k|                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|  14.9k|                if(ps_codec->s_parse.s_bitstrm.u4_bit_ofst % 8)
  ------------------
  |  Branch (3192:20): [True: 11.8k, False: 3.17k]
  ------------------
 3193|  11.8k|                    ihevcd_bits_flush_to_byte_boundary(&ps_codec->s_parse.s_bitstrm);
 3194|       |
 3195|  14.9k|                UNUSED(end_of_sub_stream_one_bit);
  ------------------
  |  |   38|  14.9k|#define UNUSED(x) ((void)(x))
  ------------------
 3196|  14.9k|            }
 3197|  6.94M|        }
 3198|  23.6M|        {
 3199|  23.6M|            WORD32 ctb_indx;
 3200|       |
 3201|  23.6M|            ctb_addr = ps_codec->s_parse.i4_ctb_y * num_ctb_in_row + ps_codec->s_parse.i4_ctb_x;
 3202|       |
 3203|  23.6M|            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|  23.6M|            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.92M, False: 21.7M]
  |  Branch (3208:77): [True: 1.03M, False: 891k]
  ------------------
 3209|  1.03M|            {
 3210|  1.03M|                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|  1.03M|                if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (3211:20): [True: 70.2k, False: 966k]
  ------------------
 3212|  70.2k|                {
 3213|       |                    //If the current ctb is the last tile's last ctb
 3214|  70.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 (3214:24): [True: 9.09k, False: 61.1k]
  |  Branch (3214:92): [True: 3.88k, False: 5.20k]
  ------------------
 3215|  3.88k|                    {
 3216|  3.88k|                        ctb_indx = ctb_addr; //Next continuous ctb address
 3217|  3.88k|                    }
 3218|  66.3k|                    else //Not last tile's end , but a tile end
 3219|  66.3k|                    {
 3220|  66.3k|                        tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 3221|  66.3k|                        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|  66.3k|                    }
 3223|  70.2k|                }
 3224|  1.03M|            }
 3225|       |
 3226|  23.6M|            ps_codec->s_parse.pu4_pic_pu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_pu_idx;
 3227|  23.6M|            ps_codec->s_parse.i4_next_pu_ctb_cnt = ctb_indx;
 3228|       |
 3229|  23.6M|            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|  23.6M|            if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (3232:16): [True: 10.4M, False: 13.2M]
  ------------------
 3233|  10.4M|            {
 3234|  10.4M|                ctb_indx = (0 == ctb_addr % RESET_TU_BUF_NCTB) ?
  ------------------
  |  |  175|  10.4M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  10.4M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  10.4M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  10.4M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3234:28): [True: 0, False: 10.4M]
  ------------------
 3235|  10.4M|                                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|  10.4M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  20.8M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  10.4M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  10.4M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3236|       |
 3237|       |                //In case of multiple tiles, if end-of-tile row is reached
 3238|  10.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 (3238:20): [True: 506k, False: 9.90M]
  |  Branch (3238:81): [True: 211k, False: 294k]
  ------------------
 3239|   211k|                {
 3240|   211k|                    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|   211k|                    if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (3241:24): [True: 17.2k, False: 194k]
  ------------------
 3242|  17.2k|                    {
 3243|       |                        //If the current ctb is the last tile's last ctb
 3244|  17.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 (3244:28): [True: 2.83k, False: 14.4k]
  |  Branch (3244:96): [True: 1.31k, False: 1.51k]
  ------------------
 3245|  1.31k|                        {
 3246|  1.31k|                            ctb_indx = (0 == ctb_addr % RESET_TU_BUF_NCTB) ?
  ------------------
  |  |  175|  1.31k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  1.31k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  1.31k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  1.31k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.31k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.31k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3246:40): [True: 0, False: 1.31k]
  ------------------
 3247|  1.31k|                                            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.31k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  2.63k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  1.31k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  1.31k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.31k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.31k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3248|  1.31k|                        }
 3249|  15.9k|                        else  //Not last tile's end , but a tile end
 3250|  15.9k|                        {
 3251|  15.9k|                            tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 3252|  15.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.
 3253|  15.9k|                        }
 3254|  17.2k|                    }
 3255|   211k|                }
 3256|  10.4M|                ps_codec->s_parse.i4_next_tu_ctb_cnt = ctb_indx;
 3257|  10.4M|                ps_codec->s_parse.pu4_pic_tu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_tu_idx;
 3258|  10.4M|            }
 3259|  13.2M|            else
 3260|  13.2M|            {
 3261|  13.2M|                ctb_indx = ctb_addr;
 3262|  13.2M|                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: 1.42M, False: 11.8M]
  |  Branch (3262:81): [True: 824k, False: 597k]
  ------------------
 3263|   824k|                {
 3264|   824k|                    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|   824k|                    if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (3265:24): [True: 52.9k, False: 771k]
  ------------------
 3266|  52.9k|                    {
 3267|       |                        //If the current ctb is the last tile's last ctb
 3268|  52.9k|                        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: 6.26k, False: 46.7k]
  |  Branch (3268:96): [True: 2.57k, False: 3.68k]
  ------------------
 3269|  2.57k|                        {
 3270|  2.57k|                            ctb_indx = ctb_addr;
 3271|  2.57k|                        }
 3272|  50.3k|                        else  //Not last tile's end , but a tile end
 3273|  50.3k|                        {
 3274|  50.3k|                            tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 3275|  50.3k|                            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|  50.3k|                        }
 3277|  52.9k|                    }
 3278|   824k|                }
 3279|  13.2M|                ps_codec->s_parse.i4_next_tu_ctb_cnt = ctb_indx;
 3280|  13.2M|                ps_codec->s_parse.pu4_pic_tu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_tu_idx;
 3281|  13.2M|            }
 3282|  23.6M|            ps_codec->s_parse.pu1_tu_map += num_min4x4_in_ctb;
 3283|  23.6M|        }
 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|  23.6M|        if((0 != ps_codec->i4_disable_deblk_pic) &&
  ------------------
  |  Branch (3287:12): [True: 0, False: 23.6M]
  ------------------
 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|  23.6M|        if(ps_codec->i4_num_cores <= MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  23.6M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (3360:12): [True: 16.4M, False: 7.18M]
  ------------------
 3361|  16.4M|        {
 3362|       |            /*************************************************/
 3363|       |            /****************   MV pred **********************/
 3364|       |            /*************************************************/
 3365|  16.4M|            WORD8 u1_top_ctb_avail = 1;
 3366|  16.4M|            WORD8 u1_left_ctb_avail = 1;
 3367|  16.4M|            WORD8 u1_top_lt_ctb_avail = 1;
 3368|  16.4M|            WORD8 u1_top_rt_ctb_avail = 1;
 3369|  16.4M|            WORD16 i2_wd_in_ctb;
 3370|       |
 3371|  16.4M|            tile_start_ctb_idx = ps_tile->u1_pos_x
 3372|  16.4M|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 3373|       |
 3374|  16.4M|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 3375|  16.4M|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3376|       |
 3377|  16.4M|            if((slice_start_ctb_idx < tile_start_ctb_idx))
  ------------------
  |  Branch (3377:16): [True: 3.28M, False: 13.1M]
  ------------------
 3378|  3.28M|            {
 3379|       |                //Slices span across multiple tiles.
 3380|  3.28M|                i2_wd_in_ctb = ps_sps->i2_pic_wd_in_ctb;
 3381|  3.28M|            }
 3382|  13.1M|            else
 3383|  13.1M|            {
 3384|  13.1M|                i2_wd_in_ctb = ps_tile->u2_wd;
 3385|  13.1M|            }
 3386|       |            /* slice and tile boundaries */
 3387|  16.4M|            if((0 == ps_codec->s_parse.i4_ctb_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3387:16): [True: 485k, False: 15.9M]
  |  Branch (3387:53): [True: 187k, False: 15.7M]
  ------------------
 3388|   672k|            {
 3389|   672k|                u1_top_ctb_avail = 0;
 3390|   672k|                u1_top_lt_ctb_avail = 0;
 3391|   672k|                u1_top_rt_ctb_avail = 0;
 3392|   672k|            }
 3393|       |
 3394|  16.4M|            if((0 == ps_codec->s_parse.i4_ctb_x) || (0 == ps_codec->s_parse.i4_ctb_tile_x))
  ------------------
  |  Branch (3394:16): [True: 597k, False: 15.8M]
  |  Branch (3394:53): [True: 785k, False: 15.0M]
  ------------------
 3395|  1.38M|            {
 3396|  1.38M|                u1_left_ctb_avail = 0;
 3397|  1.38M|                u1_top_lt_ctb_avail = 0;
 3398|  1.38M|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3398:20): [True: 94.2k, False: 1.28M]
  |  Branch (3398:63): [True: 52.9k, False: 1.23M]
  ------------------
 3399|   147k|                {
 3400|   147k|                    u1_top_ctb_avail = 0;
 3401|   147k|                    if((i2_wd_in_ctb - 1) != ps_codec->s_parse.i4_ctb_slice_x) //TODO: For tile, not implemented
  ------------------
  |  Branch (3401:24): [True: 124k, False: 22.3k]
  ------------------
 3402|   124k|                    {
 3403|   124k|                        u1_top_rt_ctb_avail = 0;
 3404|   124k|                    }
 3405|   147k|                }
 3406|  1.38M|            }
 3407|       |            /*For slices not beginning at start of a ctb row*/
 3408|  15.0M|            else if(ps_codec->s_parse.i4_ctb_x > 0)
  ------------------
  |  Branch (3408:21): [True: 15.0M, False: 0]
  ------------------
 3409|  15.0M|            {
 3410|  15.0M|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3410:20): [True: 6.56M, False: 8.52M]
  |  Branch (3410:63): [True: 160k, False: 8.36M]
  ------------------
 3411|  6.72M|                {
 3412|  6.72M|                    u1_top_ctb_avail = 0;
 3413|  6.72M|                    u1_top_lt_ctb_avail = 0;
 3414|  6.72M|                    if(0 == ps_codec->s_parse.i4_ctb_slice_x)
  ------------------
  |  Branch (3414:24): [True: 4.62k, False: 6.72M]
  ------------------
 3415|  4.62k|                    {
 3416|  4.62k|                        u1_left_ctb_avail = 0;
 3417|  4.62k|                    }
 3418|  6.72M|                    if((i2_wd_in_ctb - 1) != ps_codec->s_parse.i4_ctb_slice_x)
  ------------------
  |  Branch (3418:24): [True: 6.68M, False: 36.3k]
  ------------------
 3419|  6.68M|                    {
 3420|  6.68M|                        u1_top_rt_ctb_avail = 0;
 3421|  6.68M|                    }
 3422|  6.72M|                }
 3423|  8.36M|                else if((1 == ps_codec->s_parse.i4_ctb_slice_y) && (0 == ps_codec->s_parse.i4_ctb_slice_x))
  ------------------
  |  Branch (3423:25): [True: 315k, False: 8.04M]
  |  Branch (3423:68): [True: 422, False: 314k]
  ------------------
 3424|    422|                {
 3425|    422|                    u1_top_lt_ctb_avail = 0;
 3426|    422|                }
 3427|  15.0M|            }
 3428|       |
 3429|  16.4M|            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: 597k, False: 15.8M]
  |  Branch (3429:82): [True: 785k, False: 15.0M]
  ------------------
 3430|  1.38M|            {
 3431|  1.38M|                u1_top_rt_ctb_avail = 0;
 3432|  1.38M|            }
 3433|       |
 3434|  16.4M|            if(PSLICE == ps_slice_hdr->i1_slice_type
  ------------------
  |  Branch (3434:16): [True: 16.4k, False: 16.4M]
  ------------------
 3435|  16.4M|                            || BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (3435:32): [True: 2.43M, False: 14.0M]
  ------------------
 3436|  2.44M|            {
 3437|  2.44M|                mv_ctxt_t s_mv_ctxt;
 3438|  2.44M|                process_ctxt_t *ps_proc;
 3439|  2.44M|                UWORD32 *pu4_ctb_top_pu_idx;
 3440|  2.44M|                UWORD32 *pu4_ctb_left_pu_idx;
 3441|  2.44M|                UWORD32 *pu4_ctb_top_left_pu_idx;
 3442|  2.44M|                WORD32 i4_ctb_pu_cnt;
 3443|  2.44M|                WORD32 cur_ctb_idx;
 3444|  2.44M|                WORD32 next_ctb_idx;
 3445|  2.44M|                WORD32 cur_pu_idx;
 3446|  2.44M|                ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3446:49): [True: 1.54M, False: 904k]
  ------------------
 3447|  2.44M|                cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3448|  2.44M|                                + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3449|  2.44M|                next_ctb_idx = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3450|  2.44M|                i4_ctb_pu_cnt = ps_codec->s_parse.pu4_pic_pu_idx[next_ctb_idx]
 3451|  2.44M|                                - ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3452|       |
 3453|  2.44M|                cur_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3454|       |
 3455|  2.44M|                pu4_ctb_top_pu_idx = ps_proc->pu4_pic_pu_idx_top
 3456|  2.44M|                                + (ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  2.44M|#define MIN_PU_SIZE         4
  ------------------
 3457|  2.44M|                pu4_ctb_left_pu_idx = ps_proc->pu4_pic_pu_idx_left;
 3458|  2.44M|                pu4_ctb_top_left_pu_idx = &ps_proc->u4_ctb_top_left_pu_idx;
 3459|       |
 3460|       |                /* Initializing s_mv_ctxt */
 3461|  2.44M|                {
 3462|  2.44M|                    s_mv_ctxt.ps_pps = ps_pps;
 3463|  2.44M|                    s_mv_ctxt.ps_sps = ps_sps;
 3464|  2.44M|                    s_mv_ctxt.ps_slice_hdr = ps_slice_hdr;
 3465|  2.44M|                    s_mv_ctxt.i4_ctb_x = ps_codec->s_parse.i4_ctb_x;
 3466|  2.44M|                    s_mv_ctxt.i4_ctb_y = ps_codec->s_parse.i4_ctb_y;
 3467|  2.44M|                    s_mv_ctxt.ps_pu = &ps_codec->s_parse.ps_pic_pu[cur_pu_idx];
 3468|  2.44M|                    s_mv_ctxt.ps_pic_pu = ps_codec->s_parse.ps_pic_pu;
 3469|  2.44M|                    s_mv_ctxt.ps_tile = ps_tile;
 3470|  2.44M|                    s_mv_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
 3471|  2.44M|                    s_mv_ctxt.pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx;
 3472|  2.44M|                    s_mv_ctxt.pu1_pic_pu_map = ps_codec->s_parse.pu1_pic_pu_map;
 3473|  2.44M|                    s_mv_ctxt.i4_ctb_pu_cnt = i4_ctb_pu_cnt;
 3474|  2.44M|                    s_mv_ctxt.i4_ctb_start_pu_idx = cur_pu_idx;
 3475|  2.44M|                    s_mv_ctxt.u1_top_ctb_avail = u1_top_ctb_avail;
 3476|  2.44M|                    s_mv_ctxt.u1_top_rt_ctb_avail = u1_top_rt_ctb_avail;
 3477|  2.44M|                    s_mv_ctxt.u1_top_lt_ctb_avail = u1_top_lt_ctb_avail;
 3478|  2.44M|                    s_mv_ctxt.u1_left_ctb_avail = u1_left_ctb_avail;
 3479|  2.44M|                }
 3480|       |
 3481|  2.44M|                ihevcd_get_mv_ctb(&s_mv_ctxt, pu4_ctb_top_pu_idx,
 3482|  2.44M|                                  pu4_ctb_left_pu_idx, pu4_ctb_top_left_pu_idx);
 3483|       |
 3484|  2.44M|            }
 3485|  14.0M|            else
 3486|  14.0M|            {
 3487|  14.0M|                WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  14.0M|#define MIN_PU_SIZE         4
  ------------------
                              WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  14.0M|#define MIN_PU_SIZE         4
  ------------------
 3488|  14.0M|                UWORD8 *pu1_pic_pu_map_ctb = ps_codec->s_parse.pu1_pic_pu_map +
 3489|  14.0M|                                (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|  14.0M|                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: 8.86M, False: 5.15M]
  ------------------
 3491|  14.0M|                WORD32 row, col;
 3492|  14.0M|                WORD32 pu_cnt;
 3493|  14.0M|                WORD32 num_pu_per_ctb;
 3494|  14.0M|                WORD32 cur_ctb_idx;
 3495|  14.0M|                WORD32 next_ctb_idx;
 3496|  14.0M|                WORD32 ctb_start_pu_idx;
 3497|  14.0M|                UWORD32 *pu4_nbr_pu_idx = ps_proc->pu4_pic_pu_idx_map;
 3498|  14.0M|                WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  14.0M|#define MAX_CTB_SIZE        64
  ------------------
                              WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  14.0M|#define MIN_PU_SIZE         4
  ------------------
 3499|  14.0M|                pu_t *ps_pu;
 3500|  14.0M|                WORD32 ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  14.0M|#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|  14.0M|                cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3506|  14.0M|                                + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3507|  14.0M|                next_ctb_idx = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3508|  14.0M|                num_pu_per_ctb = ps_codec->s_parse.pu4_pic_pu_idx[next_ctb_idx]
 3509|  14.0M|                                - ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3510|  14.0M|                ctb_start_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3511|  14.0M|                ps_pu = &ps_codec->s_parse.ps_pic_pu[ctb_start_pu_idx];
 3512|       |
 3513|   153M|                for(pu_cnt = 0; pu_cnt < num_pu_per_ctb; pu_cnt++, ps_pu++)
  ------------------
  |  Branch (3513:33): [True: 139M, False: 14.0M]
  ------------------
 3514|   139M|                {
 3515|   139M|                    UWORD32 cur_pu_idx;
 3516|   139M|                    WORD32 pu_ht = (ps_pu->b4_ht + 1) << 2;
 3517|   139M|                    WORD32 pu_wd = (ps_pu->b4_wd + 1) << 2;
 3518|       |
 3519|   139M|                    cur_pu_idx = ctb_start_pu_idx + pu_cnt;
 3520|       |
 3521|   419M|                    for(row = 0; row < pu_ht / MIN_PU_SIZE; row++)
  ------------------
  |  |  367|   419M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3521:34): [True: 280M, False: 139M]
  ------------------
 3522|   867M|                        for(col = 0; col < pu_wd / MIN_PU_SIZE; col++)
  ------------------
  |  |  367|   867M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3522:38): [True: 586M, False: 280M]
  ------------------
 3523|   586M|                            pu4_nbr_pu_idx[(1 + ps_pu->b4_pos_x + col)
 3524|   586M|                                            + (1 + ps_pu->b4_pos_y + row)
 3525|   586M|                                            * nbr_pu_idx_strd] =
 3526|   586M|                                            cur_pu_idx;
 3527|   139M|                }
 3528|       |
 3529|       |                /* Updating Top and Left pointers */
 3530|  14.0M|                {
 3531|  14.0M|                    WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
 3532|  14.0M|                                    - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size);
 3533|  14.0M|                    WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  14.0M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 13.6M, False: 390k]
  |  |  ------------------
  ------------------
 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|  14.0M|                    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|  14.0M|#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|  14.0M|#define MIN_PU_SIZE         4
  ------------------
 3538|  94.1M|                    for(i = 0; i < ctb_size / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|  94.1M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3538:32): [True: 80.1M, False: 14.0M]
  ------------------
 3539|  80.1M|                    {
 3540|       |                        /* Left */
 3541|       |                        /* Last column of au4_nbr_pu_idx */
 3542|  80.1M|                        ps_proc->pu4_pic_pu_idx_left[i] = pu4_nbr_pu_idx[(ctb_size / MIN_PU_SIZE)
  ------------------
  |  |  367|  80.1M|#define MIN_PU_SIZE         4
  ------------------
 3543|  80.1M|                                        + (i + 1) * nbr_pu_idx_strd];
 3544|       |                        /* Top */
 3545|       |                        /* Last row of au4_nbr_pu_idx */
 3546|  80.1M|                        ps_proc->pu4_pic_pu_idx_top[(ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE) + i] =
  ------------------
  |  |  367|  80.1M|#define MIN_PU_SIZE         4
  ------------------
 3547|  80.1M|                                        pu4_nbr_pu_idx[(ctb_size_left / MIN_PU_SIZE) * nbr_pu_idx_strd + i + 1];
  ------------------
  |  |  367|  80.1M|#define MIN_PU_SIZE         4
  ------------------
 3548|       |
 3549|  80.1M|                    }
 3550|  14.0M|                }
 3551|       |
 3552|       |                /* Updating the CTB level PU idx (Used for collocated MV pred)*/
 3553|  14.0M|                {
 3554|  14.0M|                    WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map;
 3555|  14.0M|                    WORD32 first_pu_of_ctb;
 3556|  14.0M|                    first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd];
 3557|  14.0M|                    UWORD32 cur_ctb_ht_in_min_pu = MIN(((ps_sps->i2_pic_height_in_luma_samples
  ------------------
  |  |   43|  14.0M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 348k, False: 13.6M]
  |  |  ------------------
  ------------------
 3558|  14.0M|                            - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
 3559|  14.0M|                    UWORD32 cur_ctb_wd_in_min_pu = MIN(((ps_sps->i2_pic_width_in_luma_samples
  ------------------
  |  |   43|  14.0M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 236k, False: 13.7M]
  |  |  ------------------
  ------------------
 3560|  14.0M|                                - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
 3561|       |
 3562|  14.0M|                    index_pic_map = 0 * ctb_size_in_min_pu + 0;
 3563|  14.0M|                    index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1);
 3564|       |
 3565|  92.4M|                    for(ctb_row = 0; ctb_row < cur_ctb_ht_in_min_pu; ctb_row++)
  ------------------
  |  Branch (3565:38): [True: 78.3M, False: 14.0M]
  ------------------
 3566|  78.3M|                    {
 3567|   664M|                        for(ctb_col = 0; ctb_col < cur_ctb_wd_in_min_pu; ctb_col++)
  ------------------
  |  Branch (3567:42): [True: 586M, False: 78.3M]
  ------------------
 3568|   586M|                        {
 3569|   586M|                            pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col]
 3570|   586M|                                            - first_pu_of_ctb;
 3571|   586M|                        }
 3572|  78.3M|                        index_pic_map += ctb_size_in_min_pu;
 3573|  78.3M|                        index_nbr_map += nbr_pu_idx_strd;
 3574|  78.3M|                    }
 3575|  14.0M|                }
 3576|  14.0M|            }
 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|  16.4M|            if(0 == ps_codec->i4_disable_deblk_pic)
  ------------------
  |  Branch (3584:16): [True: 16.4M, False: 0]
  ------------------
 3585|  16.4M|            {
 3586|       |                /* Boundary strength calculation is done irrespective of whether deblocking is disabled
 3587|       |                 * in the slice or not, to handle deblocking slice boundaries */
 3588|  16.4M|                if((0 == ps_codec->i4_slice_error))
  ------------------
  |  Branch (3588:20): [True: 521k, False: 15.9M]
  ------------------
 3589|   521k|                {
 3590|   521k|                    WORD32 i4_ctb_tu_cnt;
 3591|   521k|                    WORD32 cur_ctb_idx, next_ctb_idx;
 3592|   521k|                    WORD32 cur_pu_idx;
 3593|   521k|                    WORD32 cur_tu_idx;
 3594|   521k|                    process_ctxt_t *ps_proc;
 3595|       |
 3596|   521k|                    ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3596:53): [True: 277k, False: 244k]
  ------------------
 3597|   521k|                    cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3598|   521k|                                    + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3599|       |
 3600|   521k|                    cur_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3601|   521k|                    next_ctb_idx = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 3602|   521k|                    if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (3602:24): [True: 277k, False: 244k]
  ------------------
 3603|   277k|                    {
 3604|   277k|                        i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3605|   277k|                                        ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|   277k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   277k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   277k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   277k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   277k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   277k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3606|       |
 3607|   277k|                        cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|   277k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   277k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   277k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   277k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   277k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   277k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3608|   277k|                    }
 3609|   244k|                    else
 3610|   244k|                    {
 3611|   244k|                        i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3612|   244k|                                        ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3613|       |
 3614|   244k|                        cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3615|   244k|                    }
 3616|       |
 3617|   521k|                    ps_codec->s_parse.s_bs_ctxt.ps_pps = ps_codec->s_parse.ps_pps;
 3618|   521k|                    ps_codec->s_parse.s_bs_ctxt.ps_sps = ps_codec->s_parse.ps_sps;
 3619|   521k|                    ps_codec->s_parse.s_bs_ctxt.ps_codec = ps_codec;
 3620|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tu_cnt = i4_ctb_tu_cnt;
 3621|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_x = ps_codec->s_parse.i4_ctb_x;
 3622|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_y = ps_codec->s_parse.i4_ctb_y;
 3623|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tile_x = ps_codec->s_parse.i4_ctb_tile_x;
 3624|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tile_y = ps_codec->s_parse.i4_ctb_tile_y;
 3625|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_slice_x = ps_codec->s_parse.i4_ctb_slice_x;
 3626|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_slice_y = ps_codec->s_parse.i4_ctb_slice_y;
 3627|   521k|                    ps_codec->s_parse.s_bs_ctxt.ps_tu = &ps_codec->s_parse.ps_pic_tu[cur_tu_idx];
 3628|   521k|                    ps_codec->s_parse.s_bs_ctxt.ps_pu = &ps_codec->s_parse.ps_pic_pu[cur_pu_idx];
 3629|   521k|                    ps_codec->s_parse.s_bs_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
 3630|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_next_pu_ctb_cnt = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3631|   521k|                    ps_codec->s_parse.s_bs_ctxt.i4_next_tu_ctb_cnt = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 3632|   521k|                    ps_codec->s_parse.s_bs_ctxt.pu1_slice_idx = ps_codec->s_parse.pu1_slice_idx;
 3633|   521k|                    ps_codec->s_parse.s_bs_ctxt.ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 3634|   521k|                    ps_codec->s_parse.s_bs_ctxt.ps_tile = ps_codec->s_parse.ps_tile;
 3635|       |
 3636|   521k|                    if(ISLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (3636:24): [True: 186k, False: 335k]
  ------------------
 3637|   186k|                    {
 3638|   186k|                        ihevcd_ctb_boundary_strength_islice(&ps_codec->s_parse.s_bs_ctxt);
 3639|   186k|                    }
 3640|   335k|                    else
 3641|   335k|                    {
 3642|   335k|                        ihevcd_ctb_boundary_strength_pbslice(&ps_codec->s_parse.s_bs_ctxt);
 3643|   335k|                    }
 3644|   521k|                }
 3645|       |
 3646|       |                /* Boundary strength is set to zero if deblocking is disabled for the current slice */
 3647|  16.4M|                if(0 != ps_slice_hdr->i1_slice_disable_deblocking_filter_flag)
  ------------------
  |  Branch (3647:20): [True: 620k, False: 15.8M]
  ------------------
 3648|   620k|                {
 3649|   620k|                    WORD32 bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) * (ctb_size * ctb_size / 8 / 16);
 3650|       |
 3651|   620k|                    UWORD32 *pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_codec->s_parse.s_bs_ctxt.pu4_pic_vert_bs +
 3652|   620k|                                    ps_codec->s_parse.i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
 3653|   620k|                                    ps_codec->s_parse.i4_ctb_y * bs_strd);
 3654|   620k|                    UWORD32 *pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_codec->s_parse.s_bs_ctxt.pu4_pic_horz_bs +
 3655|   620k|                                    ps_codec->s_parse.i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
 3656|   620k|                                    ps_codec->s_parse.i4_ctb_y * bs_strd);
 3657|       |
 3658|   620k|                    memset(pu4_vert_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
 3659|   620k|                    memset(pu4_horz_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
 3660|   620k|                }
 3661|  16.4M|            }
 3662|       |
 3663|  16.4M|        }
 3664|       |
 3665|  23.6M|        DATA_SYNC();
  ------------------
  |  |  100|  23.6M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 3666|       |
 3667|       |        /* Update the parse status map */
 3668|  23.6M|        {
 3669|  23.6M|            sps_t *ps_sps = ps_codec->s_parse.ps_sps;
 3670|  23.6M|            UWORD8 *pu1_buf;
 3671|  23.6M|            WORD32 idx;
 3672|  23.6M|            idx = (ps_codec->s_parse.i4_ctb_x);
 3673|  23.6M|            idx += ((ps_codec->s_parse.i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb);
 3674|  23.6M|            pu1_buf = (ps_codec->pu1_parse_map + idx);
 3675|  23.6M|            *pu1_buf = 1;
 3676|  23.6M|        }
 3677|       |
 3678|       |        /* Increment CTB x and y positions */
 3679|  23.6M|        ps_codec->s_parse.i4_ctb_tile_x++;
 3680|  23.6M|        ps_codec->s_parse.i4_ctb_x++;
 3681|  23.6M|        ps_codec->s_parse.i4_ctb_slice_x++;
 3682|       |
 3683|       |        /*If tiles are enabled, handle the slice counters differently*/
 3684|  23.6M|        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3684:12): [True: 6.55M, False: 17.1M]
  ------------------
 3685|  6.55M|        {
 3686|       |            //Indicates multiple tiles in a slice case
 3687|  6.55M|            tile_start_ctb_idx = ps_tile->u1_pos_x
 3688|  6.55M|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 3689|       |
 3690|  6.55M|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 3691|  6.55M|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3692|       |
 3693|  6.55M|            if((slice_start_ctb_idx < tile_start_ctb_idx))
  ------------------
  |  Branch (3693:16): [True: 5.52M, False: 1.02M]
  ------------------
 3694|  5.52M|            {
 3695|  5.52M|                if(ps_codec->s_parse.i4_ctb_slice_x == (ps_tile->u1_pos_x + ps_tile->u2_wd))
  ------------------
  |  Branch (3695:20): [True: 1.02M, False: 4.50M]
  ------------------
 3696|  1.02M|                {
 3697|       |                    /* Reached end of slice row within a tile /frame */
 3698|  1.02M|                    ps_codec->s_parse.i4_ctb_slice_y++;
 3699|  1.02M|                    ps_codec->s_parse.i4_ctb_slice_x = ps_tile->u1_pos_x; //todo:Check
 3700|  1.02M|                }
 3701|  5.52M|            }
 3702|       |            //Indicates multiple slices in a tile case - hence, reset slice_x
 3703|  1.02M|            else if(ps_codec->s_parse.i4_ctb_slice_x == (ps_tile->u2_wd))
  ------------------
  |  Branch (3703:21): [True: 65.2k, False: 963k]
  ------------------
 3704|  65.2k|            {
 3705|  65.2k|                ps_codec->s_parse.i4_ctb_slice_y++;
 3706|  65.2k|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 3707|  65.2k|            }
 3708|  6.55M|        }
 3709|  17.1M|        else
 3710|  17.1M|        {
 3711|  17.1M|            if(ps_codec->s_parse.i4_ctb_slice_x == ps_tile->u2_wd)
  ------------------
  |  Branch (3711:16): [True: 791k, False: 16.3M]
  ------------------
 3712|   791k|            {
 3713|       |                /* Reached end of slice row within a tile /frame */
 3714|   791k|                ps_codec->s_parse.i4_ctb_slice_y++;
 3715|   791k|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 3716|   791k|            }
 3717|  17.1M|        }
 3718|       |
 3719|       |
 3720|  23.6M|        if(ps_codec->s_parse.i4_ctb_tile_x == (ps_tile->u2_wd))
  ------------------
  |  Branch (3720:12): [True: 1.92M, False: 21.7M]
  ------------------
 3721|  1.92M|        {
 3722|       |            /* Reached end of tile row */
 3723|  1.92M|            ps_codec->s_parse.i4_ctb_tile_x = 0;
 3724|  1.92M|            ps_codec->s_parse.i4_ctb_x = ps_tile->u1_pos_x;
 3725|       |
 3726|  1.92M|            ps_codec->s_parse.i4_ctb_tile_y++;
 3727|  1.92M|            ps_codec->s_parse.i4_ctb_y++;
 3728|       |
 3729|  1.92M|            if(ps_codec->s_parse.i4_ctb_tile_y == (ps_tile->u2_ht))
  ------------------
  |  Branch (3729:16): [True: 153k, False: 1.77M]
  ------------------
 3730|   153k|            {
 3731|       |                /* Reached End of Tile */
 3732|   153k|                ps_codec->s_parse.i4_ctb_tile_y = 0;
 3733|   153k|                ps_codec->s_parse.i4_ctb_tile_x = 0;
 3734|   153k|                ps_codec->s_parse.ps_tile++;
 3735|       |
 3736|   153k|                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: 86.6k, False: 67.0k]
  |  Branch (3736:90): [True: 72.9k, False: 13.7k]
  ------------------
 3737|  72.9k|                {
 3738|       |                    /* Reached end of frame */
 3739|  72.9k|                    end_of_pic = 1;
 3740|  72.9k|                    ps_codec->s_parse.i4_ctb_x = 0;
 3741|  72.9k|                    ps_codec->s_parse.i4_ctb_y = ps_sps->i2_pic_ht_in_ctb;
 3742|  72.9k|                }
 3743|  80.7k|                else
 3744|  80.7k|                {
 3745|       |                    /* Initialize ctb_x and ctb_y to start of next tile */
 3746|  80.7k|                    ps_tile = ps_codec->s_parse.ps_tile;
 3747|  80.7k|                    ps_codec->s_parse.i4_ctb_x = ps_tile->u1_pos_x;
 3748|  80.7k|                    ps_codec->s_parse.i4_ctb_y = ps_tile->u1_pos_y;
 3749|  80.7k|                    ps_codec->s_parse.i4_ctb_tile_y = 0;
 3750|  80.7k|                    ps_codec->s_parse.i4_ctb_tile_x = 0;
 3751|  80.7k|                    ps_codec->s_parse.i4_ctb_slice_x = ps_tile->u1_pos_x;
 3752|  80.7k|                    ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y;
 3753|       |
 3754|  80.7k|                }
 3755|   153k|            }
 3756|       |
 3757|  1.92M|        }
 3758|       |
 3759|  23.6M|        ps_codec->s_parse.i4_next_ctb_indx = ps_codec->s_parse.i4_ctb_x +
 3760|  23.6M|                        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|  23.6M|        if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (3764:12): [True: 22.5M, False: 1.13M]
  ------------------
 3765|  22.5M|        {
 3766|  22.5M|            slice_header_t *ps_slice_hdr_next = ps_slice_hdr + 1;
 3767|  22.5M|            WORD32 next_slice_addr = ps_slice_hdr_next->i2_ctb_x +
 3768|  22.5M|                            ps_slice_hdr_next->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 3769|       |
 3770|  22.5M|            if(ps_codec->s_parse.i4_next_ctb_indx == next_slice_addr)
  ------------------
  |  Branch (3770:16): [True: 46.7k, False: 22.4M]
  ------------------
 3771|  46.7k|                end_of_slice_flag = 1;
 3772|  22.5M|        }
 3773|       |
 3774|       |        /* If the codec is running in single core mode
 3775|       |         * then call process function for current CTB
 3776|       |         */
 3777|  23.6M|        if((1 == ps_codec->i4_num_cores) && (ps_codec->s_parse.i4_ctb_tile_x == 0))
  ------------------
  |  Branch (3777:12): [True: 10.4M, False: 13.2M]
  |  Branch (3777:45): [True: 506k, False: 9.90M]
  ------------------
 3778|   506k|        {
 3779|   506k|            process_ctxt_t *ps_proc = &ps_codec->as_process[0];
 3780|       |//          ps_proc->i4_ctb_cnt = ihevcd_nctb_cnt(ps_codec, ps_sps);
 3781|   506k|            ps_proc->i4_ctb_cnt = ps_proc->ps_tile->u2_wd;
 3782|   506k|            ihevcd_process(ps_proc);
 3783|   506k|        }
 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|  23.6M|        if((UWORD8 *)ps_codec->s_parse.s_bitstrm.pu1_buf_max + BITSTRM_OFF_THRS <
  ------------------
  |  |   83|  23.6M|#define BITSTRM_OFF_THRS 8
  ------------------
  |  Branch (3788:12): [True: 3.38M, False: 20.2M]
  ------------------
 3789|  23.6M|                                        ((UWORD8 *)ps_codec->s_parse.s_bitstrm.pu4_buf + (ps_codec->s_parse.s_bitstrm.u4_bit_ofst / 8)))
 3790|  3.38M|        {
 3791|       |            // end_of_slice_flag = ps_codec->i4_slice_error ? 0 : 1;
 3792|       |
 3793|  3.38M|            if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3793:16): [True: 64.0k, False: 3.32M]
  ------------------
 3794|  64.0k|                end_of_slice_flag = 1;
 3795|  3.38M|        }
 3796|       |
 3797|       |
 3798|  23.6M|        if(end_of_pic)
  ------------------
  |  Branch (3798:12): [True: 72.9k, False: 23.5M]
  ------------------
 3799|  72.9k|            break;
 3800|  23.6M|    } while(!end_of_slice_flag);
  ------------------
  |  Branch (3800:13): [True: 23.5M, False: 72.5k]
  ------------------
 3801|       |
 3802|       |    /* Reset slice error */
 3803|   145k|    ps_codec->i4_slice_error = 0;
 3804|       |
 3805|       |    /* Increment the slice index for parsing next slice */
 3806|   145k|    if(0 == end_of_pic)
  ------------------
  |  Branch (3806:8): [True: 72.5k, False: 72.9k]
  ------------------
 3807|  72.5k|    {
 3808|  72.5k|        while(1)
  ------------------
  |  Branch (3808:15): [True: 72.5k, Folded]
  ------------------
 3809|  72.5k|        {
 3810|       |
 3811|  72.5k|            WORD32 parse_slice_idx;
 3812|  72.5k|            parse_slice_idx = ps_codec->s_parse.i4_cur_slice_idx;
 3813|  72.5k|            parse_slice_idx++;
 3814|       |
 3815|  72.5k|            {
 3816|       |                /* If the next slice header is not initialized, update cur_slice_idx and break */
 3817|  72.5k|                if((1 == ps_codec->i4_num_cores) || (0 != (parse_slice_idx & (MAX_SLICE_HDR_CNT - 1))))
  ------------------
  |  |  153|  48.7k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  48.7k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  |  Branch (3817:20): [True: 23.8k, False: 48.7k]
  |  Branch (3817:53): [True: 48.7k, False: 0]
  ------------------
 3818|  72.5k|                {
 3819|  72.5k|                    ps_codec->s_parse.i4_cur_slice_idx = parse_slice_idx;
 3820|  72.5k|                    break;
 3821|  72.5k|                }
 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|  72.5k|            }
 3841|  72.5k|        }
 3842|       |
 3843|  72.5k|    }
 3844|  72.9k|    else
 3845|  72.9k|    {
 3846|       |
 3847|  72.9k|        ps_codec->s_parse.i4_end_of_frame = 1;
 3848|  72.9k|    }
 3849|   145k|    return ret;
 3850|   145k|}

ihevcd_ref_pic_list_modification:
  143|  9.41k|{
  144|  9.41k|    WORD32 ret = IHEVCD_SUCCESS;
  145|  9.41k|    WORD32 value;
  146|  9.41k|    WORD32 i;
  147|  9.41k|    rplm_t *ps_rplm;
  148|  9.41k|    WORD32 num_bits_list_entry;
  149|       |
  150|  9.41k|    ps_rplm = &(ps_slice_hdr->s_rplm);
  151|       |
  152|       |    /* Calculate Ceil(Log2(num_poc_total_curr)) */
  153|  9.41k|    {
  154|  9.41k|        num_bits_list_entry = 32 - CLZ(num_poc_total_curr);
  155|       |        /* Check if num_poc_total_curr is power of 2 */
  156|  9.41k|        if(0 == (num_poc_total_curr & (num_poc_total_curr - 1)))
  ------------------
  |  Branch (156:12): [True: 5.30k, False: 4.11k]
  ------------------
  157|  5.30k|        {
  158|  5.30k|            num_bits_list_entry--;
  159|  5.30k|        }
  160|  9.41k|    }
  161|       |
  162|  9.41k|    if(ps_slice_hdr->i1_slice_type  == PSLICE || ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (162:8): [True: 882, False: 8.53k]
  |  Branch (162:50): [True: 8.53k, False: 0]
  ------------------
  163|  9.41k|    {
  164|  9.41k|        BITS_PARSE("ref_pic_list_modification_flag_l0", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  9.41k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  165|  9.41k|        ps_rplm->i1_ref_pic_list_modification_flag_l0 = value;
  166|       |
  167|  9.41k|        if(ps_rplm->i1_ref_pic_list_modification_flag_l0)
  ------------------
  |  Branch (167:12): [True: 4.62k, False: 4.79k]
  ------------------
  168|  16.9k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (168:24): [True: 12.3k, False: 4.62k]
  ------------------
  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.17k, False: 9.19k]
  |  |  |  Branch (40:53): [True: 0, False: 9.19k]
  |  |  ------------------
  ------------------
  174|  12.3k|            }
  175|  9.41k|    }
  176|       |
  177|  9.41k|    if(ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (177:8): [True: 8.53k, False: 882]
  ------------------
  178|  8.53k|    {
  179|  8.53k|        BITS_PARSE("ref_pic_list_modification_flag_l1", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.53k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  180|  8.53k|        ps_rplm->i1_ref_pic_list_modification_flag_l1 = value;
  181|       |
  182|  8.53k|        if(ps_rplm->i1_ref_pic_list_modification_flag_l1)
  ------------------
  |  Branch (182:12): [True: 5.47k, False: 3.06k]
  ------------------
  183|  16.1k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (183:24): [True: 10.6k, False: 5.47k]
  ------------------
  184|  10.6k|            {
  185|  10.6k|                BITS_PARSE("list_entry_l1", value, ps_bitstrm, num_bits_list_entry);
  ------------------
  |  |  148|  10.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  186|  10.6k|                ps_rplm->i1_list_entry_l1[i] = value;
  187|       |
  188|  10.6k|                ps_rplm->i1_list_entry_l1[i] = CLIP3(ps_rplm->i1_list_entry_l1[i], 0, num_poc_total_curr - 1);
  ------------------
  |  |   40|  10.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.96k, False: 7.67k]
  |  |  |  Branch (40:53): [True: 0, False: 7.67k]
  |  |  ------------------
  ------------------
  189|  10.6k|            }
  190|       |
  191|  8.53k|    }
  192|       |
  193|  9.41k|    return ret;
  194|  9.41k|}
ihevcd_parse_slice_header:
  219|   219k|{
  220|   219k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  221|   219k|    UWORD32 value;
  222|   219k|    WORD32 i4_value;
  223|   219k|    WORD32 i, j;
  224|   219k|    WORD32 sps_id;
  225|       |
  226|   219k|    pps_t *ps_pps;
  227|   219k|    sps_t *ps_sps;
  228|   219k|    slice_header_t *ps_slice_hdr;
  229|   219k|    WORD32 disable_deblocking_filter_flag;
  230|   219k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  231|   219k|    WORD32 idr_pic_flag;
  232|   219k|    WORD32 pps_id;
  233|   219k|    WORD32 first_slice_in_pic_flag;
  234|   219k|    WORD32 no_output_of_prior_pics_flag = 0;
  235|   219k|    WORD8 i1_nal_unit_type = ps_nal->i1_nal_unit_type;
  236|   219k|    WORD32 num_poc_total_curr = 0;
  237|   219k|    UWORD32 slice_address;
  238|   219k|    WORD32 prev_slice_incomplete_flag = 0;
  239|       |
  240|   219k|    if(ps_codec->i4_slice_error == 1)
  ------------------
  |  Branch (240:8): [True: 31.1k, False: 188k]
  ------------------
  241|  31.1k|        return ret;
  242|       |
  243|   188k|    idr_pic_flag = (NAL_IDR_W_LP == i1_nal_unit_type) ||
  ------------------
  |  Branch (243:20): [True: 22.4k, False: 166k]
  ------------------
  244|   166k|                    (NAL_IDR_N_LP == i1_nal_unit_type);
  ------------------
  |  Branch (244:21): [True: 48.1k, False: 118k]
  ------------------
  245|       |
  246|       |
  247|   188k|    BITS_PARSE("first_slice_in_pic_flag", first_slice_in_pic_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|   188k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  248|   188k|    if((NAL_BLA_W_LP <= i1_nal_unit_type) &&
  ------------------
  |  Branch (248:8): [True: 90.4k, False: 98.3k]
  ------------------
  249|  90.4k|       (NAL_RSV_RAP_VCL23          >= i1_nal_unit_type))
  ------------------
  |  Branch (249:8): [True: 90.4k, False: 0]
  ------------------
  250|  90.4k|    {
  251|  90.4k|        BITS_PARSE("no_output_of_prior_pics_flag", no_output_of_prior_pics_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  90.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  252|  90.4k|    }
  253|   188k|    UEV_PARSE("pic_parameter_set_id", pps_id, ps_bitstrm);
  ------------------
  |  |  155|   188k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  254|   188k|    if(pps_id < 0 || pps_id > MAX_PPS_CNT - 2)
  ------------------
  |  |  344|   183k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (254:8): [True: 5.39k, False: 183k]
  |  Branch (254:22): [True: 26.2k, False: 157k]
  ------------------
  255|  31.6k|    {
  256|  31.6k|        return IHEVCD_INVALID_PARAMETER;
  257|  31.6k|    }
  258|       |
  259|       |    /* Get the current PPS structure */
  260|   157k|    ps_pps = ps_codec->s_parse.ps_pps_base + pps_id;
  261|   157k|    if(0 == ps_pps->i1_pps_valid)
  ------------------
  |  Branch (261:8): [True: 15.9k, False: 141k]
  ------------------
  262|  15.9k|    {
  263|  15.9k|        pps_t *ps_pps_ref = ps_codec->ps_pps_base;
  264|  36.1k|        while(0 == ps_pps_ref->i1_pps_valid)
  ------------------
  |  Branch (264:15): [True: 20.3k, False: 15.8k]
  ------------------
  265|  20.3k|        {
  266|  20.3k|            ps_pps_ref++;
  267|  20.3k|            if((ps_pps_ref - ps_codec->ps_pps_base >= MAX_PPS_CNT - 1))
  ------------------
  |  |  344|  20.3k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (267:16): [True: 66, False: 20.2k]
  ------------------
  268|     66|                return IHEVCD_INVALID_HEADER;
  269|  20.3k|        }
  270|       |
  271|  15.8k|        ihevcd_copy_pps(ps_codec, pps_id, ps_pps_ref->i1_pps_id);
  272|  15.8k|    }
  273|       |
  274|       |    /* Get SPS id for the current PPS */
  275|   157k|    sps_id = ps_pps->i1_sps_id;
  276|       |
  277|       |    /* Get the current SPS structure */
  278|   157k|    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|   157k|    if((0 != ps_codec->u4_pic_cnt || ps_codec->i4_pic_present) &&
  ------------------
  |  Branch (284:9): [True: 113k, False: 43.5k]
  |  Branch (284:38): [True: 5.93k, False: 37.6k]
  ------------------
  285|   119k|                    first_slice_in_pic_flag)
  ------------------
  |  Branch (285:21): [True: 82.5k, False: 36.8k]
  ------------------
  286|  82.5k|    {
  287|  82.5k|        if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (287:12): [True: 9.10k, False: 73.4k]
  ------------------
  288|  9.10k|        {
  289|  9.10k|            slice_header_t *ps_slice_hdr_next;
  290|  9.10k|            ps_codec->i4_slice_error = 1;
  291|  9.10k|            ps_codec->s_parse.i4_cur_slice_idx--;
  292|  9.10k|            if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (292:16): [True: 0, False: 9.10k]
  ------------------
  293|      0|                ps_codec->s_parse.i4_cur_slice_idx = 0;
  294|       |
  295|  9.10k|            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|  9.10k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  9.10k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  296|  9.10k|            ps_slice_hdr_next->i2_ctb_x = 0;
  297|  9.10k|            ps_slice_hdr_next->i2_ctb_y = ps_codec->s_parse.ps_sps->i2_pic_ht_in_ctb;
  298|  9.10k|            return ret;
  299|  9.10k|        }
  300|  73.4k|        else
  301|  73.4k|        {
  302|  73.4k|            ps_codec->i4_slice_error = 0;
  303|  73.4k|        }
  304|  82.5k|    }
  305|       |
  306|   147k|    if(first_slice_in_pic_flag)
  ------------------
  |  Branch (306:8): [True: 106k, False: 41.6k]
  ------------------
  307|   106k|    {
  308|   106k|        ps_codec->s_parse.i4_cur_slice_idx = 0;
  309|   106k|    }
  310|  41.6k|    else
  311|  41.6k|    {
  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|  41.6k|        if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (316:12): [True: 19.6k, False: 22.0k]
  ------------------
  317|  19.6k|            ps_codec->s_parse.i4_cur_slice_idx = 1;
  318|  41.6k|    }
  319|       |
  320|   147k|    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|   147k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   147k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  321|   147k|    memset(ps_slice_hdr, 0, sizeof(*ps_slice_hdr));
  322|   147k|    ps_slice_hdr->i2_ctb_x = -1;
  323|   147k|    ps_slice_hdr->i2_ctb_y = -1;
  324|       |
  325|   147k|    if((ps_pps->i1_dependent_slice_enabled_flag) &&
  ------------------
  |  Branch (325:8): [True: 96.3k, False: 51.5k]
  ------------------
  326|  96.3k|       (!first_slice_in_pic_flag))
  ------------------
  |  Branch (326:8): [True: 28.7k, False: 67.6k]
  ------------------
  327|  28.7k|    {
  328|  28.7k|        BITS_PARSE("dependent_slice_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  28.7k|    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.7k|        if (value && 0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (331:13): [True: 15.2k, False: 13.5k]
  |  Branch (331:22): [True: 3.68k, False: 11.5k]
  ------------------
  332|  3.68k|        {
  333|  3.68k|             return IHEVCD_IGNORE_SLICE;
  334|  3.68k|        }
  335|       |
  336|       |        /* If dependendent slice, copy slice header from previous slice */
  337|  25.0k|        if(value && (ps_codec->s_parse.i4_cur_slice_idx > 0))
  ------------------
  |  Branch (337:12): [True: 11.5k, False: 13.5k]
  |  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|  25.0k|        ps_slice_hdr->i1_dependent_slice_flag = value;
  344|  25.0k|    }
  345|   119k|    else
  346|   119k|    {
  347|   119k|        ps_slice_hdr->i1_dependent_slice_flag = 0;
  348|   119k|    }
  349|   144k|    ps_slice_hdr->i1_nal_unit_type = i1_nal_unit_type;
  350|   144k|    ps_slice_hdr->i1_pps_id = pps_id;
  351|   144k|    ps_slice_hdr->i1_first_slice_in_pic_flag = first_slice_in_pic_flag;
  352|       |
  353|   144k|    ps_slice_hdr->i1_no_output_of_prior_pics_flag = 1;
  354|   144k|    if((NAL_BLA_W_LP <= i1_nal_unit_type) &&
  ------------------
  |  Branch (354:8): [True: 81.6k, False: 62.5k]
  ------------------
  355|  81.6k|                    (NAL_RSV_RAP_VCL23          >= i1_nal_unit_type))
  ------------------
  |  Branch (355:21): [True: 81.6k, False: 0]
  ------------------
  356|  81.6k|    {
  357|  81.6k|        ps_slice_hdr->i1_no_output_of_prior_pics_flag = no_output_of_prior_pics_flag;
  358|  81.6k|    }
  359|   144k|    ps_slice_hdr->i1_pps_id = pps_id;
  360|       |
  361|   144k|    if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (361:8): [True: 38.0k, False: 106k]
  ------------------
  362|  38.0k|    {
  363|  38.0k|        WORD32 num_bits;
  364|       |
  365|       |        /* Use CLZ to compute Ceil( Log2( PicSizeInCtbsY ) ) */
  366|  38.0k|        num_bits = 32 - CLZ(ps_sps->i4_pic_size_in_ctb - 1);
  367|  38.0k|        BITS_PARSE("slice_address", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|  38.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  368|       |
  369|  38.0k|        slice_address = value;
  370|       |        /* If slice address is greater than the number of CTBs in a picture,
  371|       |         * ignore the slice */
  372|  38.0k|        if(value >= ps_sps->i4_pic_size_in_ctb || value == 0)
  ------------------
  |  Branch (372:12): [True: 1.30k, False: 36.6k]
  |  Branch (372:51): [True: 2.46k, False: 34.2k]
  ------------------
  373|  3.76k|            return IHEVCD_IGNORE_SLICE;
  374|  38.0k|    }
  375|   106k|    else
  376|   106k|    {
  377|   106k|        slice_address = 0;
  378|   106k|    }
  379|       |
  380|   140k|    if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (380:8): [True: 129k, False: 11.3k]
  ------------------
  381|   129k|    {
  382|   129k|        ps_slice_hdr->i1_pic_output_flag = 1;
  383|   129k|        ps_slice_hdr->i4_pic_order_cnt_lsb = 0;
  384|   129k|        ps_slice_hdr->i1_num_long_term_sps = 0;
  385|   129k|        ps_slice_hdr->i1_num_long_term_pics = 0;
  386|       |
  387|   319k|        for(i = 0; i < ps_pps->i1_num_extra_slice_header_bits; i++)
  ------------------
  |  Branch (387:20): [True: 190k, False: 129k]
  ------------------
  388|   190k|        {
  389|   190k|            BITS_PARSE("slice_reserved_undetermined_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   190k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  390|       |            //slice_reserved_undetermined_flag[ i ]
  391|   190k|        }
  392|   129k|        UEV_PARSE("slice_type", value, ps_bitstrm);
  ------------------
  |  |  155|   129k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  393|   129k|        if(value > 2)
  ------------------
  |  Branch (393:12): [True: 4.16k, False: 124k]
  ------------------
  394|  4.16k|        {
  395|  4.16k|            return IHEVCD_INVALID_PARAMETER;
  396|  4.16k|        }
  397|   124k|        ps_slice_hdr->i1_slice_type = value;
  398|       |
  399|       |        /* If the picture is IRAP, slice type must be equal to ISLICE */
  400|   124k|        if((ps_slice_hdr->i1_nal_unit_type >= NAL_BLA_W_LP) &&
  ------------------
  |  Branch (400:12): [True: 77.3k, False: 47.6k]
  ------------------
  401|  77.3k|                        (ps_slice_hdr->i1_nal_unit_type <= NAL_RSV_RAP_VCL23))
  ------------------
  |  Branch (401:25): [True: 77.3k, False: 0]
  ------------------
  402|  77.3k|            ps_slice_hdr->i1_slice_type = ISLICE;
  403|       |
  404|   124k|        if((ps_slice_hdr->i1_slice_type < 0) ||
  ------------------
  |  Branch (404:12): [True: 0, False: 124k]
  ------------------
  405|   124k|                        (ps_slice_hdr->i1_slice_type > 2))
  ------------------
  |  Branch (405:25): [True: 0, False: 124k]
  ------------------
  406|      0|            return IHEVCD_IGNORE_SLICE;
  407|       |
  408|       |
  409|   124k|        if(ps_pps->i1_output_flag_present_flag)
  ------------------
  |  Branch (409:12): [True: 24.2k, False: 100k]
  ------------------
  410|  24.2k|        {
  411|  24.2k|            BITS_PARSE("pic_output_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  24.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  412|  24.2k|            ps_slice_hdr->i1_pic_output_flag = value;
  413|  24.2k|        }
  414|   124k|        ps_slice_hdr->i1_colour_plane_id = 0;
  415|   124k|        if(1 == ps_sps->i1_separate_colour_plane_flag)
  ------------------
  |  Branch (415:12): [True: 0, False: 124k]
  ------------------
  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|   124k|        ps_slice_hdr->i1_slice_temporal_mvp_enable_flag = 0;
  421|       |
  422|   124k|        if(!idr_pic_flag)
  ------------------
  |  Branch (422:12): [True: 65.4k, False: 59.4k]
  ------------------
  423|  65.4k|        {
  424|       |
  425|  65.4k|            WORD32 st_rps_idx;
  426|  65.4k|            WORD32 num_neg_pics;
  427|  65.4k|            WORD32 num_pos_pics;
  428|  65.4k|            WORD8 *pi1_used;
  429|       |
  430|  65.4k|            BITS_PARSE("pic_order_cnt_lsb", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|  65.4k|    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|  65.4k|            ps_slice_hdr->i4_pic_order_cnt_lsb = value;
  433|       |
  434|  65.4k|            BITS_PARSE("short_term_ref_pic_set_sps_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  65.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  435|  65.4k|            ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag = value;
  436|       |
  437|  65.4k|            if(1 == ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag)
  ------------------
  |  Branch (437:16): [True: 51.3k, False: 14.1k]
  ------------------
  438|  51.3k|            {
  439|  51.3k|                WORD32 numbits;
  440|       |
  441|  51.3k|                ps_slice_hdr->i1_short_term_ref_pic_set_idx = 0;
  442|  51.3k|                if(ps_sps->i1_num_short_term_ref_pic_sets > 1)
  ------------------
  |  Branch (442:20): [True: 11.3k, False: 40.0k]
  ------------------
  443|  11.3k|                {
  444|  11.3k|                    numbits = 32 - CLZ(ps_sps->i1_num_short_term_ref_pic_sets - 1);
  445|  11.3k|                    BITS_PARSE("short_term_ref_pic_set_idx", value, ps_bitstrm, numbits);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  446|  11.3k|                    if (value >= ps_sps->i1_num_short_term_ref_pic_sets) {
  ------------------
  |  Branch (446:25): [True: 378, False: 10.9k]
  ------------------
  447|    378|                        return IHEVCD_INVALID_PARAMETER;
  448|    378|                    }
  449|  10.9k|                    ps_slice_hdr->i1_short_term_ref_pic_set_idx = value;
  450|  10.9k|                }
  451|       |
  452|  50.9k|                st_rps_idx = ps_slice_hdr->i1_short_term_ref_pic_set_idx;
  453|  50.9k|                num_neg_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_neg_pics;
  454|  50.9k|                num_pos_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_pos_pics;
  455|  50.9k|                pi1_used = ps_sps->as_stref_picset[st_rps_idx].ai1_used;
  456|  50.9k|            }
  457|  14.1k|            else
  458|  14.1k|            {
  459|  14.1k|                ret = ihevcd_short_term_ref_pic_set(ps_bitstrm,
  460|  14.1k|                                                    &ps_sps->as_stref_picset[0],
  461|  14.1k|                                                    ps_sps->i1_num_short_term_ref_pic_sets,
  462|  14.1k|                                                    ps_sps->i1_num_short_term_ref_pic_sets,
  463|  14.1k|                                                    &ps_slice_hdr->s_stref_picset);
  464|  14.1k|                if (ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (464:21): [True: 1.64k, False: 12.4k]
  ------------------
  465|  1.64k|                {
  466|  1.64k|                    return ret;
  467|  1.64k|                }
  468|  12.4k|                st_rps_idx = ps_sps->i1_num_short_term_ref_pic_sets;
  469|  12.4k|                num_neg_pics = ps_slice_hdr->s_stref_picset.i1_num_neg_pics;
  470|  12.4k|                num_pos_pics = ps_slice_hdr->s_stref_picset.i1_num_pos_pics;
  471|  12.4k|                pi1_used = ps_slice_hdr->s_stref_picset.ai1_used;
  472|  12.4k|            }
  473|       |
  474|  63.4k|            if(ps_sps->i1_long_term_ref_pics_present_flag)
  ------------------
  |  Branch (474:16): [True: 19.7k, False: 43.7k]
  ------------------
  475|  19.7k|            {
  476|  19.7k|                if(ps_sps->i1_num_long_term_ref_pics_sps > 0)
  ------------------
  |  Branch (476:20): [True: 9.53k, False: 10.1k]
  ------------------
  477|  9.53k|                {
  478|  9.53k|                    UEV_PARSE("num_long_term_sps", value, ps_bitstrm);
  ------------------
  |  |  155|  9.53k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  479|  9.53k|                    if(value > ps_sps->i1_num_long_term_ref_pics_sps)
  ------------------
  |  Branch (479:24): [True: 222, False: 9.31k]
  ------------------
  480|    222|                    {
  481|    222|                        return IHEVCD_INVALID_PARAMETER;
  482|    222|                    }
  483|  9.31k|                    ps_slice_hdr->i1_num_long_term_sps = value;
  484|  9.31k|                }
  485|  19.4k|                UEV_PARSE("num_long_term_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  19.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  486|  19.4k|                if(((ULWORD64)value + ps_slice_hdr->i1_num_long_term_sps + num_neg_pics +
  ------------------
  |  Branch (486:20): [True: 167, False: 19.3k]
  ------------------
  487|  19.4k|                    num_pos_pics) > (MAX_DPB_SIZE - 1))
  ------------------
  |  |  291|  19.4k|#define MAX_DPB_SIZE 16
  ------------------
  488|    167|                {
  489|    167|                    return IHEVCD_INVALID_PARAMETER;
  490|    167|                }
  491|  19.3k|                ps_slice_hdr->i1_num_long_term_pics = value;
  492|       |
  493|   140k|                for(i = 0; i < (ps_slice_hdr->i1_num_long_term_sps +
  ------------------
  |  Branch (493:28): [True: 121k, False: 19.2k]
  ------------------
  494|   140k|                                ps_slice_hdr->i1_num_long_term_pics); i++)
  495|   121k|                {
  496|   121k|                    if(i < ps_slice_hdr->i1_num_long_term_sps)
  ------------------
  |  Branch (496:24): [True: 1.07k, False: 120k]
  ------------------
  497|  1.07k|                    {
  498|       |                        /* Use CLZ to compute Ceil( Log2( num_long_term_ref_pics_sps ) ) */
  499|  1.07k|                        if (ps_sps->i1_num_long_term_ref_pics_sps > 1)
  ------------------
  |  Branch (499:29): [True: 676, False: 396]
  ------------------
  500|    676|                        {
  501|    676|                            WORD32 num_bits = 32 - CLZ(ps_sps->i1_num_long_term_ref_pics_sps - 1);
  502|    676|                            BITS_PARSE("lt_idx_sps[ i ]", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|    676|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  503|    676|                            if(value >= ps_sps->i1_num_long_term_ref_pics_sps)
  ------------------
  |  Branch (503:32): [True: 117, False: 559]
  ------------------
  504|    117|                            {
  505|    117|                                return IHEVCD_INVALID_PARAMETER;
  506|    117|                            }
  507|    676|                        }
  508|    396|                        else
  509|    396|                        {
  510|    396|                            value = 0;
  511|    396|                        }
  512|    955|                        ps_slice_hdr->ai4_poc_lsb_lt[i] = ps_sps->au2_lt_ref_pic_poc_lsb_sps[value];
  513|    955|                        ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i] = ps_sps->ai1_used_by_curr_pic_lt_sps_flag[value];
  514|       |
  515|    955|                    }
  516|   120k|                    else
  517|   120k|                    {
  518|   120k|                        BITS_PARSE("poc_lsb_lt[ i ]", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|   120k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  519|   120k|                        ps_slice_hdr->ai4_poc_lsb_lt[i] = value;
  520|       |
  521|   120k|                        BITS_PARSE("used_by_curr_pic_lt_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   120k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  522|   120k|                        ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i] = value;
  523|       |
  524|   120k|                    }
  525|   121k|                    BITS_PARSE("delta_poc_msb_present_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   121k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  526|   121k|                    ps_slice_hdr->ai1_delta_poc_msb_present_flag[i] = value;
  527|       |
  528|       |
  529|   121k|                    ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] = 0;
  530|   121k|                    if(ps_slice_hdr->ai1_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (530:24): [True: 16.0k, False: 105k]
  ------------------
  531|  16.0k|                    {
  532|       |
  533|  16.0k|                        UEV_PARSE("delata_poc_msb_cycle_lt[ i ]", value, ps_bitstrm);
  ------------------
  |  |  155|  16.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  534|  16.0k|                        ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] = value;
  535|  16.0k|                    }
  536|       |
  537|   121k|                    if((i != 0) && (i != ps_slice_hdr->i1_num_long_term_sps))
  ------------------
  |  Branch (537:24): [True: 109k, False: 12.3k]
  |  Branch (537:36): [True: 108k, False: 388]
  ------------------
  538|   108k|                    {
  539|   108k|                        ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] += ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i - 1];
  540|   108k|                    }
  541|       |
  542|   121k|                }
  543|  19.3k|            }
  544|       |
  545|   203k|            for(i = 0; i < num_neg_pics + num_pos_pics; i++)
  ------------------
  |  Branch (545:24): [True: 141k, False: 62.9k]
  ------------------
  546|   141k|            {
  547|   141k|                if(pi1_used[i])
  ------------------
  |  Branch (547:20): [True: 116k, False: 24.8k]
  ------------------
  548|   116k|                {
  549|   116k|                    num_poc_total_curr++;
  550|   116k|                }
  551|   141k|            }
  552|   184k|            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: 121k, False: 62.9k]
  ------------------
  553|   121k|            {
  554|   121k|                if(ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i])
  ------------------
  |  Branch (554:20): [True: 23.4k, False: 98.0k]
  ------------------
  555|  23.4k|                {
  556|  23.4k|                    num_poc_total_curr++;
  557|  23.4k|                }
  558|   121k|            }
  559|       |
  560|       |
  561|  62.9k|            if(ps_sps->i1_sps_temporal_mvp_enable_flag)
  ------------------
  |  Branch (561:16): [True: 28.9k, False: 33.9k]
  ------------------
  562|  28.9k|            {
  563|  28.9k|                BITS_PARSE("enable_temporal_mvp_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  28.9k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  564|  28.9k|                ps_slice_hdr->i1_slice_temporal_mvp_enable_flag = value;
  565|  28.9k|            }
  566|       |
  567|  62.9k|        }
  568|   122k|        ps_slice_hdr->i1_slice_sao_luma_flag = 0;
  569|   122k|        ps_slice_hdr->i1_slice_sao_chroma_flag = 0;
  570|   122k|        if(ps_sps->i1_sample_adaptive_offset_enabled_flag)
  ------------------
  |  Branch (570:12): [True: 88.9k, False: 33.4k]
  ------------------
  571|  88.9k|        {
  572|  88.9k|            BITS_PARSE("slice_sao_luma_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  88.9k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  573|  88.9k|            ps_slice_hdr->i1_slice_sao_luma_flag = value;
  574|       |
  575|  88.9k|            if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) {
  ------------------
  |  Branch (575:17): [True: 87.5k, False: 1.38k]
  ------------------
  576|  87.5k|                BITS_PARSE("slice_sao_chroma_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  87.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  577|  87.5k|                ps_slice_hdr->i1_slice_sao_chroma_flag = value;
  578|  87.5k|            }
  579|       |
  580|  88.9k|        }
  581|       |
  582|   122k|        ps_slice_hdr->i1_max_num_merge_cand = 1;
  583|   122k|        ps_slice_hdr->i1_cabac_init_flag = 0;
  584|       |
  585|   122k|        ps_slice_hdr->i1_num_ref_idx_l0_active = 0;
  586|   122k|        ps_slice_hdr->i1_num_ref_idx_l1_active = 0;
  587|   122k|        ps_slice_hdr->i1_slice_cb_qp_offset = 0;
  588|   122k|        ps_slice_hdr->i1_slice_cr_qp_offset = 0;
  589|   122k|        if((PSLICE == ps_slice_hdr->i1_slice_type) ||
  ------------------
  |  Branch (589:12): [True: 2.94k, False: 119k]
  ------------------
  590|   119k|           (BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (590:12): [True: 38.7k, False: 80.7k]
  ------------------
  591|  41.6k|        {
  592|  41.6k|            BITS_PARSE("num_ref_idx_active_override_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  41.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  593|  41.6k|            ps_slice_hdr->i1_num_ref_idx_active_override_flag = value;
  594|       |
  595|  41.6k|            if(ps_slice_hdr->i1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (595:16): [True: 20.4k, False: 21.2k]
  ------------------
  596|  20.4k|            {
  597|  20.4k|                UEV_PARSE("num_ref_idx_l0_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  20.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  598|  20.4k|                if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  291|  20.4k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (598:20): [True: 144, False: 20.2k]
  ------------------
  599|    144|                {
  600|    144|                    return IHEVCD_INVALID_PARAMETER;
  601|    144|                }
  602|  20.2k|                ps_slice_hdr->i1_num_ref_idx_l0_active = value + 1;
  603|       |
  604|  20.2k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (604:20): [True: 18.7k, False: 1.53k]
  ------------------
  605|  18.7k|                {
  606|  18.7k|                    UEV_PARSE("num_ref_idx_l1_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  18.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  607|  18.7k|                    if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  291|  18.7k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (607:24): [True: 212, False: 18.5k]
  ------------------
  608|    212|                    {
  609|    212|                        return IHEVCD_INVALID_PARAMETER;
  610|    212|                    }
  611|  18.5k|                    ps_slice_hdr->i1_num_ref_idx_l1_active = value + 1;
  612|  18.5k|                }
  613|       |
  614|  20.2k|            }
  615|  21.2k|            else
  616|  21.2k|            {
  617|  21.2k|                ps_slice_hdr->i1_num_ref_idx_l0_active = ps_pps->i1_num_ref_idx_l0_default_active;
  618|  21.2k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (618:20): [True: 19.8k, False: 1.40k]
  ------------------
  619|  19.8k|                {
  620|  19.8k|                    ps_slice_hdr->i1_num_ref_idx_l1_active = ps_pps->i1_num_ref_idx_l1_default_active;
  621|  19.8k|                }
  622|  21.2k|            }
  623|       |
  624|  41.3k|            if(0 == num_poc_total_curr)
  ------------------
  |  Branch (624:16): [True: 4.16k, False: 37.1k]
  ------------------
  625|  4.16k|                return IHEVCD_IGNORE_SLICE;
  626|  37.1k|            if((ps_pps->i1_lists_modification_present_flag) && (num_poc_total_curr > 1))
  ------------------
  |  Branch (626:16): [True: 20.8k, False: 16.3k]
  |  Branch (626:64): [True: 9.41k, False: 11.4k]
  ------------------
  627|  9.41k|            {
  628|  9.41k|                ihevcd_ref_pic_list_modification(ps_bitstrm,
  629|  9.41k|                                                 ps_slice_hdr, num_poc_total_curr);
  630|  9.41k|            }
  631|  27.7k|            else
  632|  27.7k|            {
  633|  27.7k|                ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l0 = 0;
  634|  27.7k|                ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l1 = 0;
  635|  27.7k|            }
  636|       |
  637|  37.1k|            if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (637:16): [True: 34.6k, False: 2.53k]
  ------------------
  638|  34.6k|            {
  639|  34.6k|                BITS_PARSE("mvd_l1_zero_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  34.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  640|  34.6k|                ps_slice_hdr->i1_mvd_l1_zero_flag = value;
  641|  34.6k|            }
  642|       |
  643|  37.1k|            ps_slice_hdr->i1_cabac_init_flag = 0;
  644|  37.1k|            if(ps_pps->i1_cabac_init_present_flag)
  ------------------
  |  Branch (644:16): [True: 26.0k, False: 11.1k]
  ------------------
  645|  26.0k|            {
  646|  26.0k|                BITS_PARSE("cabac_init_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  26.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  647|  26.0k|                ps_slice_hdr->i1_cabac_init_flag = value;
  648|       |
  649|  26.0k|            }
  650|  37.1k|            ps_slice_hdr->i1_collocated_from_l0_flag = 1;
  651|  37.1k|            ps_slice_hdr->i1_collocated_ref_idx = 0;
  652|  37.1k|            if(ps_slice_hdr->i1_slice_temporal_mvp_enable_flag)
  ------------------
  |  Branch (652:16): [True: 16.8k, False: 20.2k]
  ------------------
  653|  16.8k|            {
  654|  16.8k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (654:20): [True: 16.0k, False: 801]
  ------------------
  655|  16.0k|                {
  656|  16.0k|                    BITS_PARSE("collocated_from_l0_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  16.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  657|  16.0k|                    ps_slice_hdr->i1_collocated_from_l0_flag = value;
  658|  16.0k|                }
  659|       |
  660|  16.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.43k, False: 7.43k]
  |  Branch (660:67): [True: 4.56k, False: 4.87k]
  ------------------
  661|  12.3k|                   (!ps_slice_hdr->i1_collocated_from_l0_flag  && (ps_slice_hdr->i1_num_ref_idx_l1_active > 1)))
  ------------------
  |  Branch (661:21): [True: 7.43k, False: 4.87k]
  |  Branch (661:67): [True: 5.61k, False: 1.81k]
  ------------------
  662|  10.1k|                {
  663|  10.1k|                    UEV_PARSE("collocated_ref_idx", value, ps_bitstrm);
  ------------------
  |  |  155|  10.1k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  664|  10.1k|                    if((PSLICE == ps_slice_hdr->i1_slice_type || BSLICE == ps_slice_hdr->i1_slice_type) &&
  ------------------
  |  Branch (664:25): [True: 433, False: 9.74k]
  |  Branch (664:66): [True: 9.74k, False: 0]
  ------------------
  665|  10.1k|                                    ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (665:37): [True: 4.56k, False: 5.61k]
  ------------------
  666|  4.56k|                    {
  667|  4.56k|                        if(value >= ps_slice_hdr->i1_num_ref_idx_l0_active)
  ------------------
  |  Branch (667:28): [True: 332, False: 4.23k]
  ------------------
  668|    332|                        {
  669|    332|                            return IHEVCD_INVALID_PARAMETER;
  670|    332|                        }
  671|  4.56k|                    }
  672|  9.84k|                    if(BSLICE == ps_slice_hdr->i1_slice_type && !ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (672:24): [True: 9.48k, False: 360]
  |  Branch (672:65): [True: 5.61k, False: 3.87k]
  ------------------
  673|  5.61k|                    {
  674|  5.61k|                        if(value >= ps_slice_hdr->i1_num_ref_idx_l1_active)
  ------------------
  |  Branch (674:28): [True: 141, False: 5.47k]
  ------------------
  675|    141|                        {
  676|    141|                            return IHEVCD_INVALID_PARAMETER;
  677|    141|                        }
  678|  5.61k|                    }
  679|  9.70k|                    ps_slice_hdr->i1_collocated_ref_idx = value;
  680|  9.70k|                }
  681|       |
  682|  16.8k|            }
  683|       |
  684|  36.6k|            if((ps_pps->i1_weighted_pred_flag  &&   (PSLICE == ps_slice_hdr->i1_slice_type)) ||
  ------------------
  |  Branch (684:17): [True: 21.1k, False: 15.5k]
  |  Branch (684:53): [True: 1.57k, False: 19.5k]
  ------------------
  685|  35.1k|               (ps_pps->i1_weighted_bipred_flag  &&  (BSLICE == ps_slice_hdr->i1_slice_type)))
  ------------------
  |  Branch (685:17): [True: 15.9k, False: 19.1k]
  |  Branch (685:54): [True: 15.3k, False: 650]
  ------------------
  686|  16.8k|            {
  687|  16.8k|                ihevcd_parse_pred_wt_ofst(ps_bitstrm, ps_sps, ps_pps, ps_slice_hdr);
  688|  16.8k|            }
  689|  36.6k|            UEV_PARSE("five_minus_max_num_merge_cand", value, ps_bitstrm);
  ------------------
  |  |  155|  36.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  690|  36.6k|            if(value > 4)
  ------------------
  |  Branch (690:16): [True: 3.32k, False: 33.3k]
  ------------------
  691|  3.32k|            {
  692|  3.32k|                return IHEVCD_INVALID_PARAMETER;
  693|  3.32k|            }
  694|  33.3k|            ps_slice_hdr->i1_max_num_merge_cand = 5 - value;
  695|       |
  696|  33.3k|        }
  697|   114k|        SEV_PARSE("slice_qp_delta", i4_value, ps_bitstrm);
  ------------------
  |  |  162|   114k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  698|   114k|        if((i4_value < (MIN_HEVC_QP - ps_pps->i1_pic_init_qp - (6 * ps_sps->i1_bit_depth_luma_minus8))) ||
  ------------------
  |  |  471|   114k|#define MIN_HEVC_QP 0
  ------------------
  |  Branch (698:12): [True: 202, False: 113k]
  ------------------
  699|   113k|           (i4_value > (MAX_HEVC_QP - ps_pps->i1_pic_init_qp)))
  ------------------
  |  |  476|   113k|#define MAX_HEVC_QP 51  //FOR MAIN Branch Encoder
  ------------------
  |  Branch (699:12): [True: 726, False: 113k]
  ------------------
  700|    928|        {
  701|    928|            return IHEVCD_INVALID_PARAMETER;
  702|    928|        }
  703|   113k|        ps_slice_hdr->i1_slice_qp_delta = i4_value;
  704|       |
  705|   113k|        if(ps_pps->i1_pic_slice_level_chroma_qp_offsets_present_flag)
  ------------------
  |  Branch (705:12): [True: 50.0k, False: 63.1k]
  ------------------
  706|  50.0k|        {
  707|  50.0k|            SEV_PARSE("slice_cb_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  50.0k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  708|  50.0k|            if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (708:16): [True: 154, False: 49.8k]
  |  Branch (708:34): [True: 352, False: 49.5k]
  ------------------
  709|    506|            {
  710|    506|                return IHEVCD_INVALID_PARAMETER;
  711|    506|            }
  712|  49.5k|            ps_slice_hdr->i1_slice_cb_qp_offset = i4_value;
  713|       |
  714|  49.5k|            SEV_PARSE("slice_cr_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  49.5k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  715|  49.5k|            if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (715:16): [True: 114, False: 49.3k]
  |  Branch (715:34): [True: 346, False: 49.0k]
  ------------------
  716|    460|            {
  717|    460|                return IHEVCD_INVALID_PARAMETER;
  718|    460|            }
  719|  49.0k|            ps_slice_hdr->i1_slice_cr_qp_offset = i4_value;
  720|       |
  721|  49.0k|        }
  722|   112k|#ifdef ENABLE_MAIN_REXT_PROFILE
  723|   112k|        ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag = 0;
  724|   112k|        if(ps_pps->i1_chroma_qp_offset_list_enabled_flag)
  ------------------
  |  Branch (724:12): [True: 9.64k, False: 102k]
  ------------------
  725|  9.64k|        {
  726|  9.64k|            BITS_PARSE("cu_chroma_qp_offset_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  9.64k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  727|  9.64k|            ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag = value;
  728|  9.64k|        }
  729|   112k|#endif
  730|   112k|        ps_slice_hdr->i1_deblocking_filter_override_flag = 0;
  731|   112k|        ps_slice_hdr->i1_slice_disable_deblocking_filter_flag  = ps_pps->i1_pic_disable_deblocking_filter_flag;
  732|   112k|        ps_slice_hdr->i1_beta_offset_div2 = ps_pps->i1_beta_offset_div2;
  733|   112k|        ps_slice_hdr->i1_tc_offset_div2 = ps_pps->i1_tc_offset_div2;
  734|       |
  735|   112k|        disable_deblocking_filter_flag = ps_pps->i1_pic_disable_deblocking_filter_flag;
  736|       |
  737|   112k|        if(ps_pps->i1_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (737:12): [True: 19.3k, False: 92.8k]
  ------------------
  738|  19.3k|        {
  739|       |
  740|  19.3k|            if(ps_pps->i1_deblocking_filter_override_enabled_flag)
  ------------------
  |  Branch (740:16): [True: 8.60k, False: 10.7k]
  ------------------
  741|  8.60k|            {
  742|  8.60k|                BITS_PARSE("deblocking_filter_override_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.60k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  743|  8.60k|                ps_slice_hdr->i1_deblocking_filter_override_flag = value;
  744|  8.60k|            }
  745|       |
  746|  19.3k|            if(ps_slice_hdr->i1_deblocking_filter_override_flag)
  ------------------
  |  Branch (746:16): [True: 4.00k, False: 15.3k]
  ------------------
  747|  4.00k|            {
  748|  4.00k|                BITS_PARSE("slice_disable_deblocking_filter_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.00k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  749|  4.00k|                ps_slice_hdr->i1_slice_disable_deblocking_filter_flag = value;
  750|  4.00k|                disable_deblocking_filter_flag = ps_slice_hdr->i1_slice_disable_deblocking_filter_flag;
  751|       |
  752|  4.00k|                if(!ps_slice_hdr->i1_slice_disable_deblocking_filter_flag)
  ------------------
  |  Branch (752:20): [True: 1.29k, False: 2.71k]
  ------------------
  753|  1.29k|                {
  754|  1.29k|                    SEV_PARSE("beta_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  1.29k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  755|  1.29k|                    if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (755:24): [True: 97, False: 1.19k]
  |  Branch (755:41): [True: 214, False: 979]
  ------------------
  756|    311|                    {
  757|    311|                        return IHEVCD_INVALID_PARAMETER;
  758|    311|                    }
  759|    979|                    ps_slice_hdr->i1_beta_offset_div2 = i4_value;
  760|       |
  761|    979|                    SEV_PARSE("tc_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|    979|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  762|    979|                    if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (762:24): [True: 88, False: 891]
  |  Branch (762:41): [True: 165, False: 726]
  ------------------
  763|    253|                    {
  764|    253|                        return IHEVCD_INVALID_PARAMETER;
  765|    253|                    }
  766|    726|                    ps_slice_hdr->i1_tc_offset_div2 = i4_value;
  767|       |
  768|    726|                }
  769|  4.00k|            }
  770|  19.3k|        }
  771|       |
  772|   111k|        ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag = ps_pps->i1_loop_filter_across_slices_enabled_flag;
  773|   111k|        if(ps_pps->i1_loop_filter_across_slices_enabled_flag  &&
  ------------------
  |  Branch (773:12): [True: 42.7k, False: 68.9k]
  ------------------
  774|  42.7k|                        (ps_slice_hdr->i1_slice_sao_luma_flag  ||  ps_slice_hdr->i1_slice_sao_chroma_flag  || !disable_deblocking_filter_flag))
  ------------------
  |  Branch (774:26): [True: 18.8k, False: 23.9k]
  |  Branch (774:68): [True: 4.37k, False: 19.5k]
  |  Branch (774:111): [True: 16.8k, False: 2.68k]
  ------------------
  775|  40.0k|        {
  776|  40.0k|            BITS_PARSE("slice_loop_filter_across_slices_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  40.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  777|  40.0k|            ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag = value;
  778|  40.0k|        }
  779|       |
  780|   111k|    }
  781|       |
  782|       |    /* Check sanity of slice */
  783|   123k|    if((!first_slice_in_pic_flag) &&
  ------------------
  |  Branch (783:8): [True: 30.3k, False: 92.7k]
  ------------------
  784|  30.3k|                    (ps_codec->i4_pic_present))
  ------------------
  |  Branch (784:21): [True: 20.0k, False: 10.2k]
  ------------------
  785|  20.0k|    {
  786|  20.0k|        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|  20.0k|        if((ps_slice_hdr_base->i1_pps_id != ps_slice_hdr->i1_pps_id) ||
  ------------------
  |  Branch (791:12): [True: 1.06k, 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: 675, False: 18.2k]
  ------------------
  793|  1.73k|        {
  794|  1.73k|            return IHEVCD_IGNORE_SLICE;
  795|  1.73k|        }
  796|       |
  797|  20.0k|    }
  798|       |
  799|       |
  800|   121k|    if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (800:8): [True: 103k, False: 18.2k]
  ------------------
  801|   103k|    {
  802|   103k|        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|   103k|    }
  804|  18.2k|    else
  805|  18.2k|    {
  806|  18.2k|        ps_slice_hdr->i4_abs_pic_order_cnt = ps_codec->s_parse.i4_abs_pic_order_cnt;
  807|  18.2k|    }
  808|       |
  809|       |
  810|   121k|    if(!first_slice_in_pic_flag)
  ------------------
  |  Branch (810:8): [True: 28.5k, False: 92.7k]
  ------------------
  811|  28.5k|    {
  812|       |        /* Check if the current slice belongs to the same pic (Pic being parsed) */
  813|  28.5k|        if(ps_codec->s_parse.i4_abs_pic_order_cnt == ps_slice_hdr->i4_abs_pic_order_cnt)
  ------------------
  |  Branch (813:12): [True: 20.4k, False: 8.10k]
  ------------------
  814|  20.4k|        {
  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|  20.4k|            if(slice_address > ps_codec->s_parse.i4_next_ctb_indx)
  ------------------
  |  Branch (819:16): [True: 799, False: 19.6k]
  ------------------
  820|    799|            {
  821|    799|                if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (821:20): [True: 704, False: 95]
  ------------------
  822|    704|                {
  823|    704|                    prev_slice_incomplete_flag = 1;
  824|    704|                    ps_codec->i4_slice_error = 1;
  825|    704|                    ps_codec->s_parse.i4_cur_slice_idx--;
  826|    704|                    if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (826:24): [True: 0, False: 704]
  ------------------
  827|      0|                        ps_codec->s_parse.i4_cur_slice_idx = 0;
  828|    704|                }
  829|    799|                return IHEVCD_IGNORE_SLICE;
  830|    799|            }
  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|  19.6k|            else if(slice_address < ps_codec->s_parse.i4_next_ctb_indx)
  ------------------
  |  Branch (834:21): [True: 3.82k, False: 15.8k]
  ------------------
  835|  3.82k|            {
  836|  3.82k|                return IHEVCD_IGNORE_SLICE;
  837|  3.82k|            }
  838|  15.8k|            else
  839|  15.8k|            {
  840|  15.8k|                ps_codec->i4_slice_error = 0;
  841|  15.8k|            }
  842|  20.4k|        }
  843|       |
  844|       |        /* The current slice does not belong to the pic that is being parsed */
  845|  8.10k|        else
  846|  8.10k|        {
  847|       |            /* The previous pic is incomplete.
  848|       |             * Treat the remaining CTBs as skip */
  849|  8.10k|            if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (849:16): [True: 0, False: 8.10k]
  ------------------
  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|  8.10k|            else
  867|  8.10k|            {
  868|  8.10k|                if(ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (868:20): [True: 0, False: 8.10k]
  ------------------
  869|      0|                    return IHEVCD_IGNORE_SLICE;
  870|       |
  871|  8.10k|                ps_codec->s_parse.i4_abs_pic_order_cnt = ps_slice_hdr->i4_abs_pic_order_cnt;
  872|  8.10k|            }
  873|  8.10k|        }
  874|  28.5k|    }
  875|       |
  876|       |    /* If the slice is the first slice in the pic, update the parse context's POC */
  877|  92.7k|    else
  878|  92.7k|    {
  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.7k|        if(ps_codec->s_parse.i4_abs_pic_order_cnt == ps_slice_hdr->i4_abs_pic_order_cnt)
  ------------------
  |  Branch (882:12): [True: 21.3k, False: 71.4k]
  ------------------
  883|  21.3k|            return IHEVCD_IGNORE_SLICE;
  884|       |
  885|  71.4k|        ps_codec->s_parse.i4_abs_pic_order_cnt = ps_slice_hdr->i4_abs_pic_order_cnt;
  886|  71.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|  95.3k|    ps_slice_hdr->i4_num_entry_point_offsets = 0;
  891|  95.3k|    if((ps_pps->i1_tiles_enabled_flag) ||
  ------------------
  |  Branch (891:8): [True: 17.0k, False: 78.3k]
  ------------------
  892|  78.3k|       (ps_pps->i1_entropy_coding_sync_enabled_flag))
  ------------------
  |  Branch (892:8): [True: 5.94k, False: 72.3k]
  ------------------
  893|  22.9k|    {
  894|  22.9k|        UEV_PARSE("num_entry_point_offsets", value, ps_bitstrm);
  ------------------
  |  |  155|  22.9k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  895|  22.9k|        ps_slice_hdr->i4_num_entry_point_offsets = value;
  896|       |
  897|  22.9k|        {
  898|  22.9k|            WORD32 max_num_entry_point_offsets;
  899|  22.9k|            if((ps_pps->i1_tiles_enabled_flag) &&
  ------------------
  |  Branch (899:16): [True: 17.0k, False: 5.94k]
  ------------------
  900|  17.0k|                            (ps_pps->i1_entropy_coding_sync_enabled_flag))
  ------------------
  |  Branch (900:29): [True: 7.12k, False: 9.90k]
  ------------------
  901|  7.12k|            {
  902|  7.12k|                max_num_entry_point_offsets = ps_pps->i1_num_tile_columns * ps_sps->i2_pic_ht_in_ctb - 1;
  903|  7.12k|            }
  904|  15.8k|            else if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (904:21): [True: 9.90k, False: 5.94k]
  ------------------
  905|  9.90k|            {
  906|  9.90k|                max_num_entry_point_offsets = ps_pps->i1_num_tile_columns * ps_pps->i1_num_tile_rows - 1 ;
  907|  9.90k|            }
  908|  5.94k|            else
  909|  5.94k|            {
  910|  5.94k|                max_num_entry_point_offsets = (ps_sps->i2_pic_ht_in_ctb - 1);
  911|  5.94k|            }
  912|       |
  913|  22.9k|            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: 90, False: 22.8k]
  |  Branch (913:64): [True: 723, False: 22.1k]
  ------------------
  914|    813|            {
  915|    813|                return IHEVCD_INVALID_PARAMETER;
  916|    813|            }
  917|  22.9k|        }
  918|       |
  919|  22.1k|        if(ps_slice_hdr->i4_num_entry_point_offsets > 0)
  ------------------
  |  Branch (919:12): [True: 4.44k, False: 17.7k]
  ------------------
  920|  4.44k|        {
  921|  4.44k|            UEV_PARSE("offset_len_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  4.44k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  922|  4.44k|            if(value > 31)
  ------------------
  |  Branch (922:16): [True: 214, False: 4.23k]
  ------------------
  923|    214|            {
  924|    214|                return IHEVCD_INVALID_PARAMETER;
  925|    214|            }
  926|  4.23k|            ps_slice_hdr->i1_offset_len = value + 1;
  927|       |
  928|  15.8k|            for(i = 0; i < ps_slice_hdr->i4_num_entry_point_offsets; i++)
  ------------------
  |  Branch (928:24): [True: 11.6k, False: 4.23k]
  ------------------
  929|  11.6k|            {
  930|  11.6k|                BITS_PARSE("entry_point_offset", value, ps_bitstrm, ps_slice_hdr->i1_offset_len);
  ------------------
  |  |  148|  11.6k|    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.6k|            }
  935|       |
  936|  4.23k|        }
  937|  22.1k|    }
  938|       |
  939|  94.3k|    if(ps_pps->i1_slice_header_extension_present_flag)
  ------------------
  |  Branch (939:8): [True: 10.4k, False: 83.8k]
  ------------------
  940|  10.4k|    {
  941|  10.4k|        UEV_PARSE("slice_header_extension_length", value, ps_bitstrm);
  ------------------
  |  |  155|  10.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  942|  10.4k|        if(value > 256)
  ------------------
  |  Branch (942:12): [True: 450, False: 10.0k]
  ------------------
  943|    450|        {
  944|    450|            return IHEVCD_INVALID_PARAMETER;
  945|    450|        }
  946|  10.0k|        ps_slice_hdr->i2_slice_header_extension_length = value;
  947|       |
  948|       |
  949|  33.1k|        for(i = 0; i < ps_slice_hdr->i2_slice_header_extension_length; i++)
  ------------------
  |  Branch (949:20): [True: 23.1k, False: 10.0k]
  ------------------
  950|  23.1k|        {
  951|  23.1k|            BITS_PARSE("slice_header_extension_data_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  23.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  952|  23.1k|        }
  953|       |
  954|  10.0k|    }
  955|       |
  956|  93.8k|    ihevcd_bits_flush_to_byte_boundary(ps_bitstrm);
  957|       |
  958|  93.8k|    if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max)
  ------------------
  |  Branch (958:8): [True: 2.73k, False: 91.1k]
  ------------------
  959|  2.73k|        return IHEVCD_INVALID_PARAMETER;
  960|       |
  961|  91.1k|    {
  962|  91.1k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
  963|  91.1k|        WORD32 r_idx;
  964|       |
  965|  91.1k|        if((NAL_IDR_W_LP == ps_slice_hdr->i1_nal_unit_type) ||
  ------------------
  |  Branch (965:12): [True: 16.0k, False: 75.0k]
  ------------------
  966|  75.0k|                        (NAL_IDR_N_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (966:25): [True: 36.4k, False: 38.6k]
  ------------------
  967|  38.6k|                        (NAL_BLA_N_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (967:25): [True: 1.13k, False: 37.5k]
  ------------------
  968|  37.5k|                        (NAL_BLA_W_DLP == ps_slice_hdr->i1_nal_unit_type) ||
  ------------------
  |  Branch (968:25): [True: 1.78k, False: 35.7k]
  ------------------
  969|  35.7k|                        (NAL_BLA_W_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (969:25): [True: 1.30k, False: 34.4k]
  ------------------
  970|  34.4k|                        (0 == ps_codec->u4_pic_cnt))
  ------------------
  |  Branch (970:25): [True: 11.4k, False: 23.0k]
  ------------------
  971|  68.1k|        {
  972|  4.42M|            for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  4.42M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  4.42M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (972:24): [True: 4.35M, False: 68.1k]
  ------------------
  973|  4.35M|            {
  974|  4.35M|                if(ps_dpb_mgr->as_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (974:20): [True: 41.8k, False: 4.31M]
  ------------------
  975|  41.8k|                {
  976|  41.8k|                    pic_buf_t *ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  977|  41.8k|                    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|  41.8k|                    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|  41.8k|                    ps_mv_buf = (mv_buf_t *)ps_codec->ps_mv_buf;
  983|  42.7k|                    for(j = 0; j < ps_codec->i4_max_dpb_size; j++)
  ------------------
  |  Branch (983:32): [True: 42.7k, False: 0]
  ------------------
  984|  42.7k|                    {
  985|  42.7k|                        if(ps_mv_buf && ps_mv_buf->i4_abs_poc == ps_pic_buf->i4_abs_poc)
  ------------------
  |  Branch (985:28): [True: 42.7k, False: 0]
  |  Branch (985:41): [True: 41.8k, False: 856]
  ------------------
  986|  41.8k|                        {
  987|  41.8k|                            ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   40|  41.8k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  988|  41.8k|                            break;
  989|  41.8k|                        }
  990|    856|                        ps_mv_buf++;
  991|    856|                    }
  992|       |
  993|  41.8k|                }
  994|       |
  995|  4.35M|            }
  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.15M|            for(r_idx = 0; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|  1.15M|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1001:28): [True: 1.08M, False: 68.1k]
  ------------------
 1002|  1.08M|            {
 1003|  1.08M|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = NULL;
 1004|  1.08M|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = NULL;
 1005|       |
 1006|  1.08M|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = NULL;
 1007|  1.08M|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = NULL;
 1008|  1.08M|            }
 1009|       |
 1010|  68.1k|        }
 1011|  23.0k|        else
 1012|  23.0k|        {
 1013|  23.0k|            ret = ihevcd_ref_list(ps_codec, ps_pps, ps_sps, ps_slice_hdr);
 1014|  23.0k|            if ((WORD32)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1014:17): [True: 1.18k, False: 21.8k]
  ------------------
 1015|  1.18k|            {
 1016|  1.18k|                return ret;
 1017|  1.18k|            }
 1018|       |
 1019|  23.0k|        }
 1020|       |
 1021|  91.1k|    }
 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|  89.9k|    if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (1025:8): [True: 15.8k, False: 74.1k]
  ------------------
 1026|  15.8k|    {
 1027|  15.8k|        pic_buf_t *ps_pic_buf_ref;
 1028|  15.8k|        mv_buf_t *ps_mv_buf_ref;
 1029|  15.8k|        WORD32 r_idx;
 1030|  15.8k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
 1031|  15.8k|        buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
 1032|       |
 1033|  15.8k|        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.8k|        if(NULL == ps_pic_buf_ref)
  ------------------
  |  Branch (1034:12): [True: 8.71k, False: 7.11k]
  ------------------
 1035|  8.71k|        {
 1036|  8.71k|            ps_pic_buf_ref = ps_codec->as_process[0].ps_cur_pic;
 1037|  8.71k|            ps_mv_buf_ref = ps_codec->s_parse.ps_cur_mv_buf;
 1038|  8.71k|        }
 1039|  7.11k|        else
 1040|  7.11k|        {
 1041|  7.11k|            ps_mv_buf_ref = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf_ref->i4_abs_poc);
 1042|  7.11k|        }
 1043|       |
 1044|  32.3k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (1044:24): [True: 16.5k, False: 15.8k]
  ------------------
 1045|  16.5k|        {
 1046|  16.5k|            if(NULL == ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1046:16): [True: 3.83k, False: 12.7k]
  ------------------
 1047|  3.83k|            {
 1048|  3.83k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1049|  3.83k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1050|  3.83k|            }
 1051|  16.5k|        }
 1052|       |
 1053|   252k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|   252k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1053:61): [True: 236k, False: 15.8k]
  ------------------
 1054|   236k|        {
 1055|   236k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1056|   236k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1057|   236k|        }
 1058|       |
 1059|  31.8k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (1059:24): [True: 16.0k, False: 15.8k]
  ------------------
 1060|  16.0k|        {
 1061|  16.0k|            if(NULL == ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1061:16): [True: 4.29k, False: 11.7k]
  ------------------
 1062|  4.29k|            {
 1063|  4.29k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1064|  4.29k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1065|  4.29k|            }
 1066|  16.0k|        }
 1067|       |
 1068|   252k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|   252k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1068:61): [True: 237k, False: 15.8k]
  ------------------
 1069|   237k|        {
 1070|   237k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1071|   237k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1072|   237k|        }
 1073|  15.8k|    }
 1074|       |
 1075|       |    /* Update slice address in the header */
 1076|  89.9k|    if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1076:8): [True: 23.2k, False: 66.7k]
  ------------------
 1077|  23.2k|    {
 1078|  23.2k|        ps_slice_hdr->i2_ctb_x = slice_address % ps_sps->i2_pic_wd_in_ctb;
 1079|  23.2k|        ps_slice_hdr->i2_ctb_y = slice_address / ps_sps->i2_pic_wd_in_ctb;
 1080|       |
 1081|  23.2k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (1081:12): [True: 13.9k, False: 9.32k]
  ------------------
 1082|  13.9k|        {
 1083|  13.9k|            ps_slice_hdr->i2_independent_ctb_x = ps_slice_hdr->i2_ctb_x;
 1084|  13.9k|            ps_slice_hdr->i2_independent_ctb_y = ps_slice_hdr->i2_ctb_y;
 1085|  13.9k|        }
 1086|  23.2k|    }
 1087|  66.7k|    else
 1088|  66.7k|    {
 1089|  66.7k|        ps_slice_hdr->i2_ctb_x = 0;
 1090|  66.7k|        ps_slice_hdr->i2_ctb_y = 0;
 1091|       |
 1092|  66.7k|        ps_slice_hdr->i2_independent_ctb_x = 0;
 1093|  66.7k|        ps_slice_hdr->i2_independent_ctb_y = 0;
 1094|  66.7k|    }
 1095|       |
 1096|       |    /* If the first slice in the pic is missing, copy the current slice header to
 1097|       |     * the first slice's header */
 1098|  89.9k|    if((!first_slice_in_pic_flag) &&
  ------------------
  |  Branch (1098:8): [True: 23.2k, False: 66.7k]
  ------------------
 1099|  23.2k|                    (0 == ps_codec->i4_pic_present))
  ------------------
  |  Branch (1099:21): [True: 7.41k, False: 15.8k]
  ------------------
 1100|  7.41k|    {
 1101|  7.41k|        slice_header_t *ps_slice_hdr_prev = ps_codec->s_parse.ps_slice_hdr_base;
 1102|  7.41k|        ihevcd_copy_slice_hdr(ps_codec, 0, (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1)));
  ------------------
  |  |  153|  7.41k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  7.41k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1103|       |
 1104|  7.41k|        prev_slice_incomplete_flag = 1;
 1105|  7.41k|        ASSERT(ps_codec->s_parse.i4_cur_slice_idx == 1);
  ------------------
  |  |   55|  7.41k|#define ASSERT(x) {}
  ------------------
 1106|       |
 1107|  7.41k|        ps_slice_hdr_prev->i2_ctb_x = 0;
 1108|  7.41k|        ps_slice_hdr_prev->i2_ctb_y = 0;
 1109|       |
 1110|  7.41k|        ps_codec->s_parse.i4_ctb_x = 0;
 1111|  7.41k|        ps_codec->s_parse.i4_ctb_y = 0;
 1112|       |
 1113|  7.41k|        ps_codec->s_parse.i4_cur_slice_idx = 0;
 1114|       |
 1115|  7.41k|        if((ps_slice_hdr->i2_ctb_x == 0) &&
  ------------------
  |  Branch (1115:12): [True: 1.49k, False: 5.92k]
  ------------------
 1116|  1.49k|                        (ps_slice_hdr->i2_ctb_y == 0))
  ------------------
  |  Branch (1116:25): [True: 0, False: 1.49k]
  ------------------
 1117|      0|        {
 1118|      0|            ps_slice_hdr->i2_ctb_x++;
 1119|      0|        }
 1120|  7.41k|    }
 1121|       |
 1122|  89.9k|    {
 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|  89.9k|        if((i1_nal_unit_type < NAL_BLA_W_LP) &&
  ------------------
  |  Branch (1128:12): [True: 31.8k, False: 58.1k]
  ------------------
 1129|  31.8k|                        (i1_nal_unit_type % 2 == 0))
  ------------------
  |  Branch (1129:25): [True: 25.5k, False: 6.22k]
  ------------------
 1130|  25.5k|        {
 1131|  25.5k|            if(IVD_SKIP_B == ps_codec->e_pic_skip_mode)
  ------------------
  |  Branch (1131:16): [True: 0, False: 25.5k]
  ------------------
 1132|      0|                return IHEVCD_IGNORE_SLICE;
 1133|  25.5k|        }
 1134|       |
 1135|       |        /* If skip PB is enabled,
 1136|       |         * decode only I slices */
 1137|  89.9k|        if((IVD_SKIP_PB == ps_codec->e_pic_skip_mode) &&
  ------------------
  |  Branch (1137:12): [True: 0, False: 89.9k]
  ------------------
 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|       |
 1143|  89.9k|        if(ps_codec->u4_thumbnail_mode && (ps_codec->u4_pic_cnt >= 1))
  ------------------
  |  Branch (1143:12): [True: 0, False: 89.9k]
  |  Branch (1143:43): [True: 0, False: 0]
  ------------------
 1144|      0|        {
 1145|      0|            return IHEVCD_IGNORE_SLICE;
 1146|      0|        }
 1147|  89.9k|    }
 1148|       |
 1149|  89.9k|    if(prev_slice_incomplete_flag)
  ------------------
  |  Branch (1149:8): [True: 7.41k, False: 82.5k]
  ------------------
 1150|  7.41k|    {
 1151|  7.41k|        ps_codec->i4_slice_error = 1;
 1152|  7.41k|        ps_codec->s_parse.i4_cur_slice_idx--;
 1153|  7.41k|        if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (1153:12): [True: 7.41k, False: 0]
  ------------------
 1154|  7.41k|            ps_codec->s_parse.i4_cur_slice_idx = 0;
 1155|  7.41k|    }
 1156|       |
 1157|  89.9k|    return ret;
 1158|  89.9k|}

ihevcd_proc_map_check:
  110|  92.6M|{
  111|  92.6M|    tile_t *ps_tile = ps_proc->ps_tile;
  112|  92.6M|    sps_t *ps_sps = ps_proc->ps_sps;
  113|  92.6M|    pps_t *ps_pps = ps_proc->ps_pps;
  114|  92.6M|    codec_t *ps_codec = ps_proc->ps_codec;
  115|  92.6M|    WORD32 idx;
  116|  92.6M|    WORD32 nop_cnt;
  117|  92.6M|    WORD32 bit_pos = proc_type;
  118|  92.6M|    WORD32 bit_mask = (1 << bit_pos);
  119|       |
  120|  92.6M|    if(ps_proc->i4_check_proc_status)
  ------------------
  |  Branch (120:8): [True: 51.0M, False: 41.5M]
  ------------------
  121|  51.0M|    {
  122|  51.0M|        nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|  51.0M|#define PROC_NOP_CNT (8 * 128)
  ------------------
  123|   197M|        while(1)
  ------------------
  |  Branch (123:15): [True: 196M, Folded]
  ------------------
  124|   196M|        {
  125|   196M|            volatile UWORD8 *pu1_buf;
  126|   196M|            volatile WORD32 status;
  127|   196M|            status = 1;
  128|       |            /* Check if all dependencies for the next nCTBs are met */
  129|   196M|            {
  130|   196M|                WORD32 x_pos;
  131|       |
  132|   196M|                {
  133|       |                    /* Check if the top right of next nCTBs are processed */
  134|   196M|                    if(ps_proc->i4_ctb_y > 0)
  ------------------
  |  Branch (134:24): [True: 193M, False: 3.08M]
  ------------------
  135|   193M|                    {
  136|   193M|                        x_pos = (ps_proc->i4_ctb_tile_x + nctb);
  137|   193M|                        idx = MIN(x_pos, (ps_tile->u2_wd - 1));
  ------------------
  |  |   43|   193M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 168M, False: 25.0M]
  |  |  ------------------
  ------------------
  138|       |
  139|       |                        /* Check if top-right CTB for the last CTB in nCTB is within the tile */
  140|   193M|                        {
  141|   193M|                            idx += ps_tile->u1_pos_x;
  142|   193M|                            idx += ((ps_proc->i4_ctb_y - 1)
  143|   193M|                                            * ps_sps->i2_pic_wd_in_ctb);
  144|   193M|                            pu1_buf = (ps_codec->pu1_proc_map + idx);
  145|   193M|                            status = *pu1_buf & bit_mask;
  146|   193M|                        }
  147|   193M|                    }
  148|   196M|                }
  149|       |
  150|       |                /* If tiles are enabled, then test left and top-left as well */
  151|   196M|                ps_pps = ps_proc->ps_pps;
  152|   196M|                if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (152:20): [True: 42.4M, False: 154M]
  ------------------
  153|  42.4M|                {
  154|       |                    /*Check if left ctb is processed*/
  155|  42.4M|                    if((ps_proc->i4_ctb_x > 0) && ((0 != status)))
  ------------------
  |  Branch (155:24): [True: 38.1M, False: 4.29M]
  |  Branch (155:51): [True: 19.1M, False: 19.0M]
  ------------------
  156|  19.1M|                    {
  157|  19.1M|                        x_pos   = ps_tile->u1_pos_x + ps_proc->i4_ctb_tile_x - 1;
  158|  19.1M|                        idx     = x_pos + (ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  159|  19.1M|                        pu1_buf = (ps_codec->pu1_proc_map + idx);
  160|  19.1M|                        status  = *pu1_buf & bit_mask;
  161|  19.1M|                    }
  162|       |
  163|       |                    /*Check if top left ctb is processed*/
  164|  42.4M|                    if((ps_proc->i4_ctb_x > 0) && (0 != status) && (ps_proc->i4_ctb_y > 0))
  ------------------
  |  Branch (164:24): [True: 38.2M, False: 4.24M]
  |  Branch (164:51): [True: 17.9M, False: 20.2M]
  |  Branch (164:68): [True: 17.5M, False: 365k]
  ------------------
  165|  17.5M|                    {
  166|  17.5M|                        x_pos   = ps_tile->u1_pos_x + ps_proc->i4_ctb_tile_x - 1;
  167|  17.5M|                        idx     = x_pos + ((ps_proc->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  168|  17.5M|                        pu1_buf = (ps_codec->pu1_proc_map + idx);
  169|  17.5M|                        status  = *pu1_buf & bit_mask;
  170|  17.5M|                    }
  171|  42.4M|                }
  172|   196M|            }
  173|       |
  174|   196M|            if(status)
  ------------------
  |  Branch (174:16): [True: 50.1M, False: 146M]
  ------------------
  175|  50.1M|                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|   146M|            if(nop_cnt > 0)
  ------------------
  |  Branch (180:16): [True: 129M, False: 17.3M]
  ------------------
  181|   129M|            {
  182|   129M|                NOP(128);
  ------------------
  |  |   68|  16.0G|#define NOP(nop_cnt)    {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (68:57): [True: 15.8G, False: 129M]
  |  |  ------------------
  ------------------
  183|   129M|                nop_cnt -= 128;
  184|   129M|            }
  185|  17.3M|            else
  186|  17.3M|            {
  187|  17.3M|                nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|  17.3M|#define PROC_NOP_CNT (8 * 128)
  ------------------
  188|  17.3M|                ithread_yield();
  189|       |                //NOP(128 * 16);
  190|  17.3M|            }
  191|   146M|        }
  192|  51.0M|        DATA_SYNC();
  ------------------
  |  |  100|  51.0M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  193|  51.0M|    }
  194|  92.6M|}
ihevcd_proc_map_update:
  197|   113M|{
  198|   113M|    codec_t *ps_codec = ps_proc->ps_codec;
  199|   113M|    WORD32 i, idx;
  200|   113M|    WORD32 bit_pos = proc_type;
  201|   113M|    WORD32 bit_mask = (1 << bit_pos);
  202|       |
  203|       |    /* Update the current CTBs processing status */
  204|   113M|    if(ps_proc->i4_check_proc_status)
  ------------------
  |  Branch (204:8): [True: 61.6M, False: 51.9M]
  ------------------
  205|  61.6M|    {
  206|  61.6M|        DATA_SYNC();
  ------------------
  |  |  100|  61.6M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  207|   127M|        for(i = 0; i < nctb; i++)
  ------------------
  |  Branch (207:20): [True: 65.4M, False: 61.6M]
  ------------------
  208|  65.4M|        {
  209|  65.4M|            sps_t *ps_sps = ps_proc->ps_sps;
  210|  65.4M|            UWORD8 *pu1_buf;
  211|  65.4M|            idx = (ps_proc->i4_ctb_x + i);
  212|  65.4M|            idx += ((ps_proc->i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb);
  213|  65.4M|            pu1_buf = (ps_codec->pu1_proc_map + idx);
  214|  65.4M|            *pu1_buf = *pu1_buf | bit_mask;
  215|  65.4M|        }
  216|  61.6M|    }
  217|   113M|}
ihevcd_slice_hdr_update:
  221|  93.7M|{
  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|  93.7M|    if(!((ps_proc->i4_ctb_x == 0) && (ps_proc->i4_ctb_y == 0)))
  ------------------
  |  Branch (225:10): [True: 3.87M, False: 89.9M]
  |  Branch (225:38): [True: 291k, False: 3.58M]
  ------------------
  226|  93.4M|    {
  227|  93.4M|        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|  93.4M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  93.4M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  228|       |
  229|  93.4M|        if((ps_slice_hdr_next->i2_ctb_x == ps_proc->i4_ctb_x)
  ------------------
  |  Branch (229:12): [True: 2.45M, False: 90.9M]
  ------------------
  230|  2.45M|                        && (ps_slice_hdr_next->i2_ctb_y == ps_proc->i4_ctb_y))
  ------------------
  |  Branch (230:28): [True: 33.1k, False: 2.42M]
  ------------------
  231|  33.1k|        {
  232|  33.1k|            if(0 == ps_slice_hdr_next->i1_dependent_slice_flag)
  ------------------
  |  Branch (232:16): [True: 14.5k, False: 18.6k]
  ------------------
  233|  14.5k|            {
  234|  14.5k|                ps_proc->i4_ctb_slice_x = 0;
  235|  14.5k|                ps_proc->i4_ctb_slice_y = 0;
  236|  14.5k|            }
  237|       |
  238|  33.1k|            ps_proc->i4_cur_slice_idx++;
  239|  33.1k|            ps_proc->ps_slice_hdr = ps_slice_hdr_next;
  240|  33.1k|        }
  241|       |
  242|  93.4M|    }
  243|  93.7M|}
ihevcd_ctb_pos_update:
  246|  70.3M|{
  247|  70.3M|    WORD32 tile_start_ctb_idx, slice_start_ctb_idx;
  248|  70.3M|    slice_header_t *ps_slice_hdr = ps_proc->ps_slice_hdr;
  249|  70.3M|    tile_t *ps_tile = ps_proc->ps_tile;
  250|  70.3M|    sps_t *ps_sps = ps_proc->ps_sps;
  251|       |
  252|       |    /* Update x and y positions */
  253|  70.3M|    ps_proc->i4_ctb_tile_x += nctb;
  254|  70.3M|    ps_proc->i4_ctb_x += nctb;
  255|       |
  256|  70.3M|    ps_proc->i4_ctb_slice_x += nctb;
  257|       |    /*If tile are enabled, then handle the tile & slice counters differently*/
  258|  70.3M|    if(ps_proc->ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (258:8): [True: 19.3M, False: 51.0M]
  ------------------
  259|  19.3M|    {
  260|       |        /* Update slice counters*/
  261|  19.3M|        slice_start_ctb_idx = ps_slice_hdr->i2_ctb_x + (ps_slice_hdr->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  262|  19.3M|        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|  19.3M|        if(slice_start_ctb_idx < tile_start_ctb_idx)
  ------------------
  |  Branch (270:12): [True: 16.2M, False: 3.07M]
  ------------------
  271|  16.2M|        {
  272|       |            /*End of tile row*/
  273|  16.2M|            if(ps_proc->i4_ctb_x > ps_slice_hdr->i2_ctb_x)
  ------------------
  |  Branch (273:16): [True: 15.8M, False: 391k]
  ------------------
  274|  15.8M|            {
  275|  15.8M|                if(ps_proc->i4_ctb_slice_x >= (ps_tile->u2_wd + ps_tile->u1_pos_x))
  ------------------
  |  Branch (275:20): [True: 3.17M, False: 12.6M]
  ------------------
  276|  3.17M|                {
  277|  3.17M|                    ps_proc->i4_ctb_slice_y++;
  278|  3.17M|                    ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_slice_x
  279|  3.17M|                                    - ps_tile->u2_wd;
  280|  3.17M|                }
  281|  15.8M|            }
  282|   391k|            else
  283|   391k|            {
  284|   391k|                WORD32 temp_stride = (ps_sps->i2_pic_wd_in_ctb - ps_slice_hdr->i2_ctb_x);
  285|   391k|                if(ps_proc->i4_ctb_slice_x >= (temp_stride + ps_tile->u2_wd + ps_tile->u1_pos_x))
  ------------------
  |  Branch (285:20): [True: 10.6k, False: 380k]
  ------------------
  286|  10.6k|                {
  287|  10.6k|                    ps_proc->i4_ctb_slice_y++;
  288|  10.6k|                    ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_slice_x
  289|  10.6k|                                    - ps_tile->u2_wd;
  290|  10.6k|                }
  291|   391k|            }
  292|  16.2M|        }
  293|       |        /*Case 2*/
  294|  3.07M|        else if(ps_proc->i4_ctb_slice_x >= (ps_tile->u2_wd))
  ------------------
  |  Branch (294:17): [True: 225k, False: 2.84M]
  ------------------
  295|   225k|        {
  296|       |            /*End of tile row*/
  297|   225k|            ps_proc->i4_ctb_slice_y++;
  298|   225k|            ps_proc->i4_ctb_slice_x = 0;
  299|   225k|        }
  300|  19.3M|    }
  301|  51.0M|    else
  302|  51.0M|    {
  303|  51.0M|        if(ps_proc->i4_ctb_slice_x >= ps_tile->u2_wd)
  ------------------
  |  Branch (303:12): [True: 2.48M, False: 48.5M]
  ------------------
  304|  2.48M|        {
  305|  2.48M|            ps_proc->i4_ctb_slice_y++;
  306|  2.48M|            ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_slice_x
  307|  2.48M|                            - ps_tile->u2_wd;
  308|  2.48M|        }
  309|  51.0M|    }
  310|  70.3M|}
ihevcd_ctb_avail_update:
  313|  46.9M|{
  314|  46.9M|    slice_header_t *ps_slice_hdr = ps_proc->ps_slice_hdr;
  315|  46.9M|    sps_t *ps_sps = ps_proc->ps_sps;
  316|  46.9M|    tile_t *ps_tile_prev;
  317|  46.9M|    tile_t *ps_tile = ps_proc->ps_tile;
  318|  46.9M|    WORD32 cur_pu_idx;
  319|  46.9M|    WORD32 tile_start_ctb_idx, slice_start_ctb_idx;
  320|  46.9M|    WORD16 i2_wd_in_ctb;
  321|  46.9M|    WORD32 continuous_tiles = 0;
  322|  46.9M|    WORD32 cur_ctb_idx;
  323|  46.9M|    WORD32 check_tile_wd;
  324|       |
  325|  46.9M|    if((0 != ps_tile->u1_pos_x) && (0 != ps_tile->u1_pos_y))
  ------------------
  |  Branch (325:8): [True: 8.93M, False: 38.0M]
  |  Branch (325:36): [True: 5.75M, False: 3.17M]
  ------------------
  326|  5.75M|    {
  327|  5.75M|        ps_tile_prev = ps_tile - 1;
  328|  5.75M|    }
  329|  41.2M|    else
  330|  41.2M|    {
  331|  41.2M|        ps_tile_prev = ps_tile;
  332|  41.2M|    }
  333|       |
  334|       |
  335|  46.9M|    check_tile_wd = ps_slice_hdr->i2_ctb_x + ps_tile_prev->u2_wd;
  336|  46.9M|    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: 36.5M, False: 10.4M]
  |  Branch (336:58): [True: 34.9M, False: 1.64M]
  ------------------
  337|  12.0M|                                    || ((ps_slice_hdr->i2_ctb_x == ps_tile->u1_pos_x))))
  ------------------
  |  Branch (337:40): [True: 1.62M, False: 10.4M]
  ------------------
  338|  10.4M|    {
  339|  10.4M|        continuous_tiles = 1;
  340|  10.4M|    }
  341|       |
  342|  46.9M|    slice_start_ctb_idx = ps_slice_hdr->i2_ctb_x + (ps_slice_hdr->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  343|  46.9M|    tile_start_ctb_idx = ps_tile->u1_pos_x + (ps_tile->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  344|       |
  345|  46.9M|    if((slice_start_ctb_idx < tile_start_ctb_idx) && (continuous_tiles))
  ------------------
  |  Branch (345:8): [True: 10.8M, False: 36.1M]
  |  Branch (345:54): [True: 8.55M, False: 2.32M]
  ------------------
  346|  8.54M|    {
  347|       |        //Slices span across multiple tiles.
  348|  8.54M|        i2_wd_in_ctb = ps_sps->i2_pic_wd_in_ctb;
  349|  8.54M|    }
  350|  38.4M|    else
  351|  38.4M|    {
  352|  38.4M|        i2_wd_in_ctb = ps_tile->u2_wd;
  353|  38.4M|    }
  354|  46.9M|    cur_ctb_idx = ps_proc->i4_ctb_x
  355|  46.9M|                    + 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|  46.9M|    ps_proc->u1_top_ctb_avail = 1;
  360|  46.9M|    ps_proc->u1_left_ctb_avail = 1;
  361|  46.9M|    ps_proc->u1_top_lt_ctb_avail = 1;
  362|  46.9M|    ps_proc->u1_top_rt_ctb_avail = 1;
  363|       |    /* slice and tile boundaries */
  364|       |
  365|  46.9M|    if((0 == ps_proc->i4_ctb_y) || (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (365:8): [True: 1.94M, False: 45.0M]
  |  Branch (365:36): [True: 580k, False: 44.4M]
  ------------------
  366|  2.50M|    {
  367|  2.50M|        ps_proc->u1_top_ctb_avail = 0;
  368|  2.50M|        ps_proc->u1_top_lt_ctb_avail = 0;
  369|  2.50M|        ps_proc->u1_top_rt_ctb_avail = 0;
  370|  2.50M|    }
  371|       |
  372|  46.9M|    if((0 == ps_proc->i4_ctb_x) || (0 == ps_proc->i4_ctb_tile_x))
  ------------------
  |  Branch (372:8): [True: 1.95M, False: 45.0M]
  |  Branch (372:36): [True: 1.88M, False: 43.1M]
  ------------------
  373|  3.85M|    {
  374|  3.85M|        ps_proc->u1_left_ctb_avail = 0;
  375|  3.85M|        ps_proc->u1_top_lt_ctb_avail = 0;
  376|  3.85M|        if((0 == ps_proc->i4_ctb_slice_y) || (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (376:12): [True: 182k, False: 3.66M]
  |  Branch (376:46): [True: 145k, False: 3.52M]
  ------------------
  377|   328k|        {
  378|   328k|            ps_proc->u1_top_ctb_avail = 0;
  379|   328k|            if((i2_wd_in_ctb - 1) != ps_proc->i4_ctb_slice_x)
  ------------------
  |  Branch (379:16): [True: 257k, False: 70.9k]
  ------------------
  380|   257k|            {
  381|   257k|                ps_proc->u1_top_rt_ctb_avail = 0;
  382|   257k|            }
  383|   328k|        }
  384|  3.85M|    }
  385|       |    /*For slices not beginning at start of a ctb row*/
  386|  43.1M|    else if(ps_proc->i4_ctb_x > 0)
  ------------------
  |  Branch (386:13): [True: 43.1M, False: 33.5k]
  ------------------
  387|  43.1M|    {
  388|  43.1M|        if((0 == ps_proc->i4_ctb_slice_y) || (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (388:12): [True: 1.77M, False: 41.3M]
  |  Branch (388:46): [True: 760k, False: 40.5M]
  ------------------
  389|  2.57M|        {
  390|  2.57M|            ps_proc->u1_top_ctb_avail = 0;
  391|  2.57M|            ps_proc->u1_top_lt_ctb_avail = 0;
  392|  2.57M|            if(0 == ps_proc->i4_ctb_slice_x)
  ------------------
  |  Branch (392:16): [True: 27.3k, False: 2.54M]
  ------------------
  393|  27.3k|            {
  394|  27.3k|                ps_proc->u1_left_ctb_avail = 0;
  395|  27.3k|            }
  396|  2.57M|            if((i2_wd_in_ctb - 1) != ps_proc->i4_ctb_slice_x)
  ------------------
  |  Branch (396:16): [True: 2.42M, False: 145k]
  ------------------
  397|  2.42M|            {
  398|  2.42M|                ps_proc->u1_top_rt_ctb_avail = 0;
  399|  2.42M|            }
  400|  2.57M|        }
  401|  40.5M|        else if((1 == ps_proc->i4_ctb_slice_y) && (0 == ps_proc->i4_ctb_slice_x))
  ------------------
  |  Branch (401:17): [True: 1.55M, False: 38.9M]
  |  Branch (401:51): [True: 8.54k, False: 1.54M]
  ------------------
  402|  8.54k|        {
  403|  8.54k|            ps_proc->u1_top_lt_ctb_avail = 0;
  404|  8.54k|        }
  405|  43.1M|    }
  406|       |
  407|  46.9M|    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.02M, False: 44.9M]
  |  Branch (407:65): [True: 1.88M, False: 43.0M]
  ------------------
  408|  3.85M|    {
  409|  3.85M|        ps_proc->u1_top_rt_ctb_avail = 0;
  410|  3.85M|    }
  411|       |
  412|       |
  413|  46.9M|    {
  414|  46.9M|        WORD32 next_ctb_idx;
  415|  46.9M|        next_ctb_idx = cur_ctb_idx + 1;
  416|       |
  417|  46.9M|        if(ps_tile->u2_wd == (ps_proc->i4_ctb_tile_x + 1))
  ------------------
  |  Branch (417:12): [True: 3.85M, False: 43.1M]
  ------------------
  418|  3.85M|        {
  419|  3.85M|            if((ps_proc->i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (419:16): [True: 307k, False: 3.54M]
  ------------------
  420|   307k|            {
  421|       |                //Last tile
  422|   307k|                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: 173k, False: 133k]
  |  Branch (422:102): [True: 145k, False: 27.4k]
  ------------------
  423|   145k|                {
  424|   145k|                    next_ctb_idx = cur_ctb_idx + 1;
  425|   145k|                }
  426|   161k|                else //Not last tile, but new tile
  427|   161k|                {
  428|   161k|                    tile_t *ps_tile_next = ps_proc->ps_tile + 1;
  429|   161k|                    next_ctb_idx = ps_tile_next->u1_pos_x + (ps_tile_next->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  430|   161k|                }
  431|   307k|            }
  432|  3.54M|            else //End of each tile row
  433|  3.54M|            {
  434|  3.54M|                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|  3.54M|            }
  436|  3.85M|        }
  437|  46.9M|        ps_proc->i4_next_pu_ctb_cnt = next_ctb_idx;
  438|  46.9M|        ps_proc->i4_ctb_pu_cnt =
  439|  46.9M|                        ps_proc->pu4_pic_pu_idx[next_ctb_idx]
  440|  46.9M|                        - ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  441|  46.9M|        cur_pu_idx = ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  442|  46.9M|        ps_proc->i4_ctb_start_pu_idx = cur_pu_idx;
  443|  46.9M|        ps_proc->ps_pu = &ps_proc->ps_pic_pu[cur_pu_idx];
  444|  46.9M|    }
  445|  46.9M|}
ihevcd_update_ctb_tu_cnt:
  448|  29.7M|{
  449|  29.7M|    sps_t *ps_sps = ps_proc->ps_sps;
  450|  29.7M|    codec_t *ps_codec = ps_proc->ps_codec;
  451|  29.7M|    WORD32 cur_ctb_idx;
  452|       |
  453|  29.7M|    cur_ctb_idx = ps_proc->i4_ctb_x
  454|  29.7M|                    + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  455|       |
  456|  29.7M|    {
  457|  29.7M|        tile_t *ps_tile;
  458|  29.7M|        WORD32 next_ctb_tu_idx;
  459|  29.7M|        ps_tile = ps_proc->ps_tile;
  460|       |
  461|       |
  462|  29.7M|        if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (462:12): [True: 10.4M, False: 19.3M]
  ------------------
  463|  10.4M|        {
  464|  10.4M|            next_ctb_tu_idx = cur_ctb_idx % RESET_TU_BUF_NCTB + 1;
  ------------------
  |  |  175|  10.4M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  10.4M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  10.4M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  10.4M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|  10.4M|            if(ps_tile->u2_wd == (ps_proc->i4_ctb_tile_x + 1))
  ------------------
  |  Branch (465:16): [True: 506k, False: 9.90M]
  ------------------
  466|   506k|            {
  467|   506k|                if((ps_proc->i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (467:20): [True: 42.3k, False: 463k]
  ------------------
  468|  42.3k|                {
  469|       |                    //Last tile
  470|  42.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: 25.8k, False: 16.4k]
  |  Branch (470:106): [True: 21.6k, False: 4.19k]
  ------------------
  471|  21.6k|                    {
  472|  21.6k|                        next_ctb_tu_idx = (cur_ctb_idx % RESET_TU_BUF_NCTB) + 1;
  ------------------
  |  |  175|  21.6k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  21.6k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  21.6k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  21.6k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  21.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  21.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  473|  21.6k|                    }
  474|  20.6k|                    else //Not last tile, but new tile
  475|  20.6k|                    {
  476|  20.6k|                        tile_t *ps_tile_next = ps_proc->ps_tile + 1;
  477|  20.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|  20.6k|                    }
  479|  42.3k|                }
  480|   463k|                else //End of each tile row
  481|   463k|                {
  482|   463k|                    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|   463k|                }
  484|   506k|            }
  485|  10.4M|            ps_proc->i4_next_tu_ctb_cnt = next_ctb_tu_idx;
  486|  10.4M|            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|  10.4M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  10.4M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  10.4M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  10.4M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  10.4M|        }
  488|  19.3M|        else
  489|  19.3M|        {
  490|  19.3M|            next_ctb_tu_idx = cur_ctb_idx + 1;
  491|  19.3M|            if(ps_tile->u2_wd == (ps_proc->i4_ctb_tile_x + 1))
  ------------------
  |  Branch (491:16): [True: 1.92M, False: 17.4M]
  ------------------
  492|  1.92M|            {
  493|  1.92M|                if((ps_proc->i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (493:20): [True: 158k, False: 1.76M]
  ------------------
  494|   158k|                {
  495|       |                    //Last tile
  496|   158k|                    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: 95.0k, False: 63.2k]
  |  Branch (496:106): [True: 81.9k, False: 13.1k]
  ------------------
  497|  81.9k|                    {
  498|  81.9k|                        next_ctb_tu_idx = (cur_ctb_idx % RESET_TU_BUF_NCTB) + 1;
  ------------------
  |  |  175|  81.9k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  81.9k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  81.9k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  81.9k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  81.9k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  81.9k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|  81.9k|                    }
  500|  76.3k|                    else //Not last tile, but new tile
  501|  76.3k|                    {
  502|  76.3k|                        tile_t *ps_tile_next = ps_proc->ps_tile + 1;
  503|  76.3k|                        next_ctb_tu_idx = ps_tile_next->u1_pos_x + (ps_tile_next->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  504|  76.3k|                    }
  505|   158k|                }
  506|  1.76M|                else //End of each tile row
  507|  1.76M|                {
  508|  1.76M|                    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.76M|                }
  510|  1.92M|            }
  511|  19.3M|            ps_proc->i4_next_tu_ctb_cnt = next_ctb_tu_idx;
  512|  19.3M|            ps_proc->i4_ctb_tu_cnt = ps_proc->pu4_pic_tu_idx[next_ctb_tu_idx] -
  513|  19.3M|                            ps_proc->pu4_pic_tu_idx[cur_ctb_idx];
  514|  19.3M|        }
  515|  29.7M|    }
  516|  29.7M|}
ihevcd_process:
  519|  1.92M|{
  520|  1.92M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  521|  1.92M|    codec_t *ps_codec;
  522|  1.92M|    sps_t *ps_sps = ps_proc->ps_sps;
  523|       |
  524|  1.92M|    WORD32 nctb;
  525|  1.92M|    WORD32 i;
  526|  1.92M|    WORD32 idx;
  527|  1.92M|    WORD32 nop_cnt;
  528|  1.92M|    WORD32 num_minpu_in_ctb;
  529|  1.92M|    WORD32 cur_slice_idx, cur_ctb_tile_x, cur_ctb_slice_x, cur_ctb_tile_y, cur_ctb_slice_y;
  530|  1.92M|    WORD32 nxt_ctb_slice_y, nxt_ctb_slice_x;
  531|  1.92M|    tu_t *ps_tu_cur, *ps_tu_nxt;
  532|  1.92M|    UWORD8 *pu1_pu_map_cur, *pu1_pu_map_nxt;
  533|  1.92M|    WORD32 num_ctb, num_ctb_tmp;
  534|  1.92M|    proc_type_t proc_type;
  535|       |
  536|       |
  537|  1.92M|    WORD32 ctb_size = 1 << ps_sps->i1_log2_ctb_size;
  538|       |
  539|  1.92M|    WORD32 h_samp_factor, v_samp_factor;
  540|  1.92M|    WORD32 chroma_row_strd;
  541|  1.92M|    WORD32 chroma_pixel_strd = 2;
  542|       |
  543|  1.92M|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (543:21): [True: 0, False: 1.92M]
  ------------------
  544|  1.92M|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (544:21): [True: 1.78M, False: 138k]
  ------------------
  545|       |
  546|  1.92M|    PROFILE_DISABLE_PROCESS_CTB();
  ------------------
  |  |   77|  1.92M|#define PROFILE_DISABLE_PROCESS_CTB() ;
  ------------------
  547|       |
  548|  1.92M|    ps_codec = ps_proc->ps_codec;
  549|  1.92M|    num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.92M|#define MIN_PU_SIZE         4
  ------------------
                  num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.92M|#define MIN_PU_SIZE         4
  ------------------
  550|       |
  551|  1.92M|    nctb = MIN(ps_codec->i4_proc_nctb, ps_proc->i4_ctb_cnt);
  ------------------
  |  |   43|  1.92M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.75M, False: 176k]
  |  |  ------------------
  ------------------
  552|  1.92M|    nctb = MIN(nctb, (ps_proc->ps_tile->u2_wd - ps_proc->i4_ctb_tile_x));
  ------------------
  |  |   43|  1.92M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.75M, False: 176k]
  |  |  ------------------
  ------------------
  553|       |
  554|  1.92M|    if(ps_proc->i4_cur_slice_idx > (MAX_SLICE_HDR_CNT - 2 * ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  |  153|  1.92M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  1.92M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  |  Branch (554:8): [True: 96.7k, False: 1.83M]
  ------------------
  555|  96.7k|    {
  556|  96.7k|        num_ctb = 1;
  557|  96.7k|    }
  558|  1.83M|    else
  559|  1.83M|    {
  560|  1.83M|        num_ctb = ps_proc->i4_nctb;
  561|  1.83M|    }
  562|  1.92M|    nxt_ctb_slice_y = ps_proc->i4_ctb_slice_y;
  563|  1.92M|    nxt_ctb_slice_x = ps_proc->i4_ctb_slice_x;
  564|  1.92M|    pu1_pu_map_nxt = ps_proc->pu1_pu_map;
  565|  1.92M|    ps_tu_nxt = ps_proc->ps_tu;
  566|       |
  567|  15.6M|    while(ps_proc->i4_ctb_cnt)
  ------------------
  |  Branch (567:11): [True: 13.7M, False: 1.92M]
  ------------------
  568|  13.7M|    {
  569|  13.7M|        ps_proc->i4_ctb_slice_y = nxt_ctb_slice_y;
  570|  13.7M|        ps_proc->i4_ctb_slice_x = nxt_ctb_slice_x;
  571|  13.7M|        ps_proc->pu1_pu_map = pu1_pu_map_nxt;
  572|  13.7M|        ps_proc->ps_tu = ps_tu_nxt;
  573|       |
  574|  13.7M|        cur_ctb_tile_x = ps_proc->i4_ctb_tile_x;
  575|  13.7M|        cur_ctb_tile_y = ps_proc->i4_ctb_tile_y;
  576|  13.7M|        cur_ctb_slice_x = ps_proc->i4_ctb_slice_x;
  577|  13.7M|        cur_ctb_slice_y = ps_proc->i4_ctb_slice_y;
  578|  13.7M|        cur_slice_idx = ps_proc->i4_cur_slice_idx;
  579|  13.7M|        ps_tu_cur = ps_proc->ps_tu;
  580|  13.7M|        pu1_pu_map_cur = ps_proc->pu1_pu_map;
  581|  13.7M|        proc_type = PROC_INTER_PRED;
  582|       |
  583|  13.7M|        if(ps_proc->i4_ctb_cnt < num_ctb)
  ------------------
  |  Branch (583:12): [True: 0, False: 13.7M]
  ------------------
  584|      0|        {
  585|      0|            num_ctb = ps_proc->i4_ctb_cnt;
  586|      0|        }
  587|  13.7M|        num_ctb_tmp = num_ctb;
  588|       |
  589|  37.3M|        while(num_ctb_tmp)
  ------------------
  |  Branch (589:15): [True: 23.5M, False: 13.7M]
  ------------------
  590|  23.5M|        {
  591|  23.5M|            slice_header_t *ps_slice_hdr;
  592|  23.5M|            tile_t *ps_tile = ps_proc->ps_tile;
  593|       |
  594|       |            /* Waiting for Parsing to be done*/
  595|  23.5M|            {
  596|       |
  597|       |
  598|  23.5M|                nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|  23.5M|#define PROC_NOP_CNT (8 * 128)
  ------------------
  599|  23.5M|                if(ps_proc->i4_check_parse_status || ps_proc->i4_check_proc_status)
  ------------------
  |  Branch (599:20): [True: 13.1M, False: 10.4M]
  |  Branch (599:54): [True: 0, False: 10.4M]
  ------------------
  600|  13.1M|                {
  601|  24.0M|                    while(1)
  ------------------
  |  Branch (601:27): [True: 24.0M, Folded]
  ------------------
  602|  24.0M|                    {
  603|  24.0M|                        volatile UWORD8 *pu1_buf;
  604|  24.0M|                        volatile WORD32 status;
  605|  24.0M|                        status = 1;
  606|       |                        /* Check if all dependencies for the next nCTBs are met */
  607|       |                        /* Check if the next nCTBs are parsed */
  608|  24.0M|                        if(ps_proc->i4_check_parse_status)
  ------------------
  |  Branch (608:28): [True: 24.0M, False: 1.04k]
  ------------------
  609|  24.0M|                        {
  610|  24.0M|                            idx = (ps_proc->i4_ctb_x + nctb - 1);
  611|  24.0M|                            idx += (ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  612|  24.0M|                            pu1_buf = (ps_codec->pu1_parse_map + idx);
  613|  24.0M|                            status = *pu1_buf;
  614|  24.0M|                        }
  615|       |
  616|  24.0M|                        if(status)
  ------------------
  |  Branch (616:28): [True: 13.1M, False: 10.8M]
  ------------------
  617|  13.1M|                            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|  10.8M|                        if(nop_cnt > 0)
  ------------------
  |  Branch (622:28): [True: 9.77M, False: 1.07M]
  ------------------
  623|  9.77M|                        {
  624|  9.77M|                            NOP(128);
  ------------------
  |  |   68|  1.26G|#define NOP(nop_cnt)    {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (68:57): [True: 1.25G, False: 9.77M]
  |  |  ------------------
  ------------------
  625|  9.77M|                            nop_cnt -= 128;
  626|  9.77M|                        }
  627|  1.07M|                        else
  628|  1.07M|                        {
  629|  1.07M|                            nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|  1.07M|#define PROC_NOP_CNT (8 * 128)
  ------------------
  630|  1.07M|                            ithread_yield();
  631|  1.07M|                        }
  632|  10.8M|                    }
  633|  13.1M|                }
  634|  23.5M|            }
  635|       |
  636|       |            /* Check proc map to ensure dependencies for recon are met */
  637|  23.5M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
  638|       |
  639|  23.5M|            ihevcd_slice_hdr_update(ps_proc);
  640|  23.5M|            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|  23.5M|            {
  652|  23.5M|                UWORD32 *pu4_ctb_top_pu_idx, *pu4_ctb_left_pu_idx, *pu4_ctb_top_left_pu_idx;
  653|  23.5M|                WORD32 cur_ctb_idx;
  654|       |
  655|  23.5M|                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|  23.5M|                if(PSLICE == ps_slice_hdr->i1_slice_type
  ------------------
  |  Branch (667:20): [True: 133k, False: 23.4M]
  ------------------
  668|  23.4M|                                || BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (668:36): [True: 3.69M, False: 19.7M]
  ------------------
  669|  3.73M|                {
  670|  3.73M|                    mv_ctxt_t s_mv_ctxt;
  671|       |
  672|  3.73M|                    pu4_ctb_top_pu_idx = ps_proc->pu4_pic_pu_idx_top
  673|  3.73M|                                    + (ps_proc->i4_ctb_x * ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  3.73M|#define MIN_PU_SIZE         4
  ------------------
  674|  3.73M|                    pu4_ctb_left_pu_idx = ps_proc->pu4_pic_pu_idx_left;
  675|  3.73M|                    pu4_ctb_top_left_pu_idx = &ps_proc->u4_ctb_top_left_pu_idx;
  676|       |
  677|       |                    /* Initializing s_mv_ctxt */
  678|  3.73M|                    if(ps_codec->i4_num_cores > MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  3.73M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (678:24): [True: 1.29M, False: 2.43M]
  ------------------
  679|  1.29M|                    {
  680|  1.29M|                        s_mv_ctxt.ps_pps = ps_proc->ps_pps;
  681|  1.29M|                        s_mv_ctxt.ps_sps = ps_proc->ps_sps;
  682|  1.29M|                        s_mv_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
  683|  1.29M|                        s_mv_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
  684|  1.29M|                        s_mv_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
  685|  1.29M|                        s_mv_ctxt.ps_pu = ps_proc->ps_pu;
  686|  1.29M|                        s_mv_ctxt.ps_pic_pu = ps_proc->ps_pic_pu;
  687|  1.29M|                        s_mv_ctxt.ps_tile = ps_tile;
  688|  1.29M|                        s_mv_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
  689|  1.29M|                        s_mv_ctxt.pu4_pic_pu_idx = ps_proc->pu4_pic_pu_idx;
  690|  1.29M|                        s_mv_ctxt.pu1_pic_pu_map = ps_proc->pu1_pic_pu_map;
  691|  1.29M|                        s_mv_ctxt.i4_ctb_pu_cnt = ps_proc->i4_ctb_pu_cnt;
  692|  1.29M|                        s_mv_ctxt.i4_ctb_start_pu_idx = ps_proc->i4_ctb_start_pu_idx;
  693|  1.29M|                        s_mv_ctxt.u1_top_ctb_avail = ps_proc->u1_top_ctb_avail;
  694|  1.29M|                        s_mv_ctxt.u1_top_rt_ctb_avail = ps_proc->u1_top_rt_ctb_avail;
  695|  1.29M|                        s_mv_ctxt.u1_top_lt_ctb_avail = ps_proc->u1_top_lt_ctb_avail;
  696|  1.29M|                        s_mv_ctxt.u1_left_ctb_avail = ps_proc->u1_left_ctb_avail;
  697|       |
  698|  1.29M|                        ihevcd_get_mv_ctb(&s_mv_ctxt, pu4_ctb_top_pu_idx,
  699|  1.29M|                                          pu4_ctb_left_pu_idx, pu4_ctb_top_left_pu_idx);
  700|  1.29M|                    }
  701|       |
  702|  3.73M|                    ihevcd_inter_pred_ctb(ps_proc);
  703|  3.73M|                }
  704|  19.8M|                else if(ps_codec->i4_num_cores > MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  19.8M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (704:25): [True: 5.72M, False: 14.1M]
  ------------------
  705|  5.72M|                {
  706|  5.72M|                    WORD32 next_ctb_idx, num_pu_per_ctb, ctb_start_pu_idx, pu_cnt;
  707|  5.72M|                    pu_t *ps_pu;
  708|  5.72M|                    WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.72M|#define MIN_PU_SIZE         4
  ------------------
                                  WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.72M|#define MIN_PU_SIZE         4
  ------------------
  709|  5.72M|                    UWORD8 *pu1_pic_pu_map_ctb = ps_proc->pu1_pic_pu_map +
  710|  5.72M|                                    (ps_proc->i4_ctb_x + ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb) * num_minpu_in_ctb;
  711|  5.72M|                    WORD32 row, col;
  712|  5.72M|                    UWORD32 *pu4_nbr_pu_idx = ps_proc->pu4_pic_pu_idx_map;
  713|  5.72M|                    WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  5.72M|#define MAX_CTB_SIZE        64
  ------------------
                                  WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  5.72M|#define MIN_PU_SIZE         4
  ------------------
  714|  5.72M|                    WORD32 ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.72M|#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.72M|                    cur_ctb_idx = ps_proc->i4_ctb_x
  720|  5.72M|                                    + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  721|  5.72M|                    next_ctb_idx = ps_proc->i4_next_pu_ctb_cnt;
  722|  5.72M|                    num_pu_per_ctb = ps_proc->pu4_pic_pu_idx[next_ctb_idx]
  723|  5.72M|                                    - ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  724|  5.72M|                    ctb_start_pu_idx = ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  725|  5.72M|                    ps_pu = &ps_proc->ps_pic_pu[ctb_start_pu_idx];
  726|       |
  727|   122M|                    for(pu_cnt = 0; pu_cnt < num_pu_per_ctb; pu_cnt++, ps_pu++)
  ------------------
  |  Branch (727:37): [True: 117M, False: 5.72M]
  ------------------
  728|   117M|                    {
  729|   117M|                        UWORD32 cur_pu_idx;
  730|   117M|                        WORD32 pu_ht = (ps_pu->b4_ht + 1) << 2;
  731|   117M|                        WORD32 pu_wd = (ps_pu->b4_wd + 1) << 2;
  732|       |
  733|   117M|                        cur_pu_idx = ctb_start_pu_idx + pu_cnt;
  734|       |
  735|   358M|                        for(row = 0; row < pu_ht / MIN_PU_SIZE; row++)
  ------------------
  |  |  367|   358M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (735:38): [True: 241M, False: 117M]
  ------------------
  736|   800M|                            for(col = 0; col < pu_wd / MIN_PU_SIZE; col++)
  ------------------
  |  |  367|   800M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (736:42): [True: 559M, False: 241M]
  ------------------
  737|   559M|                                pu4_nbr_pu_idx[(1 + ps_pu->b4_pos_x + col)
  738|   559M|                                                + (1 + ps_pu->b4_pos_y + row)
  739|   559M|                                                * nbr_pu_idx_strd] =
  740|   559M|                                                cur_pu_idx;
  741|   117M|                    }
  742|       |
  743|       |                    /* Updating Top and Left pointers */
  744|  5.72M|                    {
  745|  5.72M|                        WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
  746|  5.72M|                                        - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size);
  747|  5.72M|                        WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  5.72M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.22M, False: 502k]
  |  |  ------------------
  ------------------
  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.72M|                        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.72M|#define MIN_PU_SIZE         4
  ------------------
  752|  58.4M|                        for(i = 0; i < ctb_size / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|  58.4M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (752:36): [True: 52.7M, False: 5.72M]
  ------------------
  753|  52.7M|                        {
  754|       |                            /* Left */
  755|       |                            /* Last column of au4_nbr_pu_idx */
  756|  52.7M|                            ps_proc->pu4_pic_pu_idx_left[i] =
  757|  52.7M|                                            pu4_nbr_pu_idx[(ctb_size / MIN_PU_SIZE) + (i + 1) * nbr_pu_idx_strd];
  ------------------
  |  |  367|  52.7M|#define MIN_PU_SIZE         4
  ------------------
  758|       |                            /* Top */
  759|       |                            /* Last row of au4_nbr_pu_idx */
  760|  52.7M|                            ps_proc->pu4_pic_pu_idx_top[(ps_proc->i4_ctb_x * ctb_size / MIN_PU_SIZE) + i] =
  ------------------
  |  |  367|  52.7M|#define MIN_PU_SIZE         4
  ------------------
  761|  52.7M|                                            pu4_nbr_pu_idx[(ctb_size_left / MIN_PU_SIZE) * nbr_pu_idx_strd + i + 1];
  ------------------
  |  |  367|  52.7M|#define MIN_PU_SIZE         4
  ------------------
  762|       |
  763|  52.7M|                        }
  764|       |
  765|       |                        /* Updating the CTB level PU idx (Used for collocated MV pred)*/
  766|  5.72M|                        {
  767|  5.72M|                            WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map;
  768|  5.72M|                            WORD32 first_pu_of_ctb;
  769|  5.72M|                            first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd];
  770|  5.72M|                            UWORD32 cur_ctb_ht_in_min_pu = MIN(((ps_sps->i2_pic_height_in_luma_samples
  ------------------
  |  |   43|  5.72M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 366k, False: 5.36M]
  |  |  ------------------
  ------------------
  771|  5.72M|                                        - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  772|  5.72M|                            UWORD32 cur_ctb_wd_in_min_pu = MIN(((ps_sps->i2_pic_width_in_luma_samples
  ------------------
  |  |   43|  5.72M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 174k, False: 5.55M]
  |  |  ------------------
  ------------------
  773|  5.72M|                                        - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  774|       |
  775|  5.72M|                            index_pic_map = 0 * ctb_size_in_min_pu + 0;
  776|  5.72M|                            index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1);
  777|       |
  778|  55.2M|                            for(ctb_row = 0; ctb_row < cur_ctb_ht_in_min_pu; ctb_row++)
  ------------------
  |  Branch (778:46): [True: 49.5M, False: 5.72M]
  ------------------
  779|  49.5M|                            {
  780|   655M|                                for(ctb_col = 0; ctb_col < cur_ctb_wd_in_min_pu; ctb_col++)
  ------------------
  |  Branch (780:50): [True: 605M, False: 49.5M]
  ------------------
  781|   605M|                                {
  782|   605M|                                    pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col]
  783|   605M|                                                    - first_pu_of_ctb;
  784|   605M|                                }
  785|  49.5M|                                index_pic_map += ctb_size_in_min_pu;
  786|  49.5M|                                index_nbr_map += nbr_pu_idx_strd;
  787|  49.5M|                            }
  788|  5.72M|                        }
  789|  5.72M|                    }
  790|  5.72M|                }
  791|  23.5M|            }
  792|       |
  793|  23.5M|            if(ps_proc->ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (793:16): [True: 6.46M, False: 17.1M]
  ------------------
  794|  6.46M|            {
  795|       |                /*Update the tile index buffer with tile information for the current ctb*/
  796|  6.46M|                UWORD16 *pu1_tile_idx = ps_proc->pu1_tile_idx;
  797|  6.46M|                pu1_tile_idx[(ps_proc->i4_ctb_x + (ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb))]
  798|  6.46M|                                = ps_proc->i4_cur_tile_idx;
  799|  6.46M|            }
  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|  23.5M|            {
  807|  23.5M|                slice_header_t *ps_slice_hdr;
  808|  23.5M|                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|  23.5M|                if(0 == ps_codec->i4_disable_deblk_pic)
  ------------------
  |  Branch (814:20): [True: 23.5M, False: 66.2k]
  ------------------
  815|  23.5M|                {
  816|  23.5M|                    if(ps_codec->i4_num_cores > MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  23.5M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (816:24): [True: 7.04M, False: 16.4M]
  ------------------
  817|  7.04M|                    {
  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.04M|                        if((0 == ps_codec->i4_slice_error))
  ------------------
  |  Branch (820:28): [True: 6.51M, False: 530k]
  ------------------
  821|  6.51M|                        {
  822|  6.51M|                            ihevcd_update_ctb_tu_cnt(ps_proc);
  823|  6.51M|                            ps_proc->s_bs_ctxt.ps_pps = ps_proc->ps_pps;
  824|  6.51M|                            ps_proc->s_bs_ctxt.ps_sps = ps_proc->ps_sps;
  825|  6.51M|                            ps_proc->s_bs_ctxt.ps_codec = ps_proc->ps_codec;
  826|  6.51M|                            ps_proc->s_bs_ctxt.i4_ctb_tu_cnt = ps_proc->i4_ctb_tu_cnt;
  827|  6.51M|                            ps_proc->s_bs_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
  828|  6.51M|                            ps_proc->s_bs_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
  829|  6.51M|                            ps_proc->s_bs_ctxt.i4_ctb_tile_x = ps_proc->i4_ctb_tile_x;
  830|  6.51M|                            ps_proc->s_bs_ctxt.i4_ctb_tile_y = ps_proc->i4_ctb_tile_y;
  831|  6.51M|                            ps_proc->s_bs_ctxt.i4_ctb_slice_x = ps_proc->i4_ctb_slice_x;
  832|  6.51M|                            ps_proc->s_bs_ctxt.i4_ctb_slice_y = ps_proc->i4_ctb_slice_y;
  833|  6.51M|                            ps_proc->s_bs_ctxt.ps_tu = ps_proc->ps_tu;
  834|  6.51M|                            ps_proc->s_bs_ctxt.ps_pu = ps_proc->ps_pu;
  835|  6.51M|                            ps_proc->s_bs_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
  836|  6.51M|                            ps_proc->s_bs_ctxt.i4_next_pu_ctb_cnt = ps_proc->i4_next_pu_ctb_cnt;
  837|  6.51M|                            ps_proc->s_bs_ctxt.i4_next_tu_ctb_cnt = ps_proc->i4_next_tu_ctb_cnt;
  838|  6.51M|                            ps_proc->s_bs_ctxt.pu1_slice_idx = ps_proc->pu1_slice_idx;
  839|  6.51M|                            ps_proc->s_bs_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
  840|  6.51M|                            ps_proc->s_bs_ctxt.ps_tile = ps_proc->ps_tile;
  841|       |
  842|  6.51M|                            if(ISLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (842:32): [True: 5.26M, False: 1.25M]
  ------------------
  843|  5.26M|                            {
  844|  5.26M|                                ihevcd_ctb_boundary_strength_islice(&ps_proc->s_bs_ctxt);
  845|  5.26M|                            }
  846|  1.25M|                            else
  847|  1.25M|                            {
  848|  1.25M|                                ihevcd_ctb_boundary_strength_pbslice(&ps_proc->s_bs_ctxt);
  849|  1.25M|                            }
  850|  6.51M|                        }
  851|       |
  852|       |                        /* Boundary strength is set to zero if deblocking is disabled for the current slice */
  853|  7.04M|                        if((0 != ps_slice_hdr->i1_slice_disable_deblocking_filter_flag))
  ------------------
  |  Branch (853:28): [True: 1.27M, False: 5.77M]
  ------------------
  854|  1.27M|                        {
  855|  1.27M|                            WORD32 bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) * (ctb_size * ctb_size / 8 / 16);
  856|       |
  857|  1.27M|                            UWORD32 *pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_proc->s_bs_ctxt.pu4_pic_vert_bs +
  858|  1.27M|                                            ps_proc->i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
  859|  1.27M|                                            ps_proc->i4_ctb_y * bs_strd);
  860|  1.27M|                            UWORD32 *pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_proc->s_bs_ctxt.pu4_pic_horz_bs +
  861|  1.27M|                                            ps_proc->i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
  862|  1.27M|                                            ps_proc->i4_ctb_y * bs_strd);
  863|       |
  864|  1.27M|                            memset(pu4_vert_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  865|  1.27M|                            memset(pu4_horz_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  866|  1.27M|                        }
  867|  7.04M|                    }
  868|  23.5M|                }
  869|  23.5M|            }
  870|       |
  871|       |            /* Per CTB update the following */
  872|  23.5M|            {
  873|  23.5M|                WORD32 cur_ctb_idx = ps_proc->i4_ctb_x
  874|  23.5M|                                + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  875|  23.5M|                cur_ctb_idx++;
  876|       |
  877|  23.5M|                ps_proc->pu1_pu_map += nctb * num_minpu_in_ctb;
  878|  23.5M|                ps_proc->ps_tu += ps_proc->i4_ctb_tu_cnt;
  879|  23.5M|                if((1 == ps_codec->i4_num_cores) &&
  ------------------
  |  Branch (879:20): [True: 10.4M, False: 13.1M]
  ------------------
  880|  10.4M|                                (0 == cur_ctb_idx % RESET_TU_BUF_NCTB))
  ------------------
  |  |  175|  10.4M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  10.4M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  10.4M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  10.4M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (880:33): [True: 0, False: 10.4M]
  ------------------
  881|      0|                {
  882|      0|                    ps_proc->ps_tu = ps_proc->ps_pic_tu;
  883|      0|                }
  884|  23.5M|                ps_proc->ps_pu += ps_proc->i4_ctb_pu_cnt;
  885|  23.5M|            }
  886|       |
  887|       |            /* Update proc map for recon*/
  888|  23.5M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
  889|       |
  890|  23.5M|            num_ctb_tmp -= nctb;
  891|  23.5M|            ihevcd_ctb_pos_update(ps_proc, nctb);
  892|       |
  893|  23.5M|        }
  894|       |
  895|  13.7M|        if(cur_slice_idx != ps_proc->i4_cur_slice_idx)
  ------------------
  |  Branch (895:12): [True: 7.47k, False: 13.7M]
  ------------------
  896|  7.47k|        {
  897|  7.47k|            ps_proc->ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((cur_slice_idx)&(MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  7.47k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  7.47k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  898|  7.47k|            ps_proc->i4_cur_slice_idx = cur_slice_idx;
  899|  7.47k|        }
  900|       |        /* Restore the saved variables  */
  901|  13.7M|        num_ctb_tmp = num_ctb;
  902|  13.7M|        ps_proc->i4_ctb_x -= num_ctb;
  903|  13.7M|        ps_proc->i4_ctb_tile_x = cur_ctb_tile_x;
  904|  13.7M|        ps_proc->i4_ctb_slice_x = cur_ctb_slice_x;
  905|  13.7M|        ps_proc->i4_ctb_tile_y = cur_ctb_tile_y;
  906|  13.7M|        ps_proc->i4_ctb_slice_y = cur_ctb_slice_y;
  907|  13.7M|        ps_proc->pu1_pu_map = pu1_pu_map_cur;
  908|  13.7M|        ps_proc->ps_tu = ps_tu_cur;
  909|  13.7M|        proc_type = PROC_RECON;
  910|       |
  911|  37.3M|        while(num_ctb_tmp)
  ------------------
  |  Branch (911:15): [True: 23.5M, False: 13.7M]
  ------------------
  912|  23.5M|        {
  913|       |
  914|       |            /* Check proc map to ensure dependencies for recon are met */
  915|  23.5M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
  916|       |
  917|  23.5M|            ihevcd_slice_hdr_update(ps_proc);
  918|       |
  919|  23.5M|            {
  920|       |
  921|  23.5M|                ihevcd_ctb_avail_update(ps_proc);
  922|       |
  923|       |                /*************************************************/
  924|       |                /**************** IQ IT RECON  *******************/
  925|       |                /*************************************************/
  926|       |
  927|  23.5M|                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|  23.5M|                if(0 == ps_sps->i1_scaling_list_enable_flag)
  ------------------
  |  Branch (933:20): [True: 2.76M, False: 20.8M]
  ------------------
  934|  2.76M|                {
  935|  2.76M|                    ps_proc->api2_dequant_intra_matrix[0] =
  936|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  937|  2.76M|                    ps_proc->api2_dequant_intra_matrix[1] =
  938|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  939|  2.76M|                    ps_proc->api2_dequant_intra_matrix[2] =
  940|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  941|  2.76M|                    ps_proc->api2_dequant_intra_matrix[3] =
  942|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  943|       |
  944|  2.76M|                    ps_proc->api2_dequant_inter_matrix[0] =
  945|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  946|  2.76M|                    ps_proc->api2_dequant_inter_matrix[1] =
  947|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  948|  2.76M|                    ps_proc->api2_dequant_inter_matrix[2] =
  949|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  950|  2.76M|                    ps_proc->api2_dequant_inter_matrix[3] =
  951|  2.76M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  952|  2.76M|                }
  953|  20.8M|                else
  954|  20.8M|                {
  955|  20.8M|                    if(0 == ps_sps->i1_sps_scaling_list_data_present_flag)
  ------------------
  |  Branch (955:24): [True: 18.8M, False: 1.96M]
  ------------------
  956|  18.8M|                    {
  957|  18.8M|                        ps_proc->api2_dequant_intra_matrix[0] =
  958|  18.8M|                                        (WORD16 *)gi2_flat_scale_mat_32x32;
  959|  18.8M|                        ps_proc->api2_dequant_intra_matrix[1] =
  960|  18.8M|                                        (WORD16 *)gi2_intra_default_scale_mat_8x8;
  961|  18.8M|                        ps_proc->api2_dequant_intra_matrix[2] =
  962|  18.8M|                                        (WORD16 *)gi2_intra_default_scale_mat_16x16;
  963|  18.8M|                        ps_proc->api2_dequant_intra_matrix[3] =
  964|  18.8M|                                        (WORD16 *)gi2_intra_default_scale_mat_32x32;
  965|       |
  966|  18.8M|                        ps_proc->api2_dequant_inter_matrix[0] =
  967|  18.8M|                                        (WORD16 *)gi2_flat_scale_mat_32x32;
  968|  18.8M|                        ps_proc->api2_dequant_inter_matrix[1] =
  969|  18.8M|                                        (WORD16 *)gi2_inter_default_scale_mat_8x8;
  970|  18.8M|                        ps_proc->api2_dequant_inter_matrix[2] =
  971|  18.8M|                                        (WORD16 *)gi2_inter_default_scale_mat_16x16;
  972|  18.8M|                        ps_proc->api2_dequant_inter_matrix[3] =
  973|  18.8M|                                        (WORD16 *)gi2_inter_default_scale_mat_32x32;
  974|  18.8M|                    }
  975|       |                    /*TODO: Add support for custom scaling matrices */
  976|  20.8M|                }
  977|       |
  978|       |                /* CTB Level pointers */
  979|  23.5M|                ps_proc->pu1_cur_ctb_luma = ps_proc->pu1_cur_pic_luma
  980|  23.5M|                                + (ps_proc->i4_ctb_x * ctb_size
  981|  23.5M|                                + ps_proc->i4_ctb_y * ctb_size
  982|  23.5M|                                * ps_codec->i4_strd) * ps_codec->i4_pixel_size_y;
  983|  23.5M|                if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (983:20): [True: 23.4M, False: 150k]
  ------------------
  984|  23.4M|                {
  985|  23.4M|                    ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma
  986|  23.4M|                                    + ((ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor)
  987|  23.4M|                                    + (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|  23.4M|                }
  989|       |
  990|  23.5M|                ihevcd_iquant_itrans_recon_ctb(ps_proc);
  991|  23.5M|            }
  992|       |
  993|       |            /* Per CTB update the following */
  994|  23.5M|            {
  995|  23.5M|                WORD32 cur_ctb_idx = ps_proc->i4_ctb_x
  996|  23.5M|                                + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  997|  23.5M|                cur_ctb_idx++;
  998|       |
  999|  23.5M|                ps_proc->pu1_pu_map += nctb * num_minpu_in_ctb;
 1000|  23.5M|                ps_proc->ps_tu += ps_proc->i4_ctb_tu_cnt;
 1001|  23.5M|                if((1 == ps_codec->i4_num_cores) &&
  ------------------
  |  Branch (1001:20): [True: 10.4M, False: 13.1M]
  ------------------
 1002|  10.4M|                                (0 == cur_ctb_idx % RESET_TU_BUF_NCTB))
  ------------------
  |  |  175|  10.4M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  10.4M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  10.4M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  10.4M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  10.4M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1002:33): [True: 0, False: 10.4M]
  ------------------
 1003|      0|                {
 1004|      0|                    ps_proc->ps_tu = ps_proc->ps_pic_tu;
 1005|      0|                }
 1006|  23.5M|                ps_proc->ps_pu += ps_proc->i4_ctb_pu_cnt;
 1007|  23.5M|            }
 1008|       |
 1009|       |
 1010|       |            /* Update proc map for recon*/
 1011|  23.5M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
 1012|       |
 1013|  23.5M|            num_ctb_tmp -= nctb;
 1014|  23.5M|            ihevcd_ctb_pos_update(ps_proc, nctb);
 1015|  23.5M|        }
 1016|       |
 1017|  13.7M|        if(cur_slice_idx != ps_proc->i4_cur_slice_idx)
  ------------------
  |  Branch (1017:12): [True: 7.45k, False: 13.7M]
  ------------------
 1018|  7.45k|        {
 1019|  7.45k|            ps_proc->ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((cur_slice_idx)&(MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  7.45k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  7.45k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1020|  7.45k|            ps_proc->i4_cur_slice_idx = cur_slice_idx;
 1021|  7.45k|        }
 1022|       |        /* Restore the saved variables  */
 1023|  13.7M|        num_ctb_tmp = num_ctb;
 1024|  13.7M|        ps_proc->i4_ctb_x -= num_ctb;
 1025|  13.7M|        ps_proc->i4_ctb_tile_x = cur_ctb_tile_x;
 1026|  13.7M|        ps_proc->i4_ctb_slice_x = cur_ctb_slice_x;
 1027|  13.7M|        ps_proc->i4_ctb_tile_y = cur_ctb_tile_y;
 1028|  13.7M|        ps_proc->i4_ctb_slice_y = cur_ctb_slice_y;
 1029|  13.7M|        pu1_pu_map_nxt = ps_proc->pu1_pu_map;
 1030|  13.7M|        ps_tu_nxt = ps_proc->ps_tu;
 1031|  13.7M|        ps_proc->pu1_pu_map = pu1_pu_map_cur;
 1032|  13.7M|        ps_proc->ps_tu = ps_tu_cur;
 1033|  13.7M|        proc_type = PROC_DEBLK;
 1034|       |
 1035|  37.2M|        while(num_ctb_tmp)
  ------------------
  |  Branch (1035:15): [True: 23.5M, False: 13.7M]
  ------------------
 1036|  23.5M|        {
 1037|       |
 1038|       |
 1039|       |            /* Check proc map to ensure dependencies for deblk are met */
 1040|  23.5M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
 1041|       |
 1042|  23.5M|            ihevcd_slice_hdr_update(ps_proc);
 1043|       |
 1044|       |
 1045|  23.5M|            if(0 == ps_codec->i4_disable_deblk_pic)
  ------------------
  |  Branch (1045:16): [True: 23.4M, False: 21.5k]
  ------------------
 1046|  23.4M|            {
 1047|  23.4M|                WORD32 i4_is_last_ctb_x = 0;
 1048|  23.4M|                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|  23.4M|                {
 1054|  23.4M|                    ps_proc->s_deblk_ctxt.ps_pps = ps_proc->ps_pps;
 1055|  23.4M|                    ps_proc->s_deblk_ctxt.ps_sps = ps_proc->ps_sps;
 1056|  23.4M|                    ps_proc->s_deblk_ctxt.ps_codec = ps_proc->ps_codec;
 1057|  23.4M|                    ps_proc->s_deblk_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
 1058|  23.4M|                    ps_proc->s_deblk_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
 1059|  23.4M|                    ps_proc->s_deblk_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
 1060|  23.4M|                    ps_proc->s_deblk_ctxt.pu1_slice_idx = ps_proc->pu1_slice_idx;
 1061|  23.4M|                    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|  23.4M|                    {
 1065|  23.4M|                        WORD32 row;
 1066|  23.4M|                        WORD32 log2_ctb_size = ps_sps->i1_log2_ctb_size;
 1067|       |
 1068|       |                        /* Loop filter strd in units of num bits */
 1069|  23.4M|                        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|  23.4M|                        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|   131M|                        for(row = 0; row < (ctb_size >> 3) + 1; row++)
  ------------------
  |  Branch (1074:38): [True: 107M, False: 23.4M]
  ------------------
 1075|   107M|                        {
 1076|       |                            /* Go to the corresponding byte - read 32 bits and downshift */
 1077|   107M|                            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|   107M|                            bit_pos += loop_filter_strd;
 1079|   107M|                        }
 1080|  23.4M|                    }
 1081|       |
 1082|  23.4M|                    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|  23.4M|                    if(ps_proc->i4_ctb_x == ps_sps->i2_pic_wd_in_ctb - 1)
  ------------------
  |  Branch (1087:24): [True: 972k, False: 22.5M]
  ------------------
 1088|   972k|                    {
 1089|   972k|                        WORD32 i4_is_last_ctb_x = 1;
 1090|   972k|                        WORD32 i4_is_last_ctb_y = 0;
 1091|       |
 1092|   972k|                        WORD32 last_x_pos;
 1093|   972k|                        last_x_pos = (ps_sps->i2_pic_wd_in_ctb << ps_sps->i1_log2_ctb_size);
 1094|   972k|                        if(last_x_pos  ==  ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (1094:28): [True: 228k, False: 743k]
  ------------------
 1095|   228k|                        {
 1096|   228k|                            ihevcd_deblk_ctb(&ps_proc->s_deblk_ctxt, i4_is_last_ctb_x, i4_is_last_ctb_y);
 1097|   228k|                        }
 1098|   972k|                    }
 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|  23.4M|                    if(ps_proc->i4_ctb_y == ps_sps->i2_pic_ht_in_ctb - 1)
  ------------------
  |  Branch (1104:24): [True: 954k, False: 22.5M]
  ------------------
 1105|   954k|                    {
 1106|   954k|                        WORD32 i4_is_last_ctb_x = 0;
 1107|   954k|                        WORD32 i4_is_last_ctb_y = 1;
 1108|   954k|                        WORD32 last_y_pos;
 1109|   954k|                        last_y_pos = (ps_sps->i2_pic_ht_in_ctb << ps_sps->i1_log2_ctb_size);
 1110|   954k|                        if(last_y_pos == ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (1110:28): [True: 99.4k, False: 854k]
  ------------------
 1111|  99.4k|                        {
 1112|  99.4k|                            ihevcd_deblk_ctb(&ps_proc->s_deblk_ctxt, i4_is_last_ctb_x, i4_is_last_ctb_y);
 1113|  99.4k|                        }
 1114|   954k|                    }
 1115|  23.4M|                }
 1116|  23.4M|            }
 1117|       |
 1118|       |            /* Update proc map for deblk*/
 1119|  23.5M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
 1120|       |
 1121|  23.5M|            num_ctb_tmp -= nctb;
 1122|  23.5M|            ihevcd_ctb_pos_update(ps_proc, nctb);
 1123|  23.5M|        }
 1124|       |
 1125|  13.7M|        if(cur_slice_idx != ps_proc->i4_cur_slice_idx)
  ------------------
  |  Branch (1125:12): [True: 7.45k, False: 13.7M]
  ------------------
 1126|  7.45k|        {
 1127|  7.45k|            ps_proc->ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((cur_slice_idx)&(MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  7.45k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  7.45k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1128|  7.45k|            ps_proc->i4_cur_slice_idx = cur_slice_idx;
 1129|  7.45k|        }
 1130|       |        /* Restore the saved variables  */
 1131|  13.7M|        num_ctb_tmp = num_ctb;
 1132|  13.7M|        ps_proc->i4_ctb_x -= num_ctb;
 1133|  13.7M|        ps_proc->i4_ctb_tile_x = cur_ctb_tile_x;
 1134|  13.7M|        ps_proc->i4_ctb_tile_y = cur_ctb_tile_y;
 1135|  13.7M|        ps_proc->pu1_pu_map = pu1_pu_map_cur;
 1136|  13.7M|        ps_proc->ps_tu = ps_tu_cur;
 1137|  13.7M|        nxt_ctb_slice_y = ps_proc->i4_ctb_slice_y;
 1138|  13.7M|        nxt_ctb_slice_x = ps_proc->i4_ctb_slice_x;
 1139|  13.7M|        ps_proc->i4_ctb_slice_y = cur_ctb_slice_y;
 1140|  13.7M|        ps_proc->i4_ctb_slice_x = cur_ctb_slice_x;
 1141|  13.7M|        proc_type = PROC_SAO;
 1142|       |
 1143|  37.2M|        while(num_ctb_tmp)
  ------------------
  |  Branch (1143:15): [True: 23.5M, False: 13.7M]
  ------------------
 1144|  23.5M|        {
 1145|       |
 1146|       |
 1147|       |            /* Check proc map to ensure dependencies for SAO are met */
 1148|  23.5M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
 1149|       |
 1150|  23.5M|            ihevcd_slice_hdr_update(ps_proc);
 1151|       |
 1152|       |
 1153|       |
 1154|  23.5M|            {
 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|  23.5M|                if(0 == ps_codec->i4_disable_sao_pic)
  ------------------
  |  Branch (1158:20): [True: 23.5M, False: 18.4E]
  ------------------
 1159|  23.5M|                {
 1160|  23.5M|                    ps_proc->s_sao_ctxt.ps_pps = ps_proc->ps_pps;
 1161|  23.5M|                    ps_proc->s_sao_ctxt.ps_sps = ps_proc->ps_sps;
 1162|  23.5M|                    ps_proc->s_sao_ctxt.ps_tile = ps_proc->ps_tile;
 1163|  23.5M|                    ps_proc->s_sao_ctxt.ps_codec = ps_proc->ps_codec;
 1164|  23.5M|                    ps_proc->s_sao_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
 1165|  23.5M|                    ps_proc->s_sao_ctxt.i4_cur_slice_idx = ps_proc->i4_cur_slice_idx;
 1166|       |
 1167|       |
 1168|  23.5M|                    ps_proc->s_sao_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
 1169|  23.5M|                    ps_proc->s_sao_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
 1170|  23.5M|                    ps_proc->s_sao_ctxt.is_chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
 1171|       |
 1172|  23.5M|                    ihevcd_sao_shift_ctb(&ps_proc->s_sao_ctxt);
 1173|  23.5M|                }
 1174|       |
 1175|       |
 1176|       |                /* Call padding if required */
 1177|  23.5M|                {
 1178|  23.5M|                    chroma_row_strd = ps_codec->i4_strd * chroma_pixel_strd / h_samp_factor;
 1179|       |
 1180|       |
 1181|  23.5M|                    if(0 == ps_proc->i4_ctb_x)
  ------------------
  |  Branch (1181:24): [True: 972k, False: 22.5M]
  ------------------
 1182|   972k|                    {
 1183|   972k|                        WORD32 pad_ht_luma;
 1184|   972k|                        WORD32 pad_ht_chroma;
 1185|       |
 1186|   972k|                        ps_proc->pu1_cur_ctb_luma = ps_proc->pu1_cur_pic_luma
 1187|   972k|                                        + (ps_proc->i4_ctb_x * ctb_size
 1188|   972k|                                        + ps_proc->i4_ctb_y * ctb_size
 1189|   972k|                                        * ps_codec->i4_strd) * ps_codec->i4_pixel_size_y;
 1190|       |
 1191|   972k|                        pad_ht_luma = ctb_size;
 1192|   972k|                        pad_ht_luma += (ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y ? 8 : 0;
  ------------------
  |  Branch (1192:40): [True: 72.9k, False: 899k]
  ------------------
 1193|       |                        /* Pad left after 1st CTB is processed */
 1194|   972k|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   972k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1194:28): [True: 813k, False: 158k]
  ------------------
 1195|   813k|                        {
 1196|   813k|                            ps_codec->s_func_selector.ihevc_pad_left_luma_fptr(ps_proc->pu1_cur_ctb_luma - 8 * ps_codec->i4_strd,
 1197|   813k|                                ps_codec->i4_strd, pad_ht_luma, PAD_LEFT);
  ------------------
  |  |   82|   813k|#define PAD_LEFT    80
  ------------------
 1198|   813k|                        }
 1199|   158k|                        else
 1200|   158k|                        {
 1201|   158k|                            ps_codec->s_func_selector.ihevc_hbd_pad_left_luma_fptr((UWORD16 *)ps_proc->pu1_cur_ctb_luma - 8 * ps_codec->i4_strd,
 1202|   158k|                                ps_codec->i4_strd, pad_ht_luma, PAD_LEFT);
  ------------------
  |  |   82|   158k|#define PAD_LEFT    80
  ------------------
 1203|   158k|                        }
 1204|   972k|                        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1204:28): [True: 966k, False: 5.83k]
  ------------------
 1205|   966k|                        {
 1206|   966k|                            ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma
 1207|   966k|                                            + ((ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor)
 1208|   966k|                                            + (ps_proc->i4_ctb_y * ctb_size * chroma_row_strd / v_samp_factor)) * ps_codec->i4_pixel_size_uv;
 1209|   966k|                            pad_ht_chroma = ctb_size / v_samp_factor;
 1210|   966k|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|   966k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1210:32): [True: 809k, False: 157k]
  ------------------
 1211|   809k|                            {
 1212|   809k|                                ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(
 1213|   809k|                                                ps_proc->pu1_cur_ctb_chroma - (8 * v_samp_factor) * chroma_row_strd,
 1214|   809k|                                                chroma_row_strd, pad_ht_chroma, PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|   809k|#define PAD_LEFT    80
  ------------------
 1215|   809k|                            }
 1216|   157k|                            else
 1217|   157k|                            {
 1218|   157k|                                ps_codec->s_func_selector.ihevc_hbd_pad_left_chroma_fptr(
 1219|   157k|                                                (UWORD16 *)ps_proc->pu1_cur_ctb_chroma - (8 * v_samp_factor) * chroma_row_strd,
 1220|   157k|                                                chroma_row_strd, pad_ht_chroma, PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|   157k|#define PAD_LEFT    80
  ------------------
 1221|   157k|                            }
 1222|   966k|                        }
 1223|   972k|                    }
 1224|       |
 1225|  23.5M|                    if((ps_sps->i2_pic_wd_in_ctb - 1) == ps_proc->i4_ctb_x)
  ------------------
  |  Branch (1225:24): [True: 972k, False: 22.5M]
  ------------------
 1226|   972k|                    {
 1227|   972k|                        WORD32 pad_ht_luma;
 1228|   972k|                        WORD32 pad_ht_chroma;
 1229|   972k|                        WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size);
 1230|       |
 1231|   972k|                        ps_proc->pu1_cur_ctb_luma = ps_proc->pu1_cur_pic_luma
 1232|   972k|                                        + (ps_proc->i4_ctb_x * ctb_size
 1233|   972k|                                        + ps_proc->i4_ctb_y * ctb_size
 1234|   972k|                                        * ps_codec->i4_strd) * ps_codec->i4_pixel_size_y;
 1235|   972k|                        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1235:28): [True: 966k, False: 5.83k]
  ------------------
 1236|   966k|                        {
 1237|   966k|                            ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma
 1238|   966k|                                            + ((ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor)
 1239|   966k|                                            + (ps_proc->i4_ctb_y * ctb_size * chroma_row_strd / v_samp_factor)) * ps_codec->i4_pixel_size_uv;
 1240|   966k|                            pad_ht_chroma = ctb_size / v_samp_factor;
 1241|   966k|                        }
 1242|   972k|                        pad_ht_luma = ctb_size;
 1243|   972k|                        if((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y)
  ------------------
  |  Branch (1243:28): [True: 72.9k, False: 899k]
  ------------------
 1244|  72.9k|                        {
 1245|  72.9k|                            pad_ht_luma += 8;
 1246|  72.9k|                            if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1246:33): [True: 72.1k, False: 781]
  ------------------
 1247|  72.1k|                            {
 1248|  72.1k|                                pad_ht_chroma += (8 * v_samp_factor);
 1249|  72.1k|                                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  72.1k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1249:36): [True: 47.0k, False: 25.1k]
  ------------------
 1250|  47.0k|                                {
 1251|  47.0k|                                    ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(
 1252|  47.0k|                                                    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|  47.0k|                                                    chroma_row_strd, (8 * v_samp_factor),
 1254|  47.0k|                                                    PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|  47.0k|#define PAD_LEFT    80
  ------------------
 1255|  47.0k|                                }
 1256|  25.1k|                                else
 1257|  25.1k|                                {
 1258|  25.1k|                                    ps_codec->s_func_selector.ihevc_hbd_pad_left_chroma_fptr(
 1259|  25.1k|                                                    (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|  25.1k|                                                    chroma_row_strd, (8 * v_samp_factor),
 1261|  25.1k|                                                    PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|  25.1k|#define PAD_LEFT    80
  ------------------
 1262|  25.1k|                                }
 1263|  72.1k|                            }
 1264|  72.9k|                        }
 1265|       |                        /* Pad right after last CTB in the current row is processed */
 1266|   972k|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   972k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1266:28): [True: 813k, False: 158k]
  ------------------
 1267|   813k|                        {
 1268|   813k|                            ps_codec->s_func_selector.ihevc_pad_right_luma_fptr(
 1269|   813k|                                ps_proc->pu1_cur_ctb_luma + cols_remaining - 8 * ps_codec->i4_strd,
 1270|   813k|                                ps_codec->i4_strd, pad_ht_luma, PAD_RIGHT);
  ------------------
  |  |   87|   813k|#define PAD_RIGHT   80
  ------------------
 1271|   813k|                        }
 1272|   158k|                        else
 1273|   158k|                        {
 1274|   158k|                            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|   158k|                                ps_codec->i4_strd, pad_ht_luma, PAD_RIGHT);
  ------------------
  |  |   87|   158k|#define PAD_RIGHT   80
  ------------------
 1276|   158k|                        }
 1277|   972k|                        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1277:28): [True: 966k, False: 5.83k]
  ------------------
 1278|   966k|                        {
 1279|   966k|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|   966k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1279:32): [True: 809k, False: 157k]
  ------------------
 1280|   809k|                            {
 1281|   809k|                                 ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr(
 1282|   809k|                                                ps_proc->pu1_cur_ctb_chroma + (cols_remaining * chroma_pixel_strd / h_samp_factor) - (8 * v_samp_factor) * chroma_row_strd,
 1283|   809k|                                                chroma_row_strd, pad_ht_chroma,
 1284|   809k|                                                PAD_RIGHT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   87|   809k|#define PAD_RIGHT   80
  ------------------
 1285|   809k|                            }
 1286|   157k|                            else
 1287|   157k|                            {
 1288|   157k|                                ihevc_hbd_pad_right_chroma(
 1289|   157k|                                                (UWORD16 *)ps_proc->pu1_cur_ctb_chroma + (cols_remaining * chroma_pixel_strd / h_samp_factor) - (8 * v_samp_factor) * chroma_row_strd,
 1290|   157k|                                                chroma_row_strd, pad_ht_chroma,
 1291|   157k|                                                PAD_RIGHT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   87|   157k|#define PAD_RIGHT   80
  ------------------
 1292|   157k|                            }
 1293|   966k|                        }
 1294|       |
 1295|   972k|                        if((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y)
  ------------------
  |  Branch (1295:28): [True: 72.9k, False: 899k]
  ------------------
 1296|  72.9k|                        {
 1297|  72.9k|                            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|  72.9k|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  72.9k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1301:32): [True: 47.4k, False: 25.4k]
  ------------------
 1302|  47.4k|                            {
 1303|  47.4k|                                ihevc_pad_top(ps_proc->pu1_cur_pic_luma - PAD_LEFT, ps_codec->i4_strd,
  ------------------
  |  |   82|  47.4k|#define PAD_LEFT    80
  ------------------
 1304|  47.4k|                                    ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   91|  47.4k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  47.4k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  47.4k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                  ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   72|  47.4k|#define PAD_TOP     80
  ------------------
 1305|  47.4k|                            }
 1306|  25.4k|                            else
 1307|  25.4k|                            {
 1308|  25.4k|                                ihevc_hbd_pad_top((UWORD16 *)ps_proc->pu1_cur_pic_luma - PAD_LEFT, ps_codec->i4_strd,
  ------------------
  |  |   82|  25.4k|#define PAD_LEFT    80
  ------------------
 1309|  25.4k|                                    ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   91|  25.4k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  25.4k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  25.4k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                  ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   72|  25.4k|#define PAD_TOP     80
  ------------------
 1310|  25.4k|                            }
 1311|  72.9k|                            if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1311:32): [True: 72.1k, False: 781]
  ------------------
 1312|  72.1k|                            {
 1313|  72.1k|                                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  72.1k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1313:36): [True: 47.0k, False: 25.1k]
  ------------------
 1314|  47.0k|                                {
 1315|  47.0k|                                     ihevc_pad_top(ps_proc->pu1_cur_pic_chroma - PAD_LEFT * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   82|  47.0k|#define PAD_LEFT    80
  ------------------
 1316|  47.0k|                                                  chroma_row_strd,
 1317|  47.0k|                                                  (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  47.0k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  47.0k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  47.0k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1318|  47.0k|                                                  PAD_TOP / v_samp_factor);
  ------------------
  |  |   72|  47.0k|#define PAD_TOP     80
  ------------------
 1319|  47.0k|                                }
 1320|  25.1k|                                else
 1321|  25.1k|                                {
 1322|  25.1k|                                    ihevc_hbd_pad_top((UWORD16 *)ps_proc->pu1_cur_pic_chroma - PAD_LEFT * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   82|  25.1k|#define PAD_LEFT    80
  ------------------
 1323|  25.1k|                                                      chroma_row_strd,
 1324|  25.1k|                                                      (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  25.1k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  25.1k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  25.1k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1325|  25.1k|                                                      PAD_TOP / v_samp_factor);
  ------------------
  |  |   72|  25.1k|#define PAD_TOP     80
  ------------------
 1326|  25.1k|                                }
 1327|  72.1k|                            }
 1328|       |
 1329|       |                            /* Pad bottom after padding left and right for current rows after processing 1st CTB row */
 1330|  72.9k|                            pu1_buf = ps_proc->pu1_cur_pic_luma +
 1331|  72.9k|                                (ps_codec->i4_strd * ps_sps->i2_pic_height_in_luma_samples - PAD_LEFT) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |   82|  72.9k|#define PAD_LEFT    80
  ------------------
 1332|  72.9k|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  72.9k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1332:32): [True: 47.4k, False: 25.4k]
  ------------------
 1333|  47.4k|                            {
 1334|  47.4k|                                ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd,
 1335|  47.4k|                                                 ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   91|  47.4k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  47.4k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  47.4k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                               ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   77|  47.4k|#define PAD_BOT     80
  ------------------
 1336|  47.4k|                            }
 1337|  25.4k|                            else
 1338|  25.4k|                            {
 1339|  25.4k|                                ihevc_hbd_pad_bottom((UWORD16 *)pu1_buf, ps_codec->i4_strd,
 1340|  25.4k|                                                     ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   91|  25.4k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  25.4k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  25.4k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                                   ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   77|  25.4k|#define PAD_BOT     80
  ------------------
 1341|  25.4k|                            }
 1342|  72.9k|                            if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1342:32): [True: 72.1k, False: 781]
  ------------------
 1343|  72.1k|                            {
 1344|  72.1k|                                pu1_buf = ps_proc->pu1_cur_pic_chroma
 1345|  72.1k|                                                + (chroma_row_strd * (ps_sps->i2_pic_height_in_luma_samples / v_samp_factor)
 1346|  72.1k|                                                - (PAD_LEFT * chroma_pixel_strd / h_samp_factor)) * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |   82|  72.1k|#define PAD_LEFT    80
  ------------------
 1347|  72.1k|                                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  72.1k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1347:36): [True: 47.0k, False: 25.1k]
  ------------------
 1348|  47.0k|                                {
 1349|  47.0k|                                     ihevc_pad_bottom(pu1_buf,
 1350|  47.0k|                                                     chroma_row_strd,
 1351|  47.0k|                                                     (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  47.0k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  47.0k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  47.0k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1352|  47.0k|                                                     PAD_BOT / v_samp_factor);
  ------------------
  |  |   77|  47.0k|#define PAD_BOT     80
  ------------------
 1353|  47.0k|                                }
 1354|  25.1k|                                else
 1355|  25.1k|                                {
 1356|  25.1k|                                    ihevc_hbd_pad_bottom((UWORD16 *)pu1_buf,
 1357|  25.1k|                                                         chroma_row_strd,
 1358|  25.1k|                                                         (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  25.1k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  25.1k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  25.1k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1359|  25.1k|                                                         PAD_BOT / v_samp_factor);
  ------------------
  |  |   77|  25.1k|#define PAD_BOT     80
  ------------------
 1360|  25.1k|                                 }
 1361|  72.1k|                            }
 1362|  72.9k|                        }
 1363|   972k|                    }
 1364|       |
 1365|  23.5M|                }
 1366|  23.5M|            }
 1367|       |
 1368|       |
 1369|       |            /* Update proc map for SAO*/
 1370|  23.5M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
 1371|       |            /* Update proc map for Completion of CTB*/
 1372|  23.5M|            ihevcd_proc_map_update(ps_proc, PROC_ALL, nctb);
 1373|  23.5M|            {
 1374|  23.5M|                tile_t *ps_tile;
 1375|       |
 1376|  23.5M|                ps_tile = ps_proc->ps_tile;
 1377|  23.5M|                num_ctb_tmp -= nctb;
 1378|       |
 1379|  23.5M|                ps_proc->i4_ctb_tile_x += nctb;
 1380|  23.5M|                ps_proc->i4_ctb_x += nctb;
 1381|       |
 1382|  23.5M|                ps_proc->i4_ctb_slice_x += nctb;
 1383|       |
 1384|       |
 1385|       |                /* Update tile counters */
 1386|  23.5M|                if(ps_proc->i4_ctb_tile_x >= (ps_tile->u2_wd))
  ------------------
  |  Branch (1386:20): [True: 1.92M, False: 21.6M]
  ------------------
 1387|  1.92M|                {
 1388|       |                    /*End of tile row*/
 1389|  1.92M|                    ps_proc->i4_ctb_tile_x = 0;
 1390|  1.92M|                    ps_proc->i4_ctb_x = ps_tile->u1_pos_x;
 1391|       |
 1392|  1.92M|                    ps_proc->i4_ctb_tile_y++;
 1393|  1.92M|                    ps_proc->i4_ctb_y++;
 1394|  1.92M|                    if(ps_proc->i4_ctb_tile_y == ps_tile->u2_ht)
  ------------------
  |  Branch (1394:24): [True: 153k, False: 1.77M]
  ------------------
 1395|   153k|                    {
 1396|       |                        /* Reached End of Tile */
 1397|   153k|                        ps_proc->i4_ctb_tile_y = 0;
 1398|   153k|                        ps_proc->i4_ctb_tile_x = 0;
 1399|   153k|                        ps_proc->ps_tile++;
 1400|       |                        //End of picture
 1401|   153k|                        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: 86.6k, False: 67.0k]
  |  Branch (1401:100): [True: 72.9k, False: 13.7k]
  ------------------
 1402|  80.7k|                        {
 1403|  80.7k|                            ps_tile = ps_proc->ps_tile;
 1404|  80.7k|                            ps_proc->i4_ctb_x = ps_tile->u1_pos_x;
 1405|  80.7k|                            ps_proc->i4_ctb_y = ps_tile->u1_pos_y;
 1406|       |
 1407|  80.7k|                        }
 1408|   153k|                    }
 1409|  1.92M|                }
 1410|  23.5M|            }
 1411|  23.5M|        }
 1412|       |
 1413|  13.7M|        ps_proc->i4_ctb_cnt -= num_ctb;
 1414|  13.7M|    }
 1415|  1.92M|    return ret;
 1416|  1.92M|}
ihevcd_init_proc_ctxt:
 1419|  1.93M|{
 1420|  1.93M|    codec_t *ps_codec;
 1421|  1.93M|    slice_header_t *ps_slice_hdr;
 1422|  1.93M|    pps_t *ps_pps;
 1423|  1.93M|    sps_t *ps_sps;
 1424|  1.93M|    tile_t *ps_tile, *ps_tile_prev;
 1425|  1.93M|    WORD32 tile_idx;
 1426|  1.93M|    WORD32 ctb_size;
 1427|  1.93M|    WORD32 num_minpu_in_ctb;
 1428|  1.93M|    WORD32 num_ctb_in_row;
 1429|  1.93M|    WORD32 ctb_addr;
 1430|  1.93M|    WORD32 i4_wd_in_ctb;
 1431|  1.93M|    WORD32 tile_start_ctb_idx;
 1432|  1.93M|    WORD32 slice_start_ctb_idx;
 1433|  1.93M|    WORD32 check_tile_wd;
 1434|  1.93M|    WORD32 continuous_tiles = 0; //Refers to tiles that are continuous, within a slice, horizontally
 1435|       |
 1436|  1.93M|    ps_codec = ps_proc->ps_codec;
 1437|       |
 1438|  1.93M|    ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((ps_proc->i4_cur_slice_idx) & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  1.93M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  1.93M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1439|  1.93M|    ps_proc->ps_slice_hdr = ps_slice_hdr;
 1440|  1.93M|    ps_proc->ps_pps = ps_codec->ps_pps_base + ps_slice_hdr->i1_pps_id;
 1441|  1.93M|    ps_pps = ps_proc->ps_pps;
 1442|  1.93M|    ps_proc->ps_sps = ps_codec->ps_sps_base + ps_pps->i1_sps_id;
 1443|  1.93M|    ps_sps = ps_proc->ps_sps;
 1444|  1.93M|    ps_proc->i4_init_done = 1;
 1445|  1.93M|    ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 1446|  1.93M|    num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.93M|#define MIN_PU_SIZE         4
  ------------------
                  num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.93M|#define MIN_PU_SIZE         4
  ------------------
 1447|  1.93M|    num_ctb_in_row = ps_sps->i2_pic_wd_in_ctb;
 1448|       |
 1449|  1.93M|    ps_proc->s_sao_ctxt.pu1_slice_idx = ps_proc->pu1_slice_idx;
 1450|       |
 1451|  1.93M|    ihevcd_get_tile_pos(ps_pps, ps_sps, ps_proc->i4_ctb_x, ps_proc->i4_ctb_y,
 1452|  1.93M|                        &ps_proc->i4_ctb_tile_x, &ps_proc->i4_ctb_tile_y,
 1453|  1.93M|                        &tile_idx);
 1454|       |
 1455|  1.93M|    ps_proc->ps_tile = ps_pps->ps_tile + tile_idx;
 1456|  1.93M|    ps_proc->i4_cur_tile_idx = tile_idx;
 1457|  1.93M|    ps_tile = ps_proc->ps_tile;
 1458|       |
 1459|  1.93M|    if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1459:8): [True: 1.09M, False: 840k]
  ------------------
 1460|  1.09M|    {
 1461|  1.09M|        if(tile_idx)
  ------------------
  |  Branch (1461:12): [True: 1.04M, False: 54.5k]
  ------------------
 1462|  1.04M|            ps_tile_prev = ps_tile - 1;
 1463|  54.5k|        else
 1464|  54.5k|            ps_tile_prev = ps_tile;
 1465|       |
 1466|  1.09M|        slice_start_ctb_idx = ps_slice_hdr->i2_ctb_x + (ps_slice_hdr->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb);
 1467|  1.09M|        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|  1.09M|        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: 143k, False: 952k]
  |  Branch (1473:62): [True: 82.5k, False: 61.0k]
  ------------------
 1474|  82.5k|        {
 1475|  82.5k|            continuous_tiles = 1;
 1476|  82.5k|        }
 1477|  1.01M|        else
 1478|  1.01M|        {
 1479|  1.01M|            check_tile_wd = ps_slice_hdr->i2_ctb_x + ps_tile_prev->u2_wd;
 1480|  1.01M|            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: 29.9k, False: 983k]
  |  Branch (1480:66): [True: 24.5k, False: 5.45k]
  ------------------
 1481|   989k|                                            || ((ps_slice_hdr->i2_ctb_x == ps_tile->u1_pos_x))))
  ------------------
  |  Branch (1481:48): [True: 37.1k, False: 952k]
  ------------------
 1482|   952k|            {
 1483|   952k|                continuous_tiles = 1;
 1484|   952k|            }
 1485|  1.01M|        }
 1486|       |
 1487|  1.09M|        {
 1488|  1.09M|            WORD32 i2_independent_ctb_x = ps_slice_hdr->i2_independent_ctb_x;
 1489|  1.09M|            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|  1.09M|            if(ps_proc->i4_ctb_x >= i2_independent_ctb_x)
  ------------------
  |  Branch (1495:16): [True: 1.01M, False: 76.9k]
  ------------------
 1496|  1.01M|            {
 1497|  1.01M|                ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_x - i2_independent_ctb_x;
 1498|  1.01M|            }
 1499|  76.9k|            else
 1500|  76.9k|            {
 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|  76.9k|                if((slice_start_ctb_idx < tile_start_ctb_idx) && (continuous_tiles))
  ------------------
  |  Branch (1505:20): [True: 69.7k, False: 7.22k]
  |  Branch (1505:66): [True: 69.0k, False: 705]
  ------------------
 1506|  69.0k|                {
 1507|  69.0k|                    i4_wd_in_ctb = ps_sps->i2_pic_wd_in_ctb;
 1508|  69.0k|                }
 1509|       |                /* Indicates many-tiles-in-one-slice case, for slices that end without spanning the frame width*/
 1510|  7.92k|                else
 1511|  7.92k|                {
 1512|  7.92k|                    i4_wd_in_ctb = ps_tile->u2_wd;
 1513|  7.92k|                }
 1514|       |
 1515|  76.9k|                if(continuous_tiles)
  ------------------
  |  Branch (1515:20): [True: 70.3k, False: 6.59k]
  ------------------
 1516|  70.3k|                {
 1517|  70.3k|                    ps_proc->i4_ctb_slice_x = i4_wd_in_ctb
 1518|  70.3k|                                    - (i2_independent_ctb_x - ps_proc->i4_ctb_x);
 1519|  70.3k|                }
 1520|  6.59k|                else
 1521|  6.59k|                {
 1522|  6.59k|                    ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_x - ps_tile->u1_pos_x;
 1523|  6.59k|                }
 1524|  76.9k|            }
 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|  1.09M|            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|  1.09M|            if((0 == ps_proc->i4_ctb_tile_x) && (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (1531:16): [True: 1.09M, False: 18.4E]
  |  Branch (1531:49): [True: 89.4k, False: 1.00M]
  ------------------
 1532|  89.4k|            {
 1533|  89.4k|                if(ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (1533:20): [True: 3.29k, False: 86.1k]
  ------------------
 1534|  3.29k|                {
 1535|  3.29k|                    ps_proc->i4_ctb_slice_x = 0;
 1536|  3.29k|                    ps_proc->i4_ctb_slice_y = 0;
 1537|  3.29k|                }
 1538|       |                /*For slices that span across multiple tiles*/
 1539|  86.1k|                else if(slice_start_ctb_idx < tile_start_ctb_idx)
  ------------------
  |  Branch (1539:25): [True: 76.0k, False: 10.1k]
  ------------------
 1540|  76.0k|                {
 1541|  76.0k|                    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|  76.0k|                    if(continuous_tiles) //Case 2-implemented for slices that span not more than 2 tiles
  ------------------
  |  Branch (1547:24): [True: 75.9k, False: 74]
  ------------------
 1548|  75.9k|                    {
 1549|  75.9k|                        if(i2_independent_ctb_y <= ps_tile->u1_pos_y)
  ------------------
  |  Branch (1549:28): [True: 68.4k, False: 7.54k]
  ------------------
 1550|  68.4k|                        {
 1551|       |                            //Check if ctb x is before or after
 1552|  68.4k|                            if(i2_independent_ctb_x > ps_tile->u1_pos_x)
  ------------------
  |  Branch (1552:32): [True: 2.34k, False: 66.0k]
  ------------------
 1553|  2.34k|                            {
 1554|  2.34k|                                ps_proc->i4_ctb_slice_y -= 1;
 1555|  2.34k|                            }
 1556|  68.4k|                        }
 1557|  75.9k|                    }
 1558|  76.0k|                }
 1559|  89.4k|            }
 1560|       |            //Slice starts from a column which is not the starting tile-column, but is within the tile
 1561|  1.09M|            if(((i2_independent_ctb_x - ps_tile->u1_pos_x) != 0) && ((ps_proc->i4_ctb_slice_y != 0))
  ------------------
  |  Branch (1561:16): [True: 968k, False: 127k]
  |  Branch (1561:69): [True: 952k, False: 15.5k]
  ------------------
 1562|   952k|                            && ((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: 74.5k, False: 878k]
  |  Branch (1562:80): [True: 15.3k, False: 59.1k]
  ------------------
 1563|  15.3k|            {
 1564|  15.3k|                ps_proc->i4_ctb_slice_y -= 1;
 1565|  15.3k|            }
 1566|  1.09M|        }
 1567|  1.09M|    }
 1568|   840k|    else
 1569|   840k|    {
 1570|   840k|        WORD32 i2_independent_ctb_x = ps_slice_hdr->i2_independent_ctb_x;
 1571|   840k|        WORD32 i2_independent_ctb_y = ps_slice_hdr->i2_independent_ctb_y;
 1572|       |
 1573|       |
 1574|   840k|        {
 1575|   840k|            ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_x - i2_independent_ctb_x;
 1576|   840k|            ps_proc->i4_ctb_slice_y = ps_proc->i4_ctb_y - i2_independent_ctb_y;
 1577|   840k|            if(ps_proc->i4_ctb_slice_x < 0)
  ------------------
  |  Branch (1577:16): [True: 93.7k, False: 746k]
  ------------------
 1578|  93.7k|            {
 1579|  93.7k|                ps_proc->i4_ctb_slice_x += ps_sps->i2_pic_wd_in_ctb;
 1580|  93.7k|                ps_proc->i4_ctb_slice_y -= 1;
 1581|  93.7k|            }
 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|   840k|        }
 1586|   840k|    }
 1587|       |
 1588|       |    /* Compute TU offset for the current CTB set */
 1589|  1.93M|    {
 1590|       |
 1591|  1.93M|        WORD32 ctb_luma_min_tu_cnt;
 1592|  1.93M|        WORD32 ctb_addr;
 1593|       |
 1594|  1.93M|        ctb_addr = ps_proc->i4_ctb_y * num_ctb_in_row + ps_proc->i4_ctb_x;
 1595|       |
 1596|  1.93M|        ctb_luma_min_tu_cnt = (1 << ps_sps->i1_log2_ctb_size) / MIN_TU_SIZE;
  ------------------
  |  |  358|  1.93M|#define MIN_TU_SIZE         4
  ------------------
 1597|  1.93M|        ctb_luma_min_tu_cnt *= ctb_luma_min_tu_cnt;
 1598|       |
 1599|  1.93M|        ps_proc->pu1_tu_map = ps_proc->pu1_pic_tu_map
 1600|  1.93M|                        + ctb_luma_min_tu_cnt * ctb_addr;
 1601|  1.93M|        if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (1601:12): [True: 506k, False: 1.43M]
  ------------------
 1602|   506k|        {
 1603|   506k|            ps_proc->ps_tu = ps_proc->ps_pic_tu + ps_proc->pu4_pic_tu_idx[ctb_addr % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|   506k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   506k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   506k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   506k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   506k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   506k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|   506k|        }
 1605|  1.43M|        else
 1606|  1.43M|        {
 1607|  1.43M|            ps_proc->ps_tu = ps_proc->ps_pic_tu + ps_proc->pu4_pic_tu_idx[ctb_addr];
 1608|  1.43M|        }
 1609|  1.93M|        ps_proc->pv_tu_coeff_data = (UWORD8 *)ps_proc->pv_pic_tu_coeff_data
 1610|  1.93M|                        + tu_coeff_data_ofst;
 1611|       |
 1612|  1.93M|    }
 1613|       |
 1614|       |    /* Compute PU related elements for the current CTB set */
 1615|  1.93M|    {
 1616|  1.93M|        WORD32 pu_idx;
 1617|  1.93M|        ctb_addr = ps_proc->i4_ctb_y * num_ctb_in_row + ps_proc->i4_ctb_x;
 1618|  1.93M|        pu_idx = ps_proc->pu4_pic_pu_idx[ctb_addr];
 1619|  1.93M|        ps_proc->pu1_pu_map = ps_proc->pu1_pic_pu_map
 1620|  1.93M|                        + ctb_addr * num_minpu_in_ctb;
 1621|  1.93M|        ps_proc->ps_pu = ps_proc->ps_pic_pu + pu_idx;
 1622|  1.93M|    }
 1623|       |
 1624|       |    /* Number of ctbs processed in one loop of process function */
 1625|  1.93M|    {
 1626|  1.93M|        ps_proc->i4_nctb = MIN(ps_codec->u4_nctb, ps_tile->u2_wd);
  ------------------
  |  |   43|  1.93M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 1.93M]
  |  |  ------------------
  ------------------
 1627|  1.93M|    }
 1628|       |
 1629|  1.93M|}
ihevcd_process_thread:
 1631|  27.3k|{
 1632|  27.3k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1633|  27.3k|    {
 1634|  27.3k|        ithread_set_affinity(ps_proc->i4_id + 1);
 1635|  27.3k|    }
 1636|       |
 1637|   128k|    while(1)
  ------------------
  |  Branch (1637:11): [True: 128k, Folded]
  ------------------
 1638|   128k|    {
 1639|   128k|        codec_t *ps_dec = ps_proc->ps_codec;
 1640|   128k|        if(ps_proc->ps_codec->i4_threads_active)
  ------------------
  |  Branch (1640:12): [True: 128k, False: 18.4E]
  ------------------
 1641|   128k|        {
 1642|   128k|            DEBUG("In ihevcd_process_thread \n");
  ------------------
  |  |   49|   128k|#define DEBUG(...) {}
  ------------------
 1643|       |
 1644|   128k|            ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[ps_proc->i4_id]);
 1645|   128k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1645:16): [True: 0, False: 128k]
  ------------------
 1646|      0|                break;
 1647|       |
 1648|   228k|            while(!ps_dec->ai4_process_start[ps_proc->i4_id])
  ------------------
  |  Branch (1648:19): [True: 100k, False: 128k]
  ------------------
 1649|   100k|            {
 1650|   100k|                ithread_cond_wait(ps_dec->apv_proc_start_condition[ps_proc->i4_id],
 1651|   100k|                                  ps_dec->apv_proc_start_mutex[ps_proc->i4_id]);
 1652|   100k|            }
 1653|   128k|            ps_dec->ai4_process_start[ps_proc->i4_id] = 0;
 1654|   128k|            ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[ps_proc->i4_id]);
 1655|   128k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1655:16): [True: 0, False: 128k]
  ------------------
 1656|      0|                break;
 1657|       |
 1658|   128k|            DEBUG(" Got control at ihevcd_process_thread \n");
  ------------------
  |  |   49|   128k|#define DEBUG(...) {}
  ------------------
 1659|       |
 1660|   128k|            if(ps_dec->i4_break_threads == 1)
  ------------------
  |  Branch (1660:16): [True: 27.3k, False: 100k]
  ------------------
 1661|  27.3k|                break;
 1662|   128k|        }
 1663|  1.44M|        while(1)
  ------------------
  |  Branch (1663:15): [True: 1.44M, Folded]
  ------------------
 1664|  1.44M|        {
 1665|  1.44M|            proc_job_t s_job;
 1666|       |
 1667|  1.44M|            ret = ihevcd_jobq_dequeue((jobq_t *)ps_proc->pv_proc_jobq, &s_job,
 1668|  1.44M|                                    sizeof(proc_job_t), 1);
 1669|  1.44M|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1669:16): [True: 100k, False: 1.34M]
  ------------------
 1670|   100k|                break;
 1671|       |
 1672|  1.34M|            ps_proc->i4_ctb_cnt = s_job.i2_ctb_cnt;
 1673|  1.34M|            ps_proc->i4_ctb_x = s_job.i2_ctb_x;
 1674|  1.34M|            ps_proc->i4_ctb_y = s_job.i2_ctb_y;
 1675|  1.34M|            ps_proc->i4_cur_slice_idx = s_job.i2_slice_idx;
 1676|       |
 1677|       |
 1678|       |
 1679|  1.34M|            if(CMD_PROCESS == s_job.i4_cmd)
  ------------------
  |  Branch (1679:16): [True: 956k, False: 386k]
  ------------------
 1680|   956k|            {
 1681|   956k|                ihevcd_init_proc_ctxt(ps_proc, s_job.i4_tu_coeff_data_ofst);
 1682|   956k|                ihevcd_process(ps_proc);
 1683|   956k|            }
 1684|   386k|            else if(CMD_FMTCONV == s_job.i4_cmd)
  ------------------
  |  Branch (1684:21): [True: 393k, False: 18.4E]
  ------------------
 1685|   393k|            {
 1686|   393k|                sps_t *ps_sps;
 1687|   393k|                codec_t *ps_codec;
 1688|   393k|                ivd_out_bufdesc_t *ps_out_buffer;
 1689|   393k|                WORD32 num_rows;
 1690|       |
 1691|   393k|                if(0 == ps_proc->i4_init_done)
  ------------------
  |  Branch (1691:20): [True: 3.76k, False: 389k]
  ------------------
 1692|  3.76k|                {
 1693|  3.76k|                    ihevcd_init_proc_ctxt(ps_proc, 0);
 1694|  3.76k|                }
 1695|   393k|                ps_sps = ps_proc->ps_sps;
 1696|   393k|                ps_codec = ps_proc->ps_codec;
 1697|   393k|                ps_out_buffer = ps_proc->ps_out_buffer;
 1698|   393k|                num_rows = 1 << ps_sps->i1_log2_ctb_size;
 1699|       |
 1700|   393k|                num_rows = MIN(num_rows,
  ------------------
  |  |   43|   393k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 363k, False: 30.3k]
  |  |  ------------------
  ------------------
 1701|   393k|                               (ps_codec->i4_disp_ht - (s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size))
 1702|   393k|                              );
 1703|       |
 1704|   393k|                if(num_rows < 0)
  ------------------
  |  Branch (1704:20): [True: 777, False: 392k]
  ------------------
 1705|    777|                    num_rows = 0;
 1706|       |
 1707|   393k|                ihevcd_fmt_conv(ps_proc->ps_codec, ps_proc, ps_out_buffer->pu1_bufs[0],
 1708|   393k|                                ps_out_buffer->pu1_bufs[1], ps_out_buffer->pu1_bufs[2],
 1709|   393k|                                s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size, num_rows);
 1710|   393k|            }
 1711|  1.34M|        }
 1712|   100k|        if(ps_proc->ps_codec->i4_threads_active)
  ------------------
  |  Branch (1712:12): [True: 100k, False: 18.4E]
  ------------------
 1713|   100k|        {
 1714|   100k|            ret = ithread_mutex_lock(ps_dec->apv_proc_done_mutex[ps_proc->i4_id]);
 1715|   100k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1715:16): [True: 0, False: 100k]
  ------------------
 1716|      0|                break;
 1717|       |
 1718|   100k|            ps_dec->ai4_process_done[ps_proc->i4_id] = 1;
 1719|   100k|            ithread_cond_signal(ps_dec->apv_proc_done_condition[ps_proc->i4_id]);
 1720|       |
 1721|   100k|            ret = ithread_mutex_unlock(ps_dec->apv_proc_done_mutex[ps_proc->i4_id]);
 1722|   100k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1722:16): [True: 0, False: 100k]
  ------------------
 1723|      0|                break;
 1724|   100k|        }
 1725|  18.4E|        else
 1726|  18.4E|        {
 1727|  18.4E|            break;
 1728|  18.4E|        }
 1729|   100k|    }
 1730|       |    //ithread_exit(0);
 1731|  27.3k|    return;
 1732|  27.3k|}

ihevcd_mv_mgr_get_poc:
   74|  81.7k|{
   75|  81.7k|    UWORD32 i;
   76|  81.7k|    mv_buf_t *ps_mv_buf = NULL;
   77|       |
   78|       |
   79|       |
   80|   141k|    for(i = 0; i < ps_mv_buf_mgr->u4_max_buf_cnt; i++)
  ------------------
  |  Branch (80:16): [True: 141k, False: 0]
  ------------------
   81|   141k|    {
   82|   141k|        ps_mv_buf = (mv_buf_t *)ps_mv_buf_mgr->apv_ptr[i];
   83|   141k|        if(ps_mv_buf && (ps_mv_buf->i4_abs_poc == (WORD32)abs_poc))
  ------------------
  |  Branch (83:12): [True: 141k, False: 0]
  |  Branch (83:25): [True: 81.7k, False: 59.3k]
  ------------------
   84|  81.7k|        {
   85|  81.7k|            break;
   86|  81.7k|        }
   87|   141k|    }
   88|       |
   89|  81.7k|    return ps_mv_buf;
   90|  81.7k|}
ihevcd_ref_list:
   94|  23.0k|{
   95|  23.0k|    WORD32 i, j;
   96|  23.0k|    WORD32 st_rps_idx;
   97|  23.0k|    WORD32 num_neg_pics, num_pos_pics;
   98|  23.0k|    WORD8 *pi1_used;
   99|  23.0k|    WORD16 *pi2_delta_poc;
  100|  23.0k|    UWORD32 u4_max_poc_lsb;
  101|  23.0k|    pic_buf_t *ps_pic_buf;
  102|  23.0k|    mv_buf_t *ps_mv_buf;
  103|  23.0k|    UWORD32 r_idx;
  104|       |
  105|  23.0k|    dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
  106|  23.0k|    buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
  107|       |
  108|  23.0k|    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|  23.0k|    WORD32 ai4_poc_lt_curr[MAX_DPB_SIZE], ai4_poc_lt_foll[MAX_DPB_SIZE];
  110|  23.0k|    UWORD32 u4_num_st_curr_before, u4_num_st_foll, u4_num_st_curr_after, u4_num_lt_curr, u4_num_lt_foll;
  111|  23.0k|    UWORD32 u4_num_total_curr;
  112|       |
  113|  23.0k|    WORD8 ai1_curr_delta_poc_msb_present_flag[MAX_DPB_SIZE], ai1_foll_delta_poc_msb_present_flag[MAX_DPB_SIZE];
  114|       |
  115|  23.0k|    pic_buf_t *as_ref_pic_lt_curr[MAX_DPB_SIZE];
  116|  23.0k|    pic_buf_t *as_ref_pic_lt_foll[MAX_DPB_SIZE];
  117|  23.0k|    pic_buf_t *as_ref_pic_st_curr_after[MAX_DPB_SIZE];
  118|  23.0k|    pic_buf_t *as_ref_pic_st_curr_before[MAX_DPB_SIZE];
  119|  23.0k|    pic_buf_t *as_ref_pic_st_foll[MAX_DPB_SIZE];
  120|       |
  121|  23.0k|    pic_buf_t *as_ref_pic_list_temp0[MAX_DPB_SIZE], *as_ref_pic_list_temp1[MAX_DPB_SIZE];
  122|       |
  123|  23.0k|    UWORD32 u4_num_rps_curr_temp_list0, u4_num_rps_curr_temp_list1;
  124|       |
  125|  23.0k|    WORD32 i4_pic_order_cnt_val;
  126|  23.0k|    WORD32 i4_poc_lt;
  127|  23.0k|    UNUSED(as_ref_pic_lt_foll);
  ------------------
  |  |   38|  23.0k|#define UNUSED(x) ((void)(x))
  ------------------
  128|  23.0k|    UNUSED(as_ref_pic_st_foll);
  ------------------
  |  |   38|  23.0k|#define UNUSED(x) ((void)(x))
  ------------------
  129|  23.0k|    UNUSED(ps_pps);
  ------------------
  |  |   38|  23.0k|#define UNUSED(x) ((void)(x))
  ------------------
  130|       |
  131|  23.0k|    RETURN_IF_NAL_INFO;
  132|       |
  133|  23.0k|    u4_max_poc_lsb = (1 << ps_sps->i1_log2_max_pic_order_cnt_lsb);
  134|       |
  135|  23.0k|    i4_pic_order_cnt_val = ps_slice_hdr->i4_abs_pic_order_cnt;
  136|       |
  137|  23.0k|    if(1 == ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag)
  ------------------
  |  Branch (137:8): [True: 14.4k, False: 8.61k]
  ------------------
  138|  14.4k|    {
  139|  14.4k|        st_rps_idx = ps_slice_hdr->i1_short_term_ref_pic_set_idx;
  140|  14.4k|        num_neg_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_neg_pics;
  141|  14.4k|        num_pos_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_pos_pics;
  142|  14.4k|        pi1_used = ps_sps->as_stref_picset[st_rps_idx].ai1_used;
  143|  14.4k|        pi2_delta_poc = ps_sps->as_stref_picset[st_rps_idx].ai2_delta_poc;
  144|  14.4k|    }
  145|  8.61k|    else
  146|  8.61k|    {
  147|  8.61k|        st_rps_idx = ps_sps->i1_num_short_term_ref_pic_sets;
  148|  8.61k|        num_neg_pics = ps_slice_hdr->s_stref_picset.i1_num_neg_pics;
  149|  8.61k|        num_pos_pics = ps_slice_hdr->s_stref_picset.i1_num_pos_pics;
  150|  8.61k|        pi1_used = ps_slice_hdr->s_stref_picset.ai1_used;
  151|  8.61k|        pi2_delta_poc = ps_slice_hdr->s_stref_picset.ai2_delta_poc;
  152|  8.61k|    }
  153|       |
  154|  23.0k|    u4_num_st_curr_before = 0;
  155|  23.0k|    u4_num_st_foll = 0;
  156|  66.4k|    for(i = 0; i < num_neg_pics; i++)
  ------------------
  |  Branch (156:16): [True: 43.3k, False: 23.0k]
  ------------------
  157|  43.3k|    {
  158|  43.3k|        if(pi1_used[i])
  ------------------
  |  Branch (158:12): [True: 37.2k, False: 6.07k]
  ------------------
  159|  37.2k|        {
  160|  37.2k|            ai4_poc_st_curr_before[u4_num_st_curr_before] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  161|  37.2k|            u4_num_st_curr_before++;
  162|  37.2k|        }
  163|  6.07k|        else
  164|  6.07k|        {
  165|  6.07k|            ai4_poc_st_foll[u4_num_st_foll] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  166|  6.07k|            u4_num_st_foll++;
  167|  6.07k|        }
  168|  43.3k|    }
  169|  23.0k|    u4_num_st_curr_after = 0;
  170|  66.7k|    for(i = num_neg_pics; i < num_neg_pics + num_pos_pics; i++)
  ------------------
  |  Branch (170:27): [True: 43.7k, False: 23.0k]
  ------------------
  171|  43.7k|    {
  172|  43.7k|        if(pi1_used[i])
  ------------------
  |  Branch (172:12): [True: 39.2k, False: 4.50k]
  ------------------
  173|  39.2k|        {
  174|  39.2k|            ai4_poc_st_curr_after[u4_num_st_curr_after] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  175|  39.2k|            u4_num_st_curr_after++;
  176|  39.2k|        }
  177|  4.50k|        else
  178|  4.50k|        {
  179|  4.50k|            ai4_poc_st_foll[u4_num_st_foll] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  180|  4.50k|            u4_num_st_foll++;
  181|  4.50k|        }
  182|  43.7k|    }
  183|       |
  184|  23.0k|    u4_num_lt_curr = 0;
  185|  23.0k|    u4_num_lt_foll = 0;
  186|  43.9k|    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: 20.8k, False: 23.0k]
  ------------------
  187|  20.8k|    {
  188|  20.8k|        i4_poc_lt = ps_slice_hdr->ai4_poc_lsb_lt[i];
  189|  20.8k|        if(ps_slice_hdr->ai1_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (189:12): [True: 10.4k, False: 10.3k]
  ------------------
  190|  10.4k|        {
  191|  10.4k|            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|  10.4k|        }
  193|       |
  194|  20.8k|        if(ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i])
  ------------------
  |  Branch (194:12): [True: 11.3k, False: 9.53k]
  ------------------
  195|  11.3k|        {
  196|  11.3k|            ai4_poc_lt_curr[u4_num_lt_curr] = i4_poc_lt;
  197|  11.3k|            ai1_curr_delta_poc_msb_present_flag[u4_num_lt_curr] = ps_slice_hdr->ai1_delta_poc_msb_present_flag[i];
  198|  11.3k|            u4_num_lt_curr++;
  199|  11.3k|        }
  200|  9.53k|        else
  201|  9.53k|        {
  202|  9.53k|            ai4_poc_lt_foll[u4_num_lt_foll] = i4_poc_lt;
  203|  9.53k|            ai1_foll_delta_poc_msb_present_flag[u4_num_lt_foll] = ps_slice_hdr->ai1_delta_poc_msb_present_flag[i];
  204|  9.53k|            u4_num_lt_foll++;
  205|  9.53k|        }
  206|  20.8k|    }
  207|       |
  208|  23.0k|    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|  23.0k|    if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (311:8): [True: 12.5k, False: 10.5k]
  ------------------
  312|  12.5k|    {
  313|   815k|        for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   815k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|   815k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (313:20): [True: 803k, False: 12.5k]
  ------------------
  314|   803k|        {
  315|   803k|            if(ps_dpb_mgr->as_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (315:16): [True: 26.2k, False: 776k]
  ------------------
  316|  26.2k|                ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref = UNUSED_FOR_REF;
  317|   803k|        }
  318|  12.5k|    }
  319|       |
  320|  34.3k|    for(i = 0; i < (WORD32)u4_num_lt_curr; i++)
  ------------------
  |  Branch (320:16): [True: 11.3k, False: 23.0k]
  ------------------
  321|  11.3k|    {
  322|  11.3k|        if(0 == ai1_curr_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (322:12): [True: 6.55k, False: 4.77k]
  ------------------
  323|  6.55k|        {
  324|  6.55k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc_lsb(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  325|  6.55k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (325:16): [True: 2.48k, False: 4.07k]
  ------------------
  326|  2.48k|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  327|       |
  328|  6.55k|            as_ref_pic_lt_curr[i] = ps_pic_buf;
  329|  6.55k|        }
  330|  4.77k|        else
  331|  4.77k|        {
  332|  4.77k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  333|  4.77k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (333:16): [True: 2.33k, False: 2.43k]
  ------------------
  334|  2.33k|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  335|       |
  336|  4.77k|            as_ref_pic_lt_curr[i] = ps_pic_buf;
  337|  4.77k|        }
  338|  11.3k|    }
  339|       |
  340|  32.5k|    for(i = 0; i < (WORD32)u4_num_lt_foll; i++)
  ------------------
  |  Branch (340:16): [True: 9.53k, False: 23.0k]
  ------------------
  341|  9.53k|    {
  342|  9.53k|        if(0 == ai1_foll_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (342:12): [True: 3.80k, False: 5.72k]
  ------------------
  343|  3.80k|        {
  344|  3.80k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc_lsb(ps_dpb_mgr, ai4_poc_lt_foll[i]);
  345|  3.80k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (345:16): [True: 365, False: 3.44k]
  ------------------
  346|    365|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  347|       |
  348|  3.80k|            as_ref_pic_lt_foll[i] = ps_pic_buf;
  349|  3.80k|        }
  350|  5.72k|        else
  351|  5.72k|        {
  352|  5.72k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_lt_foll[i]);
  353|  5.72k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (353:16): [True: 1.84k, False: 3.87k]
  ------------------
  354|  1.84k|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  355|       |
  356|  5.72k|            as_ref_pic_lt_foll[i] = ps_pic_buf;
  357|  5.72k|        }
  358|  9.53k|    }
  359|       |
  360|       |
  361|  60.3k|    for(i = 0; i < (WORD32)u4_num_st_curr_before; i++)
  ------------------
  |  Branch (361:16): [True: 37.2k, False: 23.0k]
  ------------------
  362|  37.2k|    {
  363|       |
  364|  37.2k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_curr_before[i]);
  365|  37.2k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (365:12): [True: 15.4k, False: 21.7k]
  ------------------
  366|  15.4k|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  367|       |
  368|  37.2k|        as_ref_pic_st_curr_before[i] = ps_pic_buf;
  369|  37.2k|    }
  370|       |
  371|  62.2k|    for(i = 0; i < (WORD32)u4_num_st_curr_after; i++)
  ------------------
  |  Branch (371:16): [True: 39.2k, False: 23.0k]
  ------------------
  372|  39.2k|    {
  373|  39.2k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_curr_after[i]);
  374|  39.2k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (374:12): [True: 11.3k, False: 27.9k]
  ------------------
  375|  11.3k|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  376|       |
  377|  39.2k|        as_ref_pic_st_curr_after[i] = ps_pic_buf;
  378|  39.2k|    }
  379|       |
  380|  33.6k|    for(i = 0; i < (WORD32)u4_num_st_foll; i++)
  ------------------
  |  Branch (380:16): [True: 10.5k, False: 23.0k]
  ------------------
  381|  10.5k|    {
  382|  10.5k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_foll[i]);
  383|  10.5k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (383:12): [True: 1.51k, False: 9.06k]
  ------------------
  384|  1.51k|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  385|       |
  386|  10.5k|        as_ref_pic_st_foll[i] = ps_pic_buf;
  387|  10.5k|    }
  388|       |
  389|       |    //TODO: Bit stream conformance tests to be included
  390|       |
  391|  23.0k|    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: 8.49k]
  ------------------
  392|       |
  393|  23.0k|    r_idx = 0;
  394|  23.0k|    if((PSLICE == ps_slice_hdr->i1_slice_type) ||
  ------------------
  |  Branch (394:8): [True: 1.51k, False: 21.5k]
  ------------------
  395|  21.5k|       (BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (395:8): [True: 14.5k, False: 6.94k]
  ------------------
  396|  16.1k|    {
  397|  37.6k|        while(r_idx < u4_num_rps_curr_temp_list0)
  ------------------
  |  Branch (397:15): [True: 21.4k, False: 16.1k]
  ------------------
  398|  21.4k|        {
  399|  62.0k|            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.9k, False: 21.1k]
  |  Branch (399:63): [True: 40.5k, False: 308]
  ------------------
  400|  40.5k|            {
  401|  40.5k|                if(NULL == as_ref_pic_st_curr_before[i])
  ------------------
  |  Branch (401:20): [True: 21.4k, False: 19.1k]
  ------------------
  402|  21.4k|                {
  403|  21.4k|                    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.4k|                }
  405|  40.5k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_st_curr_before[i];
  406|  40.5k|            }
  407|       |
  408|  50.8k|            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: 29.5k, False: 21.2k]
  |  Branch (408:62): [True: 29.3k, False: 232]
  ------------------
  409|  29.3k|            {
  410|  29.3k|                if(NULL == as_ref_pic_st_curr_after[i])
  ------------------
  |  Branch (410:20): [True: 18.6k, False: 10.6k]
  ------------------
  411|  18.6k|                {
  412|  18.6k|                    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.6k|                }
  414|  29.3k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_st_curr_after[i];
  415|  29.3k|            }
  416|       |
  417|  32.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: 11.6k, False: 21.2k]
  |  Branch (417:56): [True: 11.4k, False: 259]
  ------------------
  418|  11.4k|            {
  419|  11.4k|                if(NULL == as_ref_pic_lt_curr[i])
  ------------------
  |  Branch (419:20): [True: 6.06k, False: 5.35k]
  ------------------
  420|  6.06k|                {
  421|  6.06k|                    as_ref_pic_lt_curr[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  422|  6.06k|                }
  423|  11.4k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_lt_curr[i];
  424|  11.4k|            }
  425|  21.4k|        }
  426|       |
  427|  49.4k|        for(r_idx = 0; (WORD32)r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (427:24): [True: 34.5k, False: 14.9k]
  ------------------
  428|  34.5k|        {
  429|  34.5k|            pic_buf_t *ps_pic_buf;
  430|  34.5k|            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.46k, False: 29.0k]
  ------------------
  431|  34.5k|            ps_pic_buf = (pic_buf_t *)ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf;
  432|       |
  433|  34.5k|            if(ps_pic_buf == NULL)
  ------------------
  |  Branch (433:16): [True: 1.18k, False: 33.3k]
  ------------------
  434|  1.18k|                return IHEVCD_REF_PIC_NOT_FOUND;
  435|       |
  436|  33.3k|            ps_mv_buf = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf->i4_abs_poc);
  437|  33.3k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = ps_mv_buf;
  438|  33.3k|        }
  439|       |
  440|       |
  441|  14.9k|        if(ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (441:12): [True: 13.5k, False: 1.36k]
  ------------------
  442|  13.5k|        {
  443|  13.5k|            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: 11.1k, False: 2.43k]
  ------------------
  444|       |
  445|  13.5k|            r_idx = 0;
  446|  30.8k|            while(r_idx < u4_num_rps_curr_temp_list1)
  ------------------
  |  Branch (446:19): [True: 17.3k, False: 13.5k]
  ------------------
  447|  17.3k|            {
  448|  44.3k|                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.1k, False: 17.2k]
  |  Branch (448:66): [True: 27.0k, False: 40]
  ------------------
  449|  27.0k|                {
  450|  27.0k|                    if(NULL == as_ref_pic_st_curr_after[i])
  ------------------
  |  Branch (450:24): [True: 0, False: 27.0k]
  ------------------
  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.0k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_st_curr_after[i];
  455|  27.0k|                }
  456|       |
  457|  53.5k|                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: 36.4k, False: 17.0k]
  |  Branch (457:67): [True: 36.1k, False: 223]
  ------------------
  458|  36.1k|                {
  459|  36.1k|                    if(NULL == as_ref_pic_st_curr_before[i])
  ------------------
  |  Branch (459:24): [True: 0, False: 36.1k]
  ------------------
  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|  36.1k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_st_curr_before[i];
  464|  36.1k|                }
  465|       |
  466|  22.2k|                for(i = 0; (i < (WORD32)u4_num_lt_curr) && (r_idx < u4_num_rps_curr_temp_list1); r_idx++, i++)
  ------------------
  |  Branch (466:28): [True: 5.23k, False: 17.0k]
  |  Branch (466:60): [True: 4.91k, False: 319]
  ------------------
  467|  4.91k|                {
  468|  4.91k|                    if(NULL == as_ref_pic_lt_curr[i])
  ------------------
  |  Branch (468:24): [True: 0, False: 4.91k]
  ------------------
  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.91k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_lt_curr[i];
  473|  4.91k|                }
  474|  17.3k|            }
  475|       |
  476|  46.5k|            for(r_idx = 0; (WORD32)r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (476:28): [True: 33.0k, False: 13.5k]
  ------------------
  477|  33.0k|            {
  478|  33.0k|                pic_buf_t *ps_pic_buf;
  479|  33.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: 3.87k, False: 29.1k]
  ------------------
  480|  33.0k|                ps_pic_buf = (pic_buf_t *)ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf;
  481|       |
  482|  33.0k|                if(ps_pic_buf == NULL)
  ------------------
  |  Branch (482:20): [True: 0, False: 33.0k]
  ------------------
  483|      0|                    return IHEVCD_REF_PIC_NOT_FOUND;
  484|       |
  485|  33.0k|                ps_mv_buf = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf->i4_abs_poc);
  486|  33.0k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = ps_mv_buf;
  487|  33.0k|            }
  488|  13.5k|        }
  489|  14.9k|    }
  490|       |
  491|  21.8k|    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.42M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  1.42M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  1.42M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (493:16): [True: 1.39M, False: 21.8k]
  ------------------
  494|  1.39M|    {
  495|  1.39M|        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: 37.3k, False: 1.36M]
  |  Branch (495:55): [True: 7.52k, False: 29.8k]
  ------------------
  496|  7.52k|        {
  497|  7.52k|            pic_buf_t *ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  498|  7.52k|            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|  7.52k|            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|  7.52k|            ps_mv_buf = (mv_buf_t *)ps_codec->ps_mv_buf;
  506|  15.7k|            for(j = 0; j < ps_codec->i4_max_dpb_size; j++)
  ------------------
  |  Branch (506:24): [True: 15.7k, False: 0]
  ------------------
  507|  15.7k|            {
  508|  15.7k|                if(ps_mv_buf && ps_mv_buf->i4_abs_poc == ps_pic_buf->i4_abs_poc)
  ------------------
  |  Branch (508:20): [True: 15.7k, False: 0]
  |  Branch (508:33): [True: 7.52k, False: 8.21k]
  ------------------
  509|  7.52k|                {
  510|  7.52k|                    ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   40|  7.52k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  511|  7.52k|                    break;
  512|  7.52k|                }
  513|  8.21k|                ps_mv_buf++;
  514|  8.21k|            }
  515|  7.52k|        }
  516|       |
  517|  1.39M|    }
  518|       |
  519|  21.8k|    return IHEVCD_SUCCESS;
  520|  23.0k|}

ihevcd_sao_shift_ctb:
  123|  23.5M|{
  124|  23.5M|    codec_t *ps_codec = ps_sao_ctxt->ps_codec;
  125|  23.5M|    UWORD8 *pu1_src_luma;
  126|  23.5M|    UWORD8 *pu1_src_chroma;
  127|  23.5M|    WORD32 src_strd;
  128|  23.5M|    WORD32 chroma_strd;
  129|  23.5M|    WORD32 ctb_size;
  130|  23.5M|    WORD32 log2_ctb_size;
  131|  23.5M|    sps_t *ps_sps;
  132|  23.5M|    sao_t *ps_sao;
  133|  23.5M|    pps_t *ps_pps;
  134|  23.5M|    slice_header_t *ps_slice_hdr, *ps_slice_hdr_base;
  135|  23.5M|    tile_t *ps_tile;
  136|  23.5M|    UWORD16 *pu1_slice_idx;
  137|  23.5M|    UWORD16 *pu1_tile_idx;
  138|  23.5M|    WORD32 row, col;
  139|  23.5M|    UWORD8 au1_avail_luma[8];
  140|  23.5M|    UWORD8 au1_avail_chroma[8];
  141|  23.5M|    UWORD8 au1_tile_slice_boundary[8];
  142|  23.5M|    UWORD8 au4_ilf_across_tile_slice_enable[8];
  143|  23.5M|    WORD32 i;
  144|  23.5M|    UWORD8 *pu1_src_top_luma;
  145|  23.5M|    UWORD8 *pu1_src_top_chroma;
  146|  23.5M|    UWORD8 *pu1_src_left_luma;
  147|  23.5M|    UWORD8 *pu1_src_left_chroma;
  148|  23.5M|    UWORD8 au1_src_top_right[2];
  149|  23.5M|    UWORD8 au1_src_bot_left[2];
  150|  23.5M|    UWORD16 au2_src_top_right[2];
  151|  23.5M|    UWORD16 au2_src_bot_left[2];
  152|  23.5M|    UWORD8 *pu1_no_loop_filter_flag;
  153|  23.5M|    UWORD8 *pu1_src_backup_luma;
  154|  23.5M|    UWORD8 *pu1_src_backup_chroma;
  155|  23.5M|    WORD32 backup_strd;
  156|  23.5M|    WORD32 loop_filter_strd;
  157|  23.5M|    UWORD32 u4_bit_depth_luma, u4_bit_depth_chroma;
  158|  23.5M|    WORD32 pixel_size_y, pixel_size_uv;
  159|       |
  160|  23.5M|    WORD32 no_loop_filter_enabled_luma = 0;
  161|  23.5M|    WORD32 no_loop_filter_enabled_chroma = 0;
  162|  23.5M|    UWORD8 *pu1_sao_src_top_left_chroma_curr_ctb;
  163|  23.5M|    UWORD8 *pu1_sao_src_top_left_luma_curr_ctb;
  164|  23.5M|    UWORD8 *pu1_sao_src_luma_top_left_ctb;
  165|  23.5M|    UWORD8 *pu1_sao_src_chroma_top_left_ctb;
  166|  23.5M|    UWORD8 *pu1_sao_src_top_left_luma_top_right;
  167|  23.5M|    UWORD8 *pu1_sao_src_top_left_chroma_top_right;
  168|  23.5M|    UWORD8  u1_sao_src_top_left_luma_bot_left;
  169|  23.5M|    UWORD8  *pu1_sao_src_top_left_luma_bot_left;
  170|  23.5M|    UWORD8 *au1_sao_src_top_left_chroma_bot_left;
  171|  23.5M|    UWORD16 *au2_sao_src_top_left_chroma_bot_left;
  172|  23.5M|    UWORD16 u2_sao_src_top_left_luma_bot_left;
  173|  23.5M|    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|  23.5M|    WORD8 ai1_offset_y[8] = {0};
  177|  23.5M|    WORD8 ai1_offset_cb[8] = {0};
  178|  23.5M|    WORD8 ai1_offset_cr[8] = {0};
  179|  23.5M|    WORD32  chroma_yuv420sp_vu = ps_sao_ctxt->is_chroma_yuv420sp_vu;
  180|       |
  181|  23.5M|    PROFILE_DISABLE_SAO();
  ------------------
  |  |   51|  23.5M|#define PROFILE_DISABLE_SAO() ;
  ------------------
  182|       |
  183|  23.5M|    ps_sps = ps_sao_ctxt->ps_sps;
  184|  23.5M|    ps_pps = ps_sao_ctxt->ps_pps;
  185|  23.5M|    ps_tile = ps_sao_ctxt->ps_tile;
  186|       |
  187|  23.5M|    WORD32 is_yuv444 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 1 : 0;
  ------------------
  |  Branch (187:24): [True: 0, False: 23.5M]
  ------------------
  188|  23.5M|    WORD32 h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (188:28): [True: 0, False: 23.5M]
  ------------------
  189|  23.5M|    WORD32 v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (189:28): [True: 22.1M, False: 1.36M]
  ------------------
  190|  23.5M|    WORD32 chroma_pixel_strd = 2;
  191|       |
  192|  23.5M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  193|  23.5M|    ctb_size = (1 << log2_ctb_size);
  194|  23.5M|    src_strd = ps_sao_ctxt->ps_codec->i4_strd;
  195|  23.5M|    chroma_strd = src_strd * chroma_pixel_strd / h_samp_factor;
  196|  23.5M|    u4_bit_depth_luma = (UWORD32)ps_sao_ctxt->ps_codec->i4_bit_depth_luma;
  197|  23.5M|    u4_bit_depth_chroma = (UWORD32)ps_sao_ctxt->ps_codec->i4_bit_depth_chroma;
  198|  23.5M|    pixel_size_y = (u4_bit_depth_luma > 8) ? 2 : 1;
  ------------------
  |  Branch (198:20): [True: 1.46M, False: 22.0M]
  ------------------
  199|  23.5M|    pixel_size_uv = (u4_bit_depth_chroma > 8) ? 2 : 1;
  ------------------
  |  Branch (199:21): [True: 1.46M, False: 22.0M]
  ------------------
  200|  23.5M|    ps_slice_hdr_base = ps_sao_ctxt->ps_codec->ps_slice_hdr_base;
  201|  23.5M|    ps_slice_hdr = ps_slice_hdr_base + (ps_sao_ctxt->i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  23.5M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  23.5M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  202|       |
  203|  23.5M|    pu1_slice_idx = ps_sao_ctxt->pu1_slice_idx;
  204|  23.5M|    pu1_tile_idx = ps_sao_ctxt->pu1_tile_idx;
  205|  23.5M|    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|  23.5M|    pu1_src_chroma = ps_sao_ctxt->pu1_cur_pic_chroma
  207|  23.5M|                    + (((ps_sao_ctxt->i4_ctb_x * chroma_pixel_strd / h_samp_factor
  208|  23.5M|                    + 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|  23.5M|    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|  23.5M|    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|  23.5M|    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|  23.5M|    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|  23.5M|    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|  23.5M|    u2_sao_src_top_left_luma_bot_left = ps_sao_ctxt->u2_sao_src_top_left_luma_bot_left;
  217|  23.5M|    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|  23.5M|    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|  23.5M|    au2_sao_src_top_left_chroma_bot_left = ps_sao_ctxt->au2_sao_src_top_left_chroma_bot_left;
  220|  23.5M|    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|  23.5M|    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|  23.5M|    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|  23.5M|    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|  23.5M|    loop_filter_strd =  (ps_sps->i2_pic_width_in_luma_samples + 63) >> 6;
  226|  23.5M|    backup_strd = 2 * MAX_CTB_SIZE;
  ------------------
  |  |  351|  23.5M|#define MAX_CTB_SIZE        64
  ------------------
  227|       |
  228|  23.5M|    DEBUG_INIT_TMP_BUF(ps_sao_ctxt->pu1_tmp_buf_luma, ps_sao_ctxt->pu1_tmp_buf_chroma);
  229|       |
  230|  23.5M|    {
  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|  23.5M|        {
  237|  23.5M|            UWORD32 u4_no_loop_filter_flag;
  238|  23.5M|            WORD32 loop_filter_bit_pos;
  239|  23.5M|            WORD32 log2_min_cu = 3;
  240|  23.5M|            WORD32 min_cu = (1 << log2_min_cu);
  241|  23.5M|            UWORD8 *pu1_src_tmp_luma = pu1_src_luma;
  242|  23.5M|            WORD32 sao_blk_ht = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  243|  23.5M|            WORD32 sao_blk_wd = ctb_size;
  244|  23.5M|            WORD32 remaining_rows;
  245|  23.5M|            WORD32 remaining_cols;
  246|       |
  247|  23.5M|            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|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  248|  23.5M|            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|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  249|  23.5M|            if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (249:16): [True: 954k, False: 22.5M]
  ------------------
  250|   954k|                sao_blk_ht += remaining_rows;
  251|  23.5M|            if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (251:16): [True: 972k, False: 22.5M]
  ------------------
  252|   972k|                sao_blk_wd += remaining_cols;
  253|       |
  254|  23.5M|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * pixel_size_y : 0;
  ------------------
  |  |   78|  22.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (254:33): [True: 22.5M, False: 922k]
  ------------------
  255|  23.5M|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd * pixel_size_y : 0;
  ------------------
  |  |   78|  22.6M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (255:33): [True: 22.6M, False: 890k]
  ------------------
  256|       |
  257|  23.5M|            pu1_src_backup_luma = ps_sao_ctxt->pu1_tmp_buf_luma;
  258|       |
  259|  23.5M|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
  260|  23.5M|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
  261|  23.5M|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (261:16): [True: 22.6M, False: 906k]
  ------------------
  262|  22.6M|                loop_filter_bit_pos -= 1;
  263|       |
  264|  23.5M|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
  265|  23.5M|                            (loop_filter_bit_pos >> 3);
  266|       |
  267|  23.5M|            for(i = -(ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  22.6M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (267:23): [True: 22.6M, False: 890k]
  ------------------
  268|   105M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (268:29): [True: 81.8M, False: 23.5M]
  ------------------
  269|  81.8M|            {
  270|  81.8M|                WORD32 tmp_wd = sao_blk_wd;
  271|       |
  272|  81.8M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
  273|  81.8M|                                (loop_filter_bit_pos & 7);
  274|  81.8M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
  275|       |
  276|  81.8M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (276:20): [True: 685k, False: 81.1M]
  ------------------
  277|   685k|                {
  278|   685k|                    no_loop_filter_enabled_luma = 1;
  279|  1.95M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (279:27): [True: 1.26M, False: 685k]
  ------------------
  280|  1.26M|                    {
  281|  1.26M|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (281:28): [True: 532k, False: 737k]
  ------------------
  282|   532k|                        {
  283|   532k|                            pu1_src_tmp_luma += MIN((WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   532k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 287k, False: 244k]
  |  |  ------------------
  ------------------
  284|   532k|                            pu1_src_backup_luma += MIN((WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   532k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 287k, False: 244k]
  |  |  ------------------
  ------------------
  285|   532k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
  286|   532k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
  287|   532k|                        }
  288|   737k|                        else
  289|   737k|                        {
  290|  6.52M|                            for(row = 0; row < min_cu; row++)
  ------------------
  |  Branch (290:42): [True: 5.78M, False: 737k]
  ------------------
  291|  5.78M|                            {
  292|   339M|                                for(col = 0; col < MIN((WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y; col++)
  ------------------
  |  |   43|   339M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 65.6M, False: 273M]
  |  |  ------------------
  ------------------
  |  Branch (292:46): [True: 333M, False: 5.78M]
  ------------------
  293|   333M|                                {
  294|   333M|                                    pu1_src_backup_luma[row * backup_strd * pixel_size_y + col] = pu1_src_tmp_luma[row * src_strd * pixel_size_y + col];
  295|   333M|                                }
  296|  5.78M|                            }
  297|   737k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   737k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 297k, False: 439k]
  |  |  ------------------
  ------------------
  298|   737k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   737k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 297k, False: 439k]
  |  |  ------------------
  ------------------
  299|   737k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
  300|   737k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
  301|   737k|                        }
  302|  1.26M|                    }
  303|       |
  304|   685k|                    pu1_src_tmp_luma -= sao_blk_wd * pixel_size_y;
  305|   685k|                    pu1_src_backup_luma -= sao_blk_wd * pixel_size_y;
  306|   685k|                }
  307|       |
  308|  81.8M|                pu1_src_tmp_luma += ((src_strd << log2_min_cu) * pixel_size_y);
  309|  81.8M|                pu1_src_backup_luma += ((backup_strd << log2_min_cu) * pixel_size_y);
  310|  81.8M|            }
  311|  23.5M|        }
  312|       |
  313|       |        /* Chroma */
  314|       |
  315|  23.5M|        if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (315:13): [True: 23.5M, False: 18.4E]
  ------------------
  316|  23.5M|        {
  317|  23.5M|            UWORD32 u4_no_loop_filter_flag;
  318|  23.5M|            WORD32 loop_filter_bit_pos;
  319|  23.5M|            WORD32 log2_min_cu = 3;
  320|  23.5M|            WORD32 min_cu = (1 << log2_min_cu);
  321|  23.5M|            UWORD8 *pu1_src_tmp_chroma = pu1_src_chroma;
  322|  23.5M|            WORD32 sao_blk_ht = ctb_size - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  323|  23.5M|            WORD32 sao_blk_wd = ctb_size;
  324|  23.5M|            WORD32 remaining_rows;
  325|  23.5M|            WORD32 remaining_cols;
  326|       |
  327|  23.5M|            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|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  328|  23.5M|            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|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  329|  23.5M|            if(remaining_rows <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (329:16): [True: 951k, False: 22.5M]
  ------------------
  330|   951k|                sao_blk_ht += remaining_rows;
  331|  23.5M|            if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (331:16): [True: 966k, False: 22.5M]
  ------------------
  332|   966k|                sao_blk_wd += remaining_cols;
  333|       |
  334|  23.5M|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * 2 : 0) * pixel_size_uv;
  ------------------
  |  |   78|  22.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (334:36): [True: 22.5M, False: 959k]
  ------------------
  335|  23.5M|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * chroma_strd : 0) * pixel_size_uv;
  ------------------
  |  |   78|  22.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (335:36): [True: 22.5M, False: 940k]
  ------------------
  336|       |
  337|  23.5M|            pu1_src_backup_chroma = ps_sao_ctxt->pu1_tmp_buf_chroma;
  338|       |
  339|  23.5M|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
  340|  23.5M|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
  341|  23.5M|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (341:16): [True: 22.5M, False: 953k]
  ------------------
  342|  22.5M|                loop_filter_bit_pos -= (is_yuv444 ? 1 : 2);
  ------------------
  |  Branch (342:41): [True: 0, False: 22.5M]
  ------------------
  343|       |
  344|  23.5M|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
  345|  23.5M|                            (loop_filter_bit_pos >> 3);
  346|       |
  347|  23.5M|            for(i = -(ps_sao_ctxt->i4_ctb_y ? 2 * SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  22.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (347:23): [True: 22.5M, False: 961k]
  ------------------
  348|   105M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (348:29): [True: 81.6M, False: 23.5M]
  ------------------
  349|  81.6M|            {
  350|  81.6M|                WORD32 tmp_wd = sao_blk_wd;
  351|       |
  352|  81.6M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
  353|  81.6M|                                (loop_filter_bit_pos & 7);
  354|  81.6M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
  355|       |
  356|  81.6M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (356:20): [True: 678k, False: 80.9M]
  ------------------
  357|   678k|                {
  358|   678k|                    no_loop_filter_enabled_chroma = 1;
  359|  1.92M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (359:27): [True: 1.24M, False: 678k]
  ------------------
  360|  1.24M|                    {
  361|  1.24M|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (361:28): [True: 524k, False: 721k]
  ------------------
  362|   524k|                        {
  363|   524k|                            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|   524k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 274k, False: 249k]
  |  |  ------------------
  ------------------
  364|   524k|                            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|   524k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 274k, False: 249k]
  |  |  ------------------
  ------------------
  365|   524k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
  366|   524k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
  367|   524k|                        }
  368|   721k|                        else
  369|   721k|                        {
  370|  5.52M|                            for(row = 0; row < min_cu / v_samp_factor; row++)
  ------------------
  |  Branch (370:42): [True: 4.80M, False: 721k]
  ------------------
  371|  4.80M|                            {
  372|   308M|                                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|   308M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 73.9M, False: 234M]
  |  |  ------------------
  ------------------
  |  Branch (372:46): [True: 303M, False: 4.80M]
  ------------------
  373|   303M|                                {
  374|   303M|                                    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|   303M|                                }
  376|  4.80M|                            }
  377|       |
  378|   721k|                            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|   721k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 293k, False: 428k]
  |  |  ------------------
  ------------------
  379|   721k|                            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|   721k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 293k, False: 428k]
  |  |  ------------------
  ------------------
  380|   721k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
  381|   721k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
  382|   721k|                        }
  383|  1.24M|                    }
  384|       |
  385|   678k|                    pu1_src_tmp_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  386|   678k|                    pu1_src_backup_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  387|   678k|                }
  388|       |
  389|  81.6M|                pu1_src_tmp_chroma += ((((src_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
  390|  81.6M|                pu1_src_backup_chroma += ((((backup_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
  391|  81.6M|            }
  392|  23.5M|        }
  393|  23.5M|    }
  394|       |
  395|  23.5M|    DEBUG_PROCESS_TMP_BUF(ps_sao_ctxt->pu1_tmp_buf_luma, ps_sao_ctxt->pu1_tmp_buf_chroma);
  396|       |
  397|       |    /* Top-left CTB */
  398|  23.5M|    if(ps_sao_ctxt->i4_ctb_x > 0 && ps_sao_ctxt->i4_ctb_y > 0)
  ------------------
  |  Branch (398:8): [True: 22.5M, False: 952k]
  |  Branch (398:37): [True: 21.6M, False: 871k]
  ------------------
  399|  21.6M|    {
  400|  21.6M|        WORD32 sao_wd_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  21.6M|#define SAO_SHIFT_CTB    8
  ------------------
  401|  21.6M|        WORD32 sao_wd_chroma = 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  21.6M|#define SAO_SHIFT_CTB    8
  ------------------
  402|  21.6M|        WORD32 sao_ht_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  21.6M|#define SAO_SHIFT_CTB    8
  ------------------
  403|  21.6M|        WORD32 sao_ht_chroma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  21.6M|#define SAO_SHIFT_CTB    8
  ------------------
  404|       |
  405|  21.6M|        WORD32 ctbx_tl_t = 0, ctbx_tl_l = 0, ctbx_tl_r = 0, ctbx_tl_d = 0, ctbx_tl = 0;
  406|  21.6M|        WORD32 ctby_tl_t = 0, ctby_tl_l = 0, ctby_tl_r = 0, ctby_tl_d = 0, ctby_tl = 0;
  407|  21.6M|        WORD32 au4_idx_tl[8], idx_tl;
  408|       |
  409|  21.6M|        slice_header_t *ps_slice_hdr_top_left;
  410|  21.6M|        {
  411|  21.6M|            WORD32 top_left_ctb_indx = (ps_sao_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb +
  412|  21.6M|                                        (ps_sao_ctxt->i4_ctb_x - 1);
  413|  21.6M|            ps_slice_hdr_top_left = ps_slice_hdr_base + pu1_slice_idx[top_left_ctb_indx];
  414|  21.6M|        }
  415|       |
  416|       |
  417|  21.6M|        pu1_src_luma -= (sao_wd_luma + sao_ht_luma * src_strd) * pixel_size_y;
  418|  21.6M|        pu1_src_chroma -= (sao_wd_chroma + sao_ht_chroma * chroma_strd) * pixel_size_uv;
  419|  21.6M|        ps_sao -= (1 + ps_sps->i2_pic_wd_in_ctb);
  420|  21.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|  21.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|  21.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|  21.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|  21.6M|        if(ps_slice_hdr_top_left->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (425:12): [True: 8.73M, False: 12.9M]
  ------------------
  426|  8.73M|        {
  427|  8.73M|            if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (427:16): [True: 8.41M, False: 320k]
  ------------------
  428|  8.41M|            {
  429|  8.41M|                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|  8.41M|#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|  8.41M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.41M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 7.79M, False: 615k]
  |  |  ------------------
  |  |   82|  69.9M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 62.1M, False: 7.79M]
  |  |  ------------------
  |  |   83|  62.1M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  62.1M|        } \
  |  |   85|  7.79M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  7.79M|    } else { \
  |  |   87|   615k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   615k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   615k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   615k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  5.54M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 4.92M, False: 615k]
  |  |  ------------------
  |  |   92|  4.92M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  4.92M|        } \
  |  |   94|   615k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   615k|    } \
  |  |   96|  8.41M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.41M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.41M]
  |  |  ------------------
  ------------------
  430|  8.41M|            }
  431|       |
  432|   320k|            else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (432:21): [True: 170k, False: 149k]
  ------------------
  433|   170k|            {
  434|   170k|                ai1_offset_y[1] = ps_sao->b8_y_offset_1;
  435|   170k|                ai1_offset_y[2] = ps_sao->b8_y_offset_2;
  436|   170k|                ai1_offset_y[3] = ps_sao->b8_y_offset_3;
  437|   170k|                ai1_offset_y[4] = ps_sao->b8_y_offset_4;
  438|       |
  439|   170k|                if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   170k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (439:20): [True: 66.1k, False: 104k]
  ------------------
  440|  66.1k|                {
  441|  66.1k|                    ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
  442|  66.1k|                        pu1_src_luma,
  443|  66.1k|                        src_strd,
  444|  66.1k|                        pu1_src_left_luma,
  445|  66.1k|                        pu1_src_top_luma,
  446|  66.1k|                        pu1_sao_src_luma_top_left_ctb,
  447|  66.1k|                        ps_sao->b5_y_band_pos,
  448|  66.1k|                        ai1_offset_y,
  449|  66.1k|                        sao_wd_luma,
  450|  66.1k|                        sao_ht_luma);
  451|  66.1k|                }
  452|   104k|                else
  453|   104k|                {
  454|   104k|                    ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
  455|   104k|                        (UWORD16 *)pu1_src_luma,
  456|   104k|                        src_strd,
  457|   104k|                        (UWORD16 *)pu1_src_left_luma,
  458|   104k|                        (UWORD16 *)pu1_src_top_luma,
  459|   104k|                        (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
  460|   104k|                        ps_sao->b5_y_band_pos,
  461|   104k|                        ai1_offset_y,
  462|   104k|                        sao_wd_luma,
  463|   104k|                        sao_ht_luma,
  464|   104k|                        u4_bit_depth_luma);
  465|   104k|                }
  466|   170k|            }
  467|       |
  468|   149k|            else // if(2 <= ps_sao->b3_y_type_idx)
  469|   149k|            {
  470|   149k|                ai1_offset_y[1] = ps_sao->b8_y_offset_1;
  471|   149k|                ai1_offset_y[2] = ps_sao->b8_y_offset_2;
  472|   149k|                ai1_offset_y[3] = ps_sao->b8_y_offset_3;
  473|   149k|                ai1_offset_y[4] = ps_sao->b8_y_offset_4;
  474|       |
  475|  1.33M|                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (475:28): [True: 1.18M, False: 149k]
  ------------------
  476|  1.18M|                {
  477|  1.18M|                    au1_avail_luma[i] = 255;
  478|  1.18M|                    au1_tile_slice_boundary[i] = 0;
  479|  1.18M|                    au4_idx_tl[i] = 0;
  480|  1.18M|                    au4_ilf_across_tile_slice_enable[i] = 1;
  481|  1.18M|                }
  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|   149k|                {
  502|   149k|                    if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (502:24): [True: 16.5k, False: 133k]
  |  Branch (502:71): [True: 32.1k, False: 101k]
  ------------------
  503|  47.1k|                    {
  504|  47.1k|                        {
  505|       |                            /*Assuming that sao shift is uniform along x and y directions*/
  506|  47.1k|                            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: 47.1k]
  |  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|  47.1k|                            else if(!(0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (511:37): [True: 47.1k, False: 4]
  ------------------
  512|  47.1k|                            {
  513|  47.1k|                                ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 1;
  514|  47.1k|                                ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 1;
  515|  47.1k|                            }
  516|  47.1k|                            ctbx_tl_t = ps_sao_ctxt->i4_ctb_x - 1;
  517|  47.1k|                            ctby_tl_l = ps_sao_ctxt->i4_ctb_y - 1;
  518|       |
  519|  47.1k|                            ctbx_tl_r = ps_sao_ctxt->i4_ctb_x;
  520|  47.1k|                            ctby_tl_r = ps_sao_ctxt->i4_ctb_y - 1;
  521|       |
  522|  47.1k|                            ctbx_tl_d =  ps_sao_ctxt->i4_ctb_x - 1;
  523|  47.1k|                            ctby_tl_d =  ps_sao_ctxt->i4_ctb_y;
  524|       |
  525|  47.1k|                            ctbx_tl = ps_sao_ctxt->i4_ctb_x - 1;
  526|  47.1k|                            ctby_tl = ps_sao_ctxt->i4_ctb_y - 1;
  527|  47.1k|                        }
  528|       |
  529|  47.1k|                        if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (529:28): [True: 14.9k, False: 32.1k]
  ------------------
  530|  14.9k|                        {
  531|       |                            /*Calculate slice indices for neighbor pixels*/
  532|  14.9k|                            idx_tl   = pu1_slice_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  533|  14.9k|                            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|  14.9k|                            au4_idx_tl[0] =  pu1_slice_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  535|  14.9k|                            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|  14.9k|                            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|  14.9k|                            au4_idx_tl[7] = pu1_slice_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  538|       |
  539|  14.9k|                            if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (539:32): [True: 0, False: 14.9k]
  ------------------
  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|  14.9k|                            if((0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (570:32): [True: 0, False: 14.9k]
  ------------------
  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|  14.9k|                            else
  576|  14.9k|                            {
  577|  14.9k|                                au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_tl[6])->i1_slice_loop_filter_across_slices_enabled_flag;
  578|  14.9k|                            }
  579|  14.9k|                            if((0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma))
  ------------------
  |  Branch (579:32): [True: 0, False: 14.9k]
  ------------------
  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|  14.9k|                            else
  585|  14.9k|                            {
  586|  14.9k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  587|  14.9k|                                au4_ilf_across_tile_slice_enable[4] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  588|  14.9k|                            }
  589|  14.9k|                            au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  590|  14.9k|                            au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  591|  14.9k|                            au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_tl[1])->i1_slice_loop_filter_across_slices_enabled_flag;
  592|  14.9k|                            au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_tl[3])->i1_slice_loop_filter_across_slices_enabled_flag;
  593|  14.9k|                            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|  14.9k|                            if(au4_idx_tl[5] > idx_tl)
  ------------------
  |  Branch (595:32): [True: 840, False: 14.1k]
  ------------------
  596|    840|                            {
  597|    840|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_tl[5])->i1_slice_loop_filter_across_slices_enabled_flag;
  598|    840|                            }
  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|   134k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (606:40): [True: 119k, False: 14.9k]
  ------------------
  607|   119k|                            {
  608|       |                                /*Sets the edges that lie on the slice/tile boundary*/
  609|   119k|                                if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (609:36): [True: 9.42k, False: 110k]
  ------------------
  610|  9.42k|                                {
  611|  9.42k|                                    au1_tile_slice_boundary[i] = 1;
  612|  9.42k|                                }
  613|   110k|                                else
  614|   110k|                                {
  615|   110k|                                    au4_ilf_across_tile_slice_enable[i] = 1;
  616|   110k|                                }
  617|   119k|                            }
  618|       |
  619|  14.9k|                            memset((UWORD8 *)au4_idx_tl, 0, 8 * sizeof(WORD32));
  620|  14.9k|                        }
  621|       |
  622|  47.1k|                        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (622:28): [True: 32.6k, False: 14.4k]
  ------------------
  623|  32.6k|                        {
  624|       |                            /* Calculate availability flags at slice boundary */
  625|  32.6k|                            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.04k, False: 29.6k]
  |  Branch (625:81): [True: 12.5k, False: 17.1k]
  |  Branch (625:133): [True: 10.2k, False: 5.29k]
  |  Branch (625:161): [True: 0, False: 10.2k]
  ------------------
  626|  15.5k|                            {
  627|       |                                /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
  628|  15.5k|                                if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (628:36): [True: 13.6k, False: 1.94k]
  ------------------
  629|  13.6k|                                {
  630|       |                                    /*Set the boundary arrays*/
  631|       |                                    /*Calculate tile indices for neighbor pixels*/
  632|  13.6k|                                    idx_tl   = pu1_tile_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  633|  13.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|  13.6k|                                    au4_idx_tl[0] =  pu1_tile_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  635|  13.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|  13.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|  13.6k|                                    au4_idx_tl[7] = pu1_tile_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  638|       |
  639|  13.6k|                                    if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (639:40): [True: 0, False: 13.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|   122k|                                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (662:48): [True: 108k, False: 13.6k]
  ------------------
  663|   108k|                                    {
  664|       |                                        /*Sets the edges that lie on the tile boundary*/
  665|   108k|                                        if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (665:44): [True: 41.4k, False: 67.3k]
  ------------------
  666|  41.4k|                                        {
  667|  41.4k|                                            au1_tile_slice_boundary[i] |= 1;
  668|  41.4k|                                            au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
  669|  41.4k|                                        }
  670|   108k|                                    }
  671|  13.6k|                                }
  672|  15.5k|                            }
  673|  32.6k|                        }
  674|       |
  675|       |
  676|       |                        /*Set availability flags based on tile and slice boundaries*/
  677|   424k|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (677:36): [True: 376k, False: 47.1k]
  ------------------
  678|   376k|                        {
  679|       |                            /*Sets the edges that lie on the slice/tile boundary*/
  680|   376k|                            if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (680:32): [True: 50.8k, False: 326k]
  |  Branch (680:64): [True: 41.8k, False: 9.06k]
  ------------------
  681|  41.8k|                            {
  682|  41.8k|                                au1_avail_luma[i] = 0;
  683|  41.8k|                            }
  684|   376k|                        }
  685|  47.1k|                    }
  686|   149k|                }
  687|       |
  688|   149k|                if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma)
  ------------------
  |  Branch (688:20): [True: 0, False: 149k]
  ------------------
  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|   149k|                if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (695:20): [True: 0, False: 149k]
  ------------------
  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|   149k|                if((0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma))
  ------------------
  |  Branch (702:20): [True: 0, False: 149k]
  ------------------
  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|   149k|                if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (708:20): [True: 0, False: 149k]
  ------------------
  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|   149k|                if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   149k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (715:20): [True: 78.5k, False: 71.3k]
  ------------------
  716|  78.5k|                {
  717|  78.5k|                    au1_src_top_right[0] = pu1_src_top_luma[sao_wd_luma];
  718|  78.5k|                    u1_sao_src_top_left_luma_bot_left = pu1_src_left_luma[sao_ht_luma];
  719|  78.5k|                    ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
  720|  78.5k|                                                              src_strd,
  721|  78.5k|                                                              pu1_src_left_luma,
  722|  78.5k|                                                              pu1_src_top_luma,
  723|  78.5k|                                                              pu1_sao_src_luma_top_left_ctb,
  724|  78.5k|                                                              au1_src_top_right,
  725|  78.5k|                                                              &u1_sao_src_top_left_luma_bot_left,
  726|  78.5k|                                                              au1_avail_luma,
  727|  78.5k|                                                              ai1_offset_y,
  728|  78.5k|                                                              sao_wd_luma,
  729|  78.5k|                                                              sao_ht_luma);
  730|  78.5k|                }
  731|  71.3k|                else
  732|  71.3k|                {
  733|  71.3k|                    UWORD16 *pu2_src_top_luma = (UWORD16 *)pu1_src_top_luma;
  734|  71.3k|                    UWORD16 *pu2_src_left_luma = (UWORD16 *)pu1_src_left_luma;
  735|  71.3k|                    au2_src_top_right[0] = pu2_src_top_luma[sao_wd_luma];
  736|  71.3k|                    u2_sao_src_top_left_luma_bot_left = pu2_src_left_luma[sao_ht_luma];
  737|  71.3k|                    ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
  738|  71.3k|                                                                  src_strd,
  739|  71.3k|                                                                  (UWORD16 *)pu1_src_left_luma,
  740|  71.3k|                                                                  (UWORD16 *)pu1_src_top_luma,
  741|  71.3k|                                                                  (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
  742|  71.3k|                                                                  au2_src_top_right,
  743|  71.3k|                                                                  &u2_sao_src_top_left_luma_bot_left,
  744|  71.3k|                                                                  au1_avail_luma,
  745|  71.3k|                                                                  ai1_offset_y,
  746|  71.3k|                                                                  sao_wd_luma,
  747|  71.3k|                                                                  sao_ht_luma,
  748|  71.3k|                                                                  u4_bit_depth_luma);
  749|  71.3k|                }
  750|   149k|            }
  751|       |
  752|  8.73M|        }
  753|  12.9M|        else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (753:17): [True: 5.60M, False: 7.34M]
  |  Branch (753:64): [True: 2.98M, False: 4.35M]
  ------------------
  754|  8.58M|        {
  755|  8.58M|            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|  8.58M|#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|  8.58M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.58M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 8.49M, False: 94.3k]
  |  |  ------------------
  |  |   82|  76.2M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 67.8M, False: 8.49M]
  |  |  ------------------
  |  |   83|  67.8M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  67.8M|        } \
  |  |   85|  8.49M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  8.49M|    } else { \
  |  |   87|  94.3k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|  94.3k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|  94.3k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|  94.3k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|   849k|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 755k, False: 94.3k]
  |  |  ------------------
  |  |   92|   755k|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|   755k|        } \
  |  |   94|  94.3k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|  94.3k|    } \
  |  |   96|  8.58M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.58M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.58M]
  |  |  ------------------
  ------------------
  756|  8.58M|        }
  757|       |
  758|  21.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: 21.5M, False: 116k]
  |  Branch (758:73): [True: 7.99M, False: 13.5M]
  ------------------
  759|  7.99M|        {
  760|  7.99M|            if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (760:16): [True: 7.68M, False: 311k]
  ------------------
  761|  7.68M|            {
  762|  7.68M|                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.68M|#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.68M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  7.68M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 6.96M, False: 719k]
  |  |  ------------------
  |  |  101|  62.5M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 55.6M, False: 6.96M]
  |  |  ------------------
  |  |  102|  55.6M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  55.6M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  55.6M|        } \
  |  |  105|  6.96M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  6.96M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  6.96M|    } else { \
  |  |  108|   719k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   719k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   719k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   719k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  6.47M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 5.75M, False: 719k]
  |  |  ------------------
  |  |  113|  5.75M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  5.75M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  5.75M|        } \
  |  |  116|   719k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   719k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   719k|    } \
  |  |  119|  7.68M|    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.68M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 7.68M]
  |  |  ------------------
  ------------------
  763|  7.68M|            }
  764|       |
  765|   311k|            else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (765:21): [True: 142k, False: 169k]
  ------------------
  766|   142k|            {
  767|   142k|                ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
  768|   142k|                ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
  769|   142k|                ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
  770|   142k|                ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
  771|       |
  772|   142k|                ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
  773|   142k|                ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
  774|   142k|                ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
  775|   142k|                ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
  776|       |
  777|   142k|                if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (777:20): [True: 16.3k, False: 125k]
  ------------------
  778|  16.3k|                {
  779|  16.3k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  16.3k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (779:24): [True: 9.66k, False: 6.72k]
  ------------------
  780|  9.66k|                    {
  781|  9.66k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
  782|  9.66k|                            pu1_src_chroma,
  783|  9.66k|                            chroma_strd,
  784|  9.66k|                            pu1_src_left_chroma,
  785|  9.66k|                            pu1_src_top_chroma,
  786|  9.66k|                            pu1_sao_src_chroma_top_left_ctb,
  787|  9.66k|                            ps_sao->b5_cr_band_pos,
  788|  9.66k|                            ps_sao->b5_cb_band_pos,
  789|  9.66k|                            ai1_offset_cr,
  790|  9.66k|                            ai1_offset_cb,
  791|  9.66k|                            sao_wd_chroma,
  792|  9.66k|                            sao_ht_chroma);
  793|  9.66k|                    }
  794|  6.72k|                    else
  795|  6.72k|                    {
  796|  6.72k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
  797|  6.72k|                            (UWORD16 *)pu1_src_chroma,
  798|  6.72k|                            chroma_strd,
  799|  6.72k|                            (UWORD16 *)pu1_src_left_chroma,
  800|  6.72k|                            (UWORD16 *)pu1_src_top_chroma,
  801|  6.72k|                            (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
  802|  6.72k|                            ps_sao->b5_cr_band_pos,
  803|  6.72k|                            ps_sao->b5_cb_band_pos,
  804|  6.72k|                            ai1_offset_cr,
  805|  6.72k|                            ai1_offset_cb,
  806|  6.72k|                            sao_wd_chroma,
  807|  6.72k|                            sao_ht_chroma,
  808|  6.72k|                            u4_bit_depth_chroma);
  809|  6.72k|                    }
  810|  16.3k|                }
  811|   125k|                else
  812|   125k|                {
  813|   125k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   125k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (813:24): [True: 38.2k, False: 87.3k]
  ------------------
  814|  38.2k|                    {
  815|  38.2k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
  816|  38.2k|                            pu1_src_chroma,
  817|  38.2k|                            chroma_strd,
  818|  38.2k|                            pu1_src_left_chroma,
  819|  38.2k|                            pu1_src_top_chroma,
  820|  38.2k|                            pu1_sao_src_chroma_top_left_ctb,
  821|  38.2k|                            ps_sao->b5_cb_band_pos,
  822|  38.2k|                            ps_sao->b5_cr_band_pos,
  823|  38.2k|                            ai1_offset_cb,
  824|  38.2k|                            ai1_offset_cr,
  825|  38.2k|                            sao_wd_chroma,
  826|  38.2k|                            sao_ht_chroma);
  827|  38.2k|                    }
  828|  87.3k|                    else
  829|  87.3k|                    {
  830|  87.3k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
  831|  87.3k|                            (UWORD16 *)pu1_src_chroma,
  832|  87.3k|                            chroma_strd,
  833|  87.3k|                            (UWORD16 *)pu1_src_left_chroma,
  834|  87.3k|                            (UWORD16 *)pu1_src_top_chroma,
  835|  87.3k|                            (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
  836|  87.3k|                            ps_sao->b5_cb_band_pos,
  837|  87.3k|                            ps_sao->b5_cr_band_pos,
  838|  87.3k|                            ai1_offset_cb,
  839|  87.3k|                            ai1_offset_cr,
  840|  87.3k|                            sao_wd_chroma,
  841|  87.3k|                            sao_ht_chroma,
  842|  87.3k|                            u4_bit_depth_chroma);
  843|  87.3k|                    }
  844|   125k|                }
  845|   142k|            }
  846|       |
  847|   169k|            else // if(2 <= ps_sao->b3_cb_type_idx)
  848|   169k|            {
  849|   169k|                ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
  850|   169k|                ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
  851|   169k|                ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
  852|   169k|                ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
  853|       |
  854|   169k|                ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
  855|   169k|                ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
  856|   169k|                ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
  857|   169k|                ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
  858|  1.54M|                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (858:28): [True: 1.37M, False: 169k]
  ------------------
  859|  1.37M|                {
  860|  1.37M|                    au1_avail_chroma[i] = 255;
  861|  1.37M|                    au1_tile_slice_boundary[i] = 0;
  862|  1.37M|                    au4_idx_tl[i] = 0;
  863|  1.37M|                    au4_ilf_across_tile_slice_enable[i] = 1;
  864|  1.37M|                }
  865|       |                /*In case of slices*/
  866|   169k|                {
  867|   169k|                    if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (867:24): [True: 16.5k, False: 153k]
  |  Branch (867:71): [True: 32.2k, False: 120k]
  ------------------
  868|  50.8k|                    {
  869|  50.8k|                        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: 10.0k, False: 40.7k]
  |  Branch (869:75): [True: 4.43k, False: 5.64k]
  |  Branch (869:106): [True: 3.53k, False: 902]
  ------------------
  870|  3.53k|                        {
  871|  3.53k|                            ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 2;
  872|  3.53k|                            ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 2;
  873|  3.53k|                        }
  874|  47.3k|                        else if(!(0 == (1 << log2_ctb_size) - sao_wd_chroma))
  ------------------
  |  Branch (874:33): [True: 40.7k, False: 6.54k]
  ------------------
  875|  40.7k|                        {
  876|  40.7k|                            ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 1;
  877|  40.7k|                            ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 1;
  878|  40.7k|                        }
  879|  50.8k|                        ctbx_tl_t = ps_sao_ctxt->i4_ctb_x - 1;
  880|  50.8k|                        ctby_tl_l = ps_sao_ctxt->i4_ctb_y - 1;
  881|       |
  882|  50.8k|                        ctbx_tl_r = ps_sao_ctxt->i4_ctb_x;
  883|  50.8k|                        ctby_tl_r = ps_sao_ctxt->i4_ctb_y - 1;
  884|       |
  885|  50.8k|                        ctbx_tl_d =  ps_sao_ctxt->i4_ctb_x - 1;
  886|  50.8k|                        ctby_tl_d =  ps_sao_ctxt->i4_ctb_y;
  887|       |
  888|  50.8k|                        ctbx_tl = ps_sao_ctxt->i4_ctb_x - 1;
  889|  50.8k|                        ctby_tl = ps_sao_ctxt->i4_ctb_y - 1;
  890|       |
  891|  50.8k|                        if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (891:28): [True: 18.5k, False: 32.2k]
  ------------------
  892|  18.5k|                        {
  893|       |
  894|  18.5k|                            idx_tl   = pu1_slice_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  895|  18.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));
  896|  18.5k|                            au4_idx_tl[0] =  pu1_slice_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  897|  18.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)];
  898|  18.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)];
  899|  18.5k|                            au4_idx_tl[7] = pu1_slice_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  900|       |
  901|  18.5k|                            if((0 == (1 << log2_ctb_size) - sao_wd_chroma))
  ------------------
  |  Branch (901:32): [True: 4.79k, False: 13.7k]
  ------------------
  902|  4.79k|                            {
  903|  4.79k|                                if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (903:36): [True: 218, False: 4.57k]
  ------------------
  904|    218|                                {
  905|    218|                                    au4_idx_tl[6] = -1;
  906|    218|                                    au4_idx_tl[4] = -1;
  907|    218|                                }
  908|  4.57k|                                else
  909|  4.57k|                                {
  910|  4.57k|                                    au4_idx_tl[6] = pu1_slice_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  911|  4.57k|                                }
  912|  4.79k|                                if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (912:36): [True: 2.83k, False: 1.96k]
  ------------------
  913|  2.83k|                                {
  914|  2.83k|                                    au4_idx_tl[5] = -1;
  915|  2.83k|                                    au4_idx_tl[4] = -1;
  916|  2.83k|                                }
  917|  1.96k|                                else
  918|  1.96k|                                {
  919|  1.96k|                                    au4_idx_tl[5] = pu1_slice_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  920|  1.96k|                                    if(ctbx_tl_t > 0)
  ------------------
  |  Branch (920:40): [True: 1.78k, False: 180]
  ------------------
  921|  1.78k|                                        au4_idx_tl[4] = pu1_slice_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
  922|  1.96k|                                }
  923|  4.79k|                                au4_idx_tl[7] = pu1_slice_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  924|  4.79k|                            }
  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|  18.5k|                            if((0 == ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor)) - sao_wd_chroma))
  ------------------
  |  Branch (928:32): [True: 218, False: 18.3k]
  ------------------
  929|    218|                            {
  930|    218|                                au4_ilf_across_tile_slice_enable[4] = 0;
  931|    218|                                au4_ilf_across_tile_slice_enable[6] = 0;
  932|    218|                            }
  933|  18.3k|                            else
  934|  18.3k|                            {
  935|  18.3k|                                au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  936|  18.3k|                            }
  937|  18.5k|                            if((0 == ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) - sao_ht_chroma))
  ------------------
  |  Branch (937:32): [True: 2.83k, False: 15.7k]
  ------------------
  938|  2.83k|                            {
  939|  2.83k|                                au4_ilf_across_tile_slice_enable[5] = 0;
  940|  2.83k|                                au4_ilf_across_tile_slice_enable[4] = 0;
  941|  2.83k|                            }
  942|  15.7k|                            else
  943|  15.7k|                            {
  944|  15.7k|                                au4_ilf_across_tile_slice_enable[4] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  945|  15.7k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  946|  15.7k|                            }
  947|       |
  948|  18.5k|                            if(au4_idx_tl[5] > idx_tl)
  ------------------
  |  Branch (948:32): [True: 1.07k, False: 17.4k]
  ------------------
  949|  1.07k|                            {
  950|  1.07k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_tl[5])->i1_slice_loop_filter_across_slices_enabled_flag;
  951|  1.07k|                            }
  952|  18.5k|                            if(au4_idx_tl[6] > idx_tl)
  ------------------
  |  Branch (952:32): [True: 1.08k, False: 17.4k]
  ------------------
  953|  1.08k|                            {
  954|  1.08k|                                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.08k|                            }
  956|  18.5k|                            au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  957|  18.5k|                            au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  958|  18.5k|                            au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_tl[1])->i1_slice_loop_filter_across_slices_enabled_flag;
  959|  18.5k|                            au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_tl[3])->i1_slice_loop_filter_across_slices_enabled_flag;
  960|  18.5k|                            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|   166k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (965:40): [True: 148k, False: 18.5k]
  ------------------
  966|   148k|                            {
  967|       |                                /*Sets the edges that lie on the slice/tile boundary*/
  968|   148k|                                if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (968:36): [True: 12.4k, False: 135k]
  ------------------
  969|  12.4k|                                {
  970|  12.4k|                                    au1_tile_slice_boundary[i] = 1;
  971|  12.4k|                                }
  972|   135k|                                else
  973|   135k|                                {
  974|   135k|                                    au4_ilf_across_tile_slice_enable[i] = 1;
  975|   135k|                                }
  976|   148k|                            }
  977|       |
  978|       |                            /*Reset indices*/
  979|   166k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (979:40): [True: 148k, False: 18.5k]
  ------------------
  980|   148k|                            {
  981|   148k|                                au4_idx_tl[i] = 0;
  982|   148k|                            }
  983|  18.5k|                        }
  984|  50.8k|                        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (984:28): [True: 33.3k, False: 17.4k]
  ------------------
  985|  33.3k|                        {
  986|       |                            /* Calculate availability flags at slice boundary */
  987|  33.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 (987:33): [True: 3.59k, False: 29.7k]
  |  Branch (987:81): [True: 13.3k, False: 16.3k]
  |  Branch (987:133): [True: 11.4k, False: 5.56k]
  |  Branch (987:161): [True: 0, False: 11.4k]
  ------------------
  988|  16.9k|                            {
  989|       |                                /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
  990|  16.9k|                                if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (990:36): [True: 14.5k, False: 2.46k]
  ------------------
  991|  14.5k|                                {
  992|       |                                    /*Set the boundary arrays*/
  993|       |                                    /*Calculate tile indices for neighbor pixels*/
  994|  14.5k|                                    idx_tl   = pu1_tile_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  995|  14.5k|                                    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|  14.5k|                                    au4_idx_tl[0] =  pu1_tile_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  997|  14.5k|                                    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|  14.5k|                                    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|  14.5k|                                    au4_idx_tl[7] = pu1_tile_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1000|       |
 1001|  14.5k|                                    if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (1001:40): [True: 0, False: 14.5k]
  ------------------
 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|   130k|                                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1024:48): [True: 116k, False: 14.5k]
  ------------------
 1025|   116k|                                    {
 1026|       |                                        /*Sets the edges that lie on the tile boundary*/
 1027|   116k|                                        if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (1027:44): [True: 45.3k, False: 70.6k]
  ------------------
 1028|  45.3k|                                        {
 1029|  45.3k|                                            au1_tile_slice_boundary[i] |= 1;
 1030|  45.3k|                                            au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 1031|  45.3k|                                        }
 1032|   116k|                                    }
 1033|  14.5k|                                }
 1034|  16.9k|                            }
 1035|  33.3k|                        }
 1036|       |
 1037|   457k|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1037:36): [True: 406k, False: 50.8k]
  ------------------
 1038|   406k|                        {
 1039|       |                            /*Sets the edges that lie on the slice/tile boundary*/
 1040|   406k|                            if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1040:32): [True: 57.8k, False: 348k]
  |  Branch (1040:64): [True: 52.0k, False: 5.82k]
  ------------------
 1041|  52.0k|                            {
 1042|  52.0k|                                au1_avail_chroma[i] = 0;
 1043|  52.0k|                            }
 1044|   406k|                        }
 1045|  50.8k|                    }
 1046|   169k|                }
 1047|       |
 1048|   169k|                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.38k, False: 166k]
  ------------------
 1049|  3.38k|                {
 1050|  3.38k|                    au1_avail_chroma[0] = 0;
 1051|  3.38k|                    au1_avail_chroma[4] = 0;
 1052|  3.38k|                    au1_avail_chroma[6] = 0;
 1053|  3.38k|                }
 1054|   169k|                if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1054:20): [True: 0, False: 169k]
  ------------------
 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|   169k|                if(0 == ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) - sao_ht_chroma)
  ------------------
  |  Branch (1061:20): [True: 7.41k, False: 162k]
  ------------------
 1062|  7.41k|                {
 1063|  7.41k|                    au1_avail_chroma[2] = 0;
 1064|  7.41k|                    au1_avail_chroma[4] = 0;
 1065|  7.41k|                    au1_avail_chroma[5] = 0;
 1066|  7.41k|                }
 1067|   169k|                if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1067:20): [True: 0, False: 169k]
  ------------------
 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|   169k|                if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   169k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1074:20): [True: 82.7k, False: 86.9k]
  ------------------
 1075|  82.7k|                {
 1076|  82.7k|                    au1_src_top_right[0] = pu1_src_top_chroma[sao_wd_chroma];
 1077|  82.7k|                    au1_src_top_right[1] = pu1_src_top_chroma[sao_wd_chroma + 1];
 1078|  82.7k|                    au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_left_chroma[2 * sao_ht_chroma];
 1079|  82.7k|                    au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_left_chroma[2 * sao_ht_chroma + 1];
 1080|  82.7k|                    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: 11.1k, False: 71.5k]
  |  Branch (1080:61): [True: 9.16k, False: 2.02k]
  ------------------
 1081|  9.16k|                    {
 1082|  9.16k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1083|  9.16k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1084|  9.16k|                    }
 1085|       |
 1086|  82.7k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1086:24): [True: 17.4k, False: 65.2k]
  ------------------
 1087|  17.4k|                    {
 1088|  17.4k|                        ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1089|  17.4k|                                                                     chroma_strd,
 1090|  17.4k|                                                                     pu1_src_left_chroma,
 1091|  17.4k|                                                                     pu1_src_top_chroma,
 1092|  17.4k|                                                                     pu1_sao_src_chroma_top_left_ctb,
 1093|  17.4k|                                                                     au1_src_top_right,
 1094|  17.4k|                                                                     au1_sao_src_top_left_chroma_bot_left,
 1095|  17.4k|                                                                     au1_avail_chroma,
 1096|  17.4k|                                                                     ai1_offset_cr,
 1097|  17.4k|                                                                     ai1_offset_cb,
 1098|  17.4k|                                                                     sao_wd_chroma,
 1099|  17.4k|                                                                     sao_ht_chroma);
 1100|  17.4k|                    }
 1101|  65.2k|                    else
 1102|  65.2k|                    {
 1103|  65.2k|                        ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1104|  65.2k|                                                                     chroma_strd,
 1105|  65.2k|                                                                     pu1_src_left_chroma,
 1106|  65.2k|                                                                     pu1_src_top_chroma,
 1107|  65.2k|                                                                     pu1_sao_src_chroma_top_left_ctb,
 1108|  65.2k|                                                                     au1_src_top_right,
 1109|  65.2k|                                                                     au1_sao_src_top_left_chroma_bot_left,
 1110|  65.2k|                                                                     au1_avail_chroma,
 1111|  65.2k|                                                                     ai1_offset_cb,
 1112|  65.2k|                                                                     ai1_offset_cr,
 1113|  65.2k|                                                                     sao_wd_chroma,
 1114|  65.2k|                                                                     sao_ht_chroma);
 1115|  65.2k|                    }
 1116|  82.7k|                }
 1117|  86.9k|                else
 1118|  86.9k|                {
 1119|  86.9k|                    UWORD16 *pu2_src_top_chroma = (UWORD16 *)pu1_src_top_chroma;
 1120|  86.9k|                    UWORD16 *pu2_src_left_chroma = (UWORD16 *)pu1_src_left_chroma;
 1121|  86.9k|                    UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 1122|       |
 1123|  86.9k|                    au2_src_top_right[0] = pu2_src_top_chroma[sao_wd_chroma];
 1124|  86.9k|                    au2_src_top_right[1] = pu2_src_top_chroma[sao_wd_chroma + 1];
 1125|  86.9k|                    au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_left_chroma[2 * sao_ht_chroma];
 1126|  86.9k|                    au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_left_chroma[2 * sao_ht_chroma + 1];
 1127|  86.9k|                    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: 4.88k, False: 82.0k]
  |  Branch (1127:61): [True: 4.47k, False: 414]
  ------------------
 1128|  4.47k|                    {
 1129|  4.47k|                        au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1130|  4.47k|                        au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1131|  4.47k|                    }
 1132|       |
 1133|  86.9k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1133:24): [True: 16.3k, False: 70.6k]
  ------------------
 1134|  16.3k|                    {
 1135|  16.3k|                        ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1136|  16.3k|                                                                         chroma_strd,
 1137|  16.3k|                                                                         (UWORD16 *)pu1_src_left_chroma,
 1138|  16.3k|                                                                         (UWORD16 *)pu1_src_top_chroma,
 1139|  16.3k|                                                                         (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1140|  16.3k|                                                                         au2_src_top_right,
 1141|  16.3k|                                                                         au2_sao_src_top_left_chroma_bot_left,
 1142|  16.3k|                                                                         au1_avail_chroma,
 1143|  16.3k|                                                                         ai1_offset_cr,
 1144|  16.3k|                                                                         ai1_offset_cb,
 1145|  16.3k|                                                                         sao_wd_chroma,
 1146|  16.3k|                                                                         sao_ht_chroma,
 1147|  16.3k|                                                                         u4_bit_depth_chroma);
 1148|  16.3k|                    }
 1149|  70.6k|                    else
 1150|  70.6k|                    {
 1151|  70.6k|                        ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1152|  70.6k|                                                                         chroma_strd,
 1153|  70.6k|                                                                         (UWORD16 *)pu1_src_left_chroma,
 1154|  70.6k|                                                                         (UWORD16 *)pu1_src_top_chroma,
 1155|  70.6k|                                                                         (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1156|  70.6k|                                                                         au2_src_top_right,
 1157|  70.6k|                                                                         au2_sao_src_top_left_chroma_bot_left,
 1158|  70.6k|                                                                         au1_avail_chroma,
 1159|  70.6k|                                                                         ai1_offset_cb,
 1160|  70.6k|                                                                         ai1_offset_cr,
 1161|  70.6k|                                                                         sao_wd_chroma,
 1162|  70.6k|                                                                         sao_ht_chroma,
 1163|  70.6k|                                                                         u4_bit_depth_chroma);
 1164|  70.6k|                    }
 1165|  86.9k|                }
 1166|   169k|            }
 1167|  7.99M|        }
 1168|  13.6M|        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: 13.5M, False: 118k]
  |  Branch (1168:79): [True: 5.88M, False: 7.68M]
  |  Branch (1168:126): [True: 3.79M, False: 3.89M]
  ------------------
 1169|  9.68M|        {
 1170|  9.68M|            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|  9.68M|#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|  9.68M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  9.68M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 9.66M, False: 17.4k]
  |  |  ------------------
  |  |  101|  86.7M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 77.0M, False: 9.66M]
  |  |  ------------------
  |  |  102|  77.0M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  77.0M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  77.0M|        } \
  |  |  105|  9.66M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  9.66M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  9.66M|    } else { \
  |  |  108|  17.4k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  17.4k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  17.4k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  17.4k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|   122k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 105k, False: 17.4k]
  |  |  ------------------
  |  |  113|   105k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|   105k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|   105k|        } \
  |  |  116|  17.4k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  17.4k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  17.4k|    } \
  |  |  119|  9.68M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  9.68M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 9.68M]
  |  |  ------------------
  ------------------
 1171|  9.68M|        }
 1172|       |
 1173|  21.6M|        pu1_src_luma += (sao_wd_luma + sao_ht_luma * src_strd) * pixel_size_y;
 1174|  21.6M|        pu1_src_chroma += (sao_wd_chroma + sao_ht_chroma * chroma_strd) * pixel_size_uv;
 1175|  21.6M|        ps_sao += (1 + ps_sps->i2_pic_wd_in_ctb);
 1176|  21.6M|    }
 1177|       |
 1178|       |
 1179|       |    /* Top CTB */
 1180|  23.5M|    if((ps_sao_ctxt->i4_ctb_y > 0))
  ------------------
  |  Branch (1180:8): [True: 22.3M, False: 1.12M]
  ------------------
 1181|  22.3M|    {
 1182|  22.3M|        WORD32 sao_wd_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1183|  22.3M|        WORD32 sao_wd_chroma = ctb_size * (chroma_pixel_strd / h_samp_factor) - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1184|  22.3M|        WORD32 sao_ht_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1185|  22.3M|        WORD32 sao_ht_chroma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1186|       |
 1187|  22.3M|        WORD32 ctbx_t_t = 0, ctbx_t_l = 0, ctbx_t_r = 0, ctbx_t_d = 0, ctbx_t = 0;
 1188|  22.3M|        WORD32 ctby_t_t = 0, ctby_t_l = 0, ctby_t_r = 0, ctby_t_d = 0, ctby_t = 0;
 1189|  22.3M|        WORD32 au4_idx_t[8], idx_t;
 1190|       |
 1191|  22.3M|        WORD32 remaining_cols;
 1192|       |
 1193|  22.3M|        slice_header_t *ps_slice_hdr_top;
 1194|  22.3M|        {
 1195|  22.3M|            WORD32 top_ctb_indx = (ps_sao_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb +
 1196|  22.3M|                                        (ps_sao_ctxt->i4_ctb_x);
 1197|  22.3M|            ps_slice_hdr_top = ps_slice_hdr_base + pu1_slice_idx[top_ctb_indx];
 1198|  22.3M|        }
 1199|       |
 1200|  22.3M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_luma);
 1201|  22.3M|        if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  22.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1201:12): [True: 899k, False: 21.4M]
  ------------------
 1202|   899k|        {
 1203|   899k|            sao_wd_luma += remaining_cols;
 1204|   899k|        }
 1205|  22.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|  22.3M|        if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  22.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1206:12): [True: 899k, False: 21.4M]
  ------------------
 1207|   899k|        {
 1208|   899k|            sao_wd_chroma += remaining_cols;
 1209|   899k|        }
 1210|       |
 1211|  22.3M|        pu1_src_luma -= (sao_ht_luma * src_strd) * pixel_size_y;
 1212|  22.3M|        pu1_src_chroma -= (sao_ht_chroma * chroma_strd) * pixel_size_uv;
 1213|  22.3M|        ps_sao -= (ps_sps->i2_pic_wd_in_ctb);
 1214|  22.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|  22.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|  22.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|  22.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|  22.3M|        if(0 != sao_wd_luma)
  ------------------
  |  Branch (1219:12): [True: 22.3M, False: 18.4E]
  ------------------
 1220|  22.3M|        {
 1221|  22.3M|            if(ps_slice_hdr_top->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (1221:16): [True: 8.88M, False: 13.5M]
  ------------------
 1222|  8.88M|            {
 1223|  8.88M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1223:20): [True: 8.53M, False: 355k]
  ------------------
 1224|  8.53M|                {
 1225|  8.53M|                    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|  8.53M|#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|  8.53M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.53M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 7.86M, False: 667k]
  |  |  ------------------
  |  |   82|  70.4M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 62.6M, False: 7.86M]
  |  |  ------------------
  |  |   83|  62.6M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  62.6M|        } \
  |  |   85|  7.86M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  7.86M|    } else { \
  |  |   87|   667k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   667k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   667k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   667k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  6.01M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 5.34M, False: 667k]
  |  |  ------------------
  |  |   92|  5.34M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  5.34M|        } \
  |  |   94|   667k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   667k|    } \
  |  |   96|  8.53M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.53M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.53M]
  |  |  ------------------
  ------------------
 1226|  8.53M|                }
 1227|       |
 1228|   355k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1228:25): [True: 189k, False: 166k]
  ------------------
 1229|   189k|                {
 1230|   189k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 1231|   189k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 1232|   189k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 1233|   189k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 1234|       |
 1235|   189k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   189k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1235:24): [True: 74.8k, False: 114k]
  ------------------
 1236|  74.8k|                    {
 1237|  74.8k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
 1238|  74.8k|                            pu1_src_luma,
 1239|  74.8k|                            src_strd,
 1240|  74.8k|                            pu1_src_left_luma,
 1241|  74.8k|                            pu1_src_top_luma,
 1242|  74.8k|                            pu1_sao_src_luma_top_left_ctb,
 1243|  74.8k|                            ps_sao->b5_y_band_pos,
 1244|  74.8k|                            ai1_offset_y,
 1245|  74.8k|                            sao_wd_luma,
 1246|  74.8k|                            sao_ht_luma);
 1247|  74.8k|                    }
 1248|   114k|                    else
 1249|   114k|                    {
 1250|   114k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
 1251|   114k|                            (UWORD16 *)pu1_src_luma,
 1252|   114k|                            src_strd,
 1253|   114k|                            (UWORD16 *)pu1_src_left_luma,
 1254|   114k|                            (UWORD16 *)pu1_src_top_luma,
 1255|   114k|                            (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
 1256|   114k|                            ps_sao->b5_y_band_pos,
 1257|   114k|                            ai1_offset_y,
 1258|   114k|                            sao_wd_luma,
 1259|   114k|                            sao_ht_luma,
 1260|   114k|                            u4_bit_depth_luma);
 1261|   114k|                    }
 1262|   189k|                }
 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.51M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1275:32): [True: 1.35M, False: 166k]
  ------------------
 1276|  1.35M|                    {
 1277|       |
 1278|  1.35M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1279|  1.35M|                    }
 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: 12.4k, False: 153k]
  |  Branch (1299:75): [True: 39.6k, False: 114k]
  ------------------
 1300|  54.9k|                        {
 1301|       |
 1302|  54.9k|                            ctbx_t_t = ps_sao_ctxt->i4_ctb_x;
 1303|  54.9k|                            ctby_t_t = ps_sao_ctxt->i4_ctb_y - 1;
 1304|       |
 1305|  54.9k|                            ctbx_t_l = ps_sao_ctxt->i4_ctb_x - 1;
 1306|  54.9k|                            ctby_t_l = ps_sao_ctxt->i4_ctb_y - 1;
 1307|       |
 1308|  54.9k|                            ctbx_t_r = ps_sao_ctxt->i4_ctb_x;
 1309|  54.9k|                            ctby_t_r = ps_sao_ctxt->i4_ctb_y - 1;
 1310|       |
 1311|  54.9k|                            ctbx_t_d =  ps_sao_ctxt->i4_ctb_x;
 1312|  54.9k|                            ctby_t_d =  ps_sao_ctxt->i4_ctb_y;
 1313|       |
 1314|  54.9k|                            ctbx_t = ps_sao_ctxt->i4_ctb_x;
 1315|  54.9k|                            ctby_t = ps_sao_ctxt->i4_ctb_y - 1;
 1316|       |
 1317|  54.9k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1317:32): [True: 15.2k, False: 39.6k]
  ------------------
 1318|  15.2k|                            {
 1319|       |                                /*Calculate neighbor ctb slice indices*/
 1320|  15.2k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1320:36): [True: 1.17k, False: 14.0k]
  ------------------
 1321|  1.17k|                                {
 1322|  1.17k|                                    au4_idx_t[0] = -1;
 1323|  1.17k|                                    au4_idx_t[6] = -1;
 1324|  1.17k|                                    au4_idx_t[4] = -1;
 1325|  1.17k|                                }
 1326|  14.0k|                                else
 1327|  14.0k|                                {
 1328|  14.0k|                                    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|  14.0k|                                    au4_idx_t[6] = pu1_slice_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1330|  14.0k|                                }
 1331|  15.2k|                                idx_t   = pu1_slice_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1332|  15.2k|                                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|  15.2k|                                au4_idx_t[1] = pu1_slice_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1334|  15.2k|                                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|  15.2k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1337:36): [True: 1.17k, False: 14.0k]
  ------------------
 1338|  1.17k|                                {
 1339|  1.17k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 1340|  1.17k|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 1341|  1.17k|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 1342|  1.17k|                                }
 1343|  14.0k|                                else
 1344|  14.0k|                                {
 1345|  14.0k|                                    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|  14.0k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_t[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 1347|  14.0k|                                }
 1348|       |
 1349|       |
 1350|       |
 1351|  15.2k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1352|  15.2k|                                au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1353|  15.2k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_t[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 1354|  15.2k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_t[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 1355|  15.2k|                                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|  15.2k|                                if(au4_idx_t[6] < idx_t)
  ------------------
  |  Branch (1357:36): [True: 1.18k, False: 14.0k]
  ------------------
 1358|  1.18k|                                {
 1359|  1.18k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1360|  1.18k|                                }
 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|   137k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1367:44): [True: 122k, False: 15.2k]
  ------------------
 1368|   122k|                                {
 1369|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 1370|   122k|                                    if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1370:40): [True: 11.5k, False: 110k]
  ------------------
 1371|  11.5k|                                    {
 1372|  11.5k|                                        au1_tile_slice_boundary[i] = 1;
 1373|       |                                        /*Check for slice flag at such boundaries*/
 1374|  11.5k|                                    }
 1375|   110k|                                    else
 1376|   110k|                                    {
 1377|   110k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 1378|   110k|                                    }
 1379|   122k|                                }
 1380|       |                                /*Reset indices*/
 1381|   137k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1381:44): [True: 122k, False: 15.2k]
  ------------------
 1382|   122k|                                {
 1383|   122k|                                    au4_idx_t[i] = 0;
 1384|   122k|                                }
 1385|  15.2k|                            }
 1386|       |
 1387|  54.9k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1387:32): [True: 39.8k, False: 15.0k]
  ------------------
 1388|  39.8k|                            {
 1389|       |                                /* Calculate availability flags at slice boundary */
 1390|  39.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 (1390:37): [True: 11.4k, False: 28.3k]
  |  Branch (1390:85): [True: 12.0k, False: 16.3k]
  |  Branch (1390:137): [True: 19.6k, False: 3.93k]
  |  Branch (1390:165): [True: 4.01k, False: 15.6k]
  ------------------
 1391|  19.5k|                                {
 1392|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1393|  19.5k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1393:40): [True: 17.5k, False: 1.99k]
  ------------------
 1394|  17.5k|                                    {
 1395|       |                                        /*Calculate neighbor ctb slice indices*/
 1396|  17.5k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1396:44): [True: 5.13k, False: 12.4k]
  ------------------
 1397|  5.13k|                                        {
 1398|  5.13k|                                            au4_idx_t[0] = -1;
 1399|  5.13k|                                            au4_idx_t[6] = -1;
 1400|  5.13k|                                            au4_idx_t[4] = -1;
 1401|  5.13k|                                        }
 1402|  12.4k|                                        else
 1403|  12.4k|                                        {
 1404|  12.4k|                                            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|  12.4k|                                            au4_idx_t[6] = pu1_tile_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1406|  12.4k|                                        }
 1407|  17.5k|                                        idx_t   = pu1_tile_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1408|  17.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|  17.5k|                                        au4_idx_t[1] = pu1_tile_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1410|  17.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|   157k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1412:52): [True: 140k, False: 17.5k]
  ------------------
 1413|   140k|                                        {
 1414|       |                                            /*Sets the edges that lie on the tile boundary*/
 1415|   140k|                                            if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1415:48): [True: 57.2k, False: 83.0k]
  ------------------
 1416|  57.2k|                                            {
 1417|  57.2k|                                                au1_tile_slice_boundary[i] |= 1;
 1418|  57.2k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 1419|  57.2k|                                            }
 1420|   140k|                                        }
 1421|  17.5k|                                    }
 1422|  19.5k|                                }
 1423|  39.8k|                            }
 1424|       |
 1425|   493k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1425:40): [True: 439k, False: 54.9k]
  ------------------
 1426|   439k|                            {
 1427|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 1428|   439k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1428:36): [True: 68.7k, False: 370k]
  |  Branch (1428:68): [True: 60.3k, False: 8.47k]
  ------------------
 1429|  60.3k|                                {
 1430|  60.3k|                                    au1_avail_luma[i] = 0;
 1431|  60.3k|                                }
 1432|   439k|                            }
 1433|  54.9k|                        }
 1434|   166k|                    }
 1435|       |
 1436|       |
 1437|   166k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1437:24): [True: 28.7k, False: 137k]
  ------------------
 1438|  28.7k|                    {
 1439|  28.7k|                        au1_avail_luma[0] = 0;
 1440|  28.7k|                        au1_avail_luma[4] = 0;
 1441|  28.7k|                        au1_avail_luma[6] = 0;
 1442|  28.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: 20.6k, False: 145k]
  ------------------
 1445|  20.6k|                    {
 1446|  20.6k|                        au1_avail_luma[1] = 0;
 1447|  20.6k|                        au1_avail_luma[5] = 0;
 1448|  20.6k|                        au1_avail_luma[7] = 0;
 1449|  20.6k|                    }
 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: 91.1k, False: 75.0k]
  ------------------
 1466|  91.1k|                    {
 1467|  91.1k|                        au1_src_top_right[0] = pu1_sao_src_top_left_luma_top_right[0];
 1468|  91.1k|                        u1_sao_src_top_left_luma_bot_left = pu1_src_luma[sao_ht_luma * src_strd - 1];
 1469|  91.1k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 1470|  91.1k|                                                                  src_strd,
 1471|  91.1k|                                                                  pu1_src_left_luma,
 1472|  91.1k|                                                                  pu1_src_top_luma,
 1473|  91.1k|                                                                  pu1_sao_src_luma_top_left_ctb,
 1474|  91.1k|                                                                  au1_src_top_right,
 1475|  91.1k|                                                                  &u1_sao_src_top_left_luma_bot_left,
 1476|  91.1k|                                                                  au1_avail_luma,
 1477|  91.1k|                                                                  ai1_offset_y,
 1478|  91.1k|                                                                  sao_wd_luma,
 1479|  91.1k|                                                                  sao_ht_luma);
 1480|  91.1k|                    }
 1481|  75.0k|                    else
 1482|  75.0k|                    {
 1483|  75.0k|                        UWORD16 *pu2_sao_src_top_left_luma_top_right = (UWORD16 *)pu1_sao_src_top_left_luma_top_right;
 1484|  75.0k|                        UWORD16 *pu2_src_luma = (UWORD16 *)pu1_src_luma;
 1485|  75.0k|                        au2_src_top_right[0] = pu2_sao_src_top_left_luma_top_right[0];
 1486|  75.0k|                        u2_sao_src_top_left_luma_bot_left = pu2_src_luma[sao_ht_luma * src_strd - 1];
 1487|  75.0k|                        ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
 1488|  75.0k|                                                                      src_strd,
 1489|  75.0k|                                                                      (UWORD16 *)pu1_src_left_luma,
 1490|  75.0k|                                                                      (UWORD16 *)pu1_src_top_luma,
 1491|  75.0k|                                                                      (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
 1492|  75.0k|                                                                      au2_src_top_right,
 1493|  75.0k|                                                                      &u2_sao_src_top_left_luma_bot_left,
 1494|  75.0k|                                                                      au1_avail_luma,
 1495|  75.0k|                                                                      ai1_offset_y,
 1496|  75.0k|                                                                      sao_wd_luma,
 1497|  75.0k|                                                                      sao_ht_luma,
 1498|  75.0k|                                                                      u4_bit_depth_luma);
 1499|  75.0k|                    }
 1500|   166k|                }
 1501|  8.88M|            }
 1502|  13.5M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1502:21): [True: 5.64M, False: 7.86M]
  |  Branch (1502:68): [True: 2.99M, False: 4.87M]
  ------------------
 1503|  8.63M|            {
 1504|  8.63M|                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|  8.63M|#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|  8.63M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.63M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 8.53M, False: 101k]
  |  |  ------------------
  |  |   82|  76.5M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 68.0M, False: 8.53M]
  |  |  ------------------
  |  |   83|  68.0M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  68.0M|        } \
  |  |   85|  8.53M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  8.53M|    } else { \
  |  |   87|   101k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   101k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   101k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   101k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|   921k|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 819k, False: 101k]
  |  |  ------------------
  |  |   92|   819k|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|   819k|        } \
  |  |   94|   101k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   101k|    } \
  |  |   96|  8.63M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.63M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.63M]
  |  |  ------------------
  ------------------
 1505|  8.63M|            }
 1506|  22.3M|        }
 1507|       |
 1508|  22.3M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 != sao_wd_chroma)
  ------------------
  |  Branch (1508:12): [True: 22.3M, False: 68.5k]
  |  Branch (1508:73): [True: 9.39M, False: 12.9M]
  ------------------
 1509|  9.39M|        {
 1510|  9.39M|            if(ps_slice_hdr_top->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (1510:16): [True: 3.20M, False: 6.19M]
  ------------------
 1511|  3.20M|            {
 1512|  3.20M|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1512:20): [True: 2.88M, False: 319k]
  ------------------
 1513|  2.88M|                {
 1514|  2.88M|                    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.88M|#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.88M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  2.88M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 2.16M, False: 718k]
  |  |  ------------------
  |  |  101|  19.4M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 17.3M, False: 2.16M]
  |  |  ------------------
  |  |  102|  17.3M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  17.3M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  17.3M|        } \
  |  |  105|  2.16M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  2.16M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  2.16M|    } else { \
  |  |  108|   718k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   718k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   718k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   718k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  6.46M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 5.74M, False: 718k]
  |  |  ------------------
  |  |  113|  5.74M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  5.74M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  5.74M|        } \
  |  |  116|   718k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   718k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   718k|    } \
  |  |  119|  2.88M|    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.88M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 2.88M]
  |  |  ------------------
  ------------------
 1515|  2.88M|                }
 1516|       |
 1517|   319k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1517:25): [True: 142k, False: 176k]
  ------------------
 1518|   142k|                {
 1519|   142k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 1520|   142k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 1521|   142k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 1522|   142k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 1523|       |
 1524|   142k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 1525|   142k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 1526|   142k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 1527|   142k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 1528|       |
 1529|   142k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1529:24): [True: 15.9k, False: 126k]
  ------------------
 1530|  15.9k|                    {
 1531|  15.9k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  15.9k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1531:28): [True: 8.44k, False: 7.52k]
  ------------------
 1532|  8.44k|                        {
 1533|  8.44k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 1534|  8.44k|                                pu1_src_chroma,
 1535|  8.44k|                                chroma_strd,
 1536|  8.44k|                                pu1_src_left_chroma,
 1537|  8.44k|                                pu1_src_top_chroma,
 1538|  8.44k|                                pu1_sao_src_chroma_top_left_ctb,
 1539|  8.44k|                                ps_sao->b5_cr_band_pos,
 1540|  8.44k|                                ps_sao->b5_cb_band_pos,
 1541|  8.44k|                                ai1_offset_cr,
 1542|  8.44k|                                ai1_offset_cb,
 1543|  8.44k|                                sao_wd_chroma,
 1544|  8.44k|                                sao_ht_chroma);
 1545|  8.44k|                        }
 1546|  7.52k|                        else
 1547|  7.52k|                        {
 1548|  7.52k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 1549|  7.52k|                                (UWORD16 *)pu1_src_chroma,
 1550|  7.52k|                                chroma_strd,
 1551|  7.52k|                                (UWORD16 *)pu1_src_left_chroma,
 1552|  7.52k|                                (UWORD16 *)pu1_src_top_chroma,
 1553|  7.52k|                                (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1554|  7.52k|                                ps_sao->b5_cr_band_pos,
 1555|  7.52k|                                ps_sao->b5_cb_band_pos,
 1556|  7.52k|                                ai1_offset_cr,
 1557|  7.52k|                                ai1_offset_cb,
 1558|  7.52k|                                sao_wd_chroma,
 1559|  7.52k|                                sao_ht_chroma,
 1560|  7.52k|                                u4_bit_depth_chroma);
 1561|  7.52k|                        }
 1562|  15.9k|                    }
 1563|   126k|                    else
 1564|   126k|                    {
 1565|   126k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   126k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1565:28): [True: 39.8k, False: 86.7k]
  ------------------
 1566|  39.8k|                        {
 1567|  39.8k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 1568|  39.8k|                                pu1_src_chroma,
 1569|  39.8k|                                chroma_strd,
 1570|  39.8k|                                pu1_src_left_chroma,
 1571|  39.8k|                                pu1_src_top_chroma,
 1572|  39.8k|                                pu1_sao_src_chroma_top_left_ctb,
 1573|  39.8k|                                ps_sao->b5_cb_band_pos,
 1574|  39.8k|                                ps_sao->b5_cr_band_pos,
 1575|  39.8k|                                ai1_offset_cb,
 1576|  39.8k|                                ai1_offset_cr,
 1577|  39.8k|                                sao_wd_chroma,
 1578|  39.8k|                                sao_ht_chroma);
 1579|  39.8k|                        }
 1580|  86.7k|                        else
 1581|  86.7k|                        {
 1582|  86.7k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 1583|  86.7k|                                (UWORD16 *)pu1_src_chroma,
 1584|  86.7k|                                chroma_strd,
 1585|  86.7k|                                (UWORD16 *)pu1_src_left_chroma,
 1586|  86.7k|                                (UWORD16 *)pu1_src_top_chroma,
 1587|  86.7k|                                (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1588|  86.7k|                                ps_sao->b5_cb_band_pos,
 1589|  86.7k|                                ps_sao->b5_cr_band_pos,
 1590|  86.7k|                                ai1_offset_cb,
 1591|  86.7k|                                ai1_offset_cr,
 1592|  86.7k|                                sao_wd_chroma,
 1593|  86.7k|                                sao_ht_chroma,
 1594|  86.7k|                                u4_bit_depth_chroma);
 1595|  86.7k|                        }
 1596|   126k|                    }
 1597|   142k|                }
 1598|   176k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 1599|   176k|                {
 1600|   176k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 1601|   176k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 1602|   176k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 1603|   176k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 1604|       |
 1605|   176k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 1606|   176k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 1607|   176k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 1608|   176k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 1609|       |
 1610|  1.59M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1610:32): [True: 1.42M, False: 176k]
  ------------------
 1611|  1.42M|                    {
 1612|  1.42M|                        au1_avail_chroma[i] = 255;
 1613|  1.42M|                        au1_tile_slice_boundary[i] = 0;
 1614|  1.42M|                        au4_idx_t[i] = 0;
 1615|  1.42M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1616|  1.42M|                    }
 1617|       |
 1618|   176k|                    {
 1619|   176k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1619:28): [True: 13.4k, False: 163k]
  |  Branch (1619:75): [True: 35.2k, False: 128k]
  ------------------
 1620|  49.7k|                        {
 1621|  49.7k|                            ctbx_t_t = ps_sao_ctxt->i4_ctb_x;
 1622|  49.7k|                            ctby_t_t = ps_sao_ctxt->i4_ctb_y - 1;
 1623|       |
 1624|  49.7k|                            ctbx_t_l = ps_sao_ctxt->i4_ctb_x - 1;
 1625|  49.7k|                            ctby_t_l = ps_sao_ctxt->i4_ctb_y - 1;
 1626|       |
 1627|  49.7k|                            ctbx_t_r = ps_sao_ctxt->i4_ctb_x;
 1628|  49.7k|                            ctby_t_r = ps_sao_ctxt->i4_ctb_y - 1;
 1629|       |
 1630|  49.7k|                            ctbx_t_d =  ps_sao_ctxt->i4_ctb_x;
 1631|  49.7k|                            ctby_t_d =  ps_sao_ctxt->i4_ctb_y;
 1632|       |
 1633|  49.7k|                            ctbx_t = ps_sao_ctxt->i4_ctb_x;
 1634|  49.7k|                            ctby_t = ps_sao_ctxt->i4_ctb_y - 1;
 1635|       |
 1636|  49.7k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1636:32): [True: 14.4k, False: 35.2k]
  ------------------
 1637|  14.4k|                            {
 1638|  14.4k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1638:36): [True: 2.08k, False: 12.3k]
  ------------------
 1639|  2.08k|                                {
 1640|  2.08k|                                    au4_idx_t[0] = -1;
 1641|  2.08k|                                    au4_idx_t[6] = -1;
 1642|  2.08k|                                    au4_idx_t[4] = -1;
 1643|  2.08k|                                }
 1644|  12.3k|                                else
 1645|  12.3k|                                {
 1646|  12.3k|                                    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|  12.3k|                                    au4_idx_t[6] = pu1_slice_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1648|  12.3k|                                }
 1649|  14.4k|                                idx_t   = pu1_slice_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1650|  14.4k|                                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|  14.4k|                                au4_idx_t[1] = pu1_slice_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1652|  14.4k|                                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|  14.4k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1656:36): [True: 2.08k, False: 12.3k]
  ------------------
 1657|  2.08k|                                {
 1658|  2.08k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 1659|  2.08k|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 1660|  2.08k|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 1661|  2.08k|                                }
 1662|  12.3k|                                else
 1663|  12.3k|                                {
 1664|  12.3k|                                    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|  12.3k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_t[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 1666|  12.3k|                                }
 1667|       |
 1668|  14.4k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_t[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 1669|  14.4k|                                au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1670|  14.4k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_t[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 1671|  14.4k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_t[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 1672|  14.4k|                                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|  14.4k|                                if(idx_t > au4_idx_t[6])
  ------------------
  |  Branch (1674:36): [True: 2.09k, False: 12.3k]
  ------------------
 1675|  2.09k|                                {
 1676|  2.09k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1677|  2.09k|                                }
 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|   129k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1683:44): [True: 115k, False: 14.4k]
  ------------------
 1684|   115k|                                {
 1685|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 1686|   115k|                                    if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1686:40): [True: 10.1k, False: 105k]
  ------------------
 1687|  10.1k|                                    {
 1688|  10.1k|                                        au1_tile_slice_boundary[i] = 1;
 1689|  10.1k|                                    }
 1690|   105k|                                    else
 1691|   105k|                                    {
 1692|       |                                        /*Indicates that the neighbour belongs to same/dependent slice*/
 1693|   105k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 1694|   105k|                                    }
 1695|   115k|                                }
 1696|       |                                /*Reset indices*/
 1697|   129k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1697:44): [True: 115k, False: 14.4k]
  ------------------
 1698|   115k|                                {
 1699|   115k|                                    au4_idx_t[i] = 0;
 1700|   115k|                                }
 1701|  14.4k|                            }
 1702|  49.7k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1702:32): [True: 35.5k, False: 14.1k]
  ------------------
 1703|  35.5k|                            {
 1704|       |                                /* Calculate availability flags at slice boundary */
 1705|  35.5k|                                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: 10.3k, False: 25.1k]
  |  Branch (1705:85): [True: 10.5k, False: 14.6k]
  |  Branch (1705:137): [True: 17.4k, False: 3.47k]
  |  Branch (1705:165): [True: 3.20k, False: 14.2k]
  ------------------
 1706|  17.7k|                                {
 1707|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1708|  17.7k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1708:40): [True: 16.0k, False: 1.72k]
  ------------------
 1709|  16.0k|                                    {
 1710|       |                                        /*Calculate neighbor ctb slice indices*/
 1711|  16.0k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1711:44): [True: 4.72k, False: 11.3k]
  ------------------
 1712|  4.72k|                                        {
 1713|  4.72k|                                            au4_idx_t[0] = -1;
 1714|  4.72k|                                            au4_idx_t[6] = -1;
 1715|  4.72k|                                            au4_idx_t[4] = -1;
 1716|  4.72k|                                        }
 1717|  11.3k|                                        else
 1718|  11.3k|                                        {
 1719|  11.3k|                                            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|  11.3k|                                            au4_idx_t[6] = pu1_tile_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1721|  11.3k|                                        }
 1722|  16.0k|                                        idx_t   = pu1_tile_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1723|  16.0k|                                        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|  16.0k|                                        au4_idx_t[1] = pu1_tile_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1725|  16.0k|                                        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|   144k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1727:52): [True: 128k, False: 16.0k]
  ------------------
 1728|   128k|                                        {
 1729|       |                                            /*Sets the edges that lie on the tile boundary*/
 1730|   128k|                                            if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1730:48): [True: 51.9k, False: 76.2k]
  ------------------
 1731|  51.9k|                                            {
 1732|  51.9k|                                                au1_tile_slice_boundary[i] |= 1;
 1733|  51.9k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 1734|  51.9k|                                            }
 1735|   128k|                                        }
 1736|  16.0k|                                    }
 1737|  17.7k|                                }
 1738|  35.5k|                            }
 1739|   447k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1739:40): [True: 397k, False: 49.7k]
  ------------------
 1740|   397k|                            {
 1741|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 1742|   397k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1742:36): [True: 62.1k, False: 335k]
  |  Branch (1742:68): [True: 58.2k, False: 3.90k]
  ------------------
 1743|  58.2k|                                {
 1744|  58.2k|                                    au1_avail_chroma[i] = 0;
 1745|  58.2k|                                }
 1746|   397k|                            }
 1747|       |
 1748|  49.7k|                        }
 1749|   176k|                    }
 1750|   176k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1750:24): [True: 35.3k, False: 141k]
  ------------------
 1751|  35.3k|                    {
 1752|  35.3k|                        au1_avail_chroma[0] = 0;
 1753|  35.3k|                        au1_avail_chroma[4] = 0;
 1754|  35.3k|                        au1_avail_chroma[6] = 0;
 1755|  35.3k|                    }
 1756|       |
 1757|   176k|                    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: 26.4k, False: 150k]
  ------------------
 1758|  26.4k|                    {
 1759|  26.4k|                        au1_avail_chroma[1] = 0;
 1760|  26.4k|                        au1_avail_chroma[5] = 0;
 1761|  26.4k|                        au1_avail_chroma[7] = 0;
 1762|  26.4k|                    }
 1763|       |
 1764|   176k|                    if(0 == ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) - sao_ht_chroma)
  ------------------
  |  Branch (1764:24): [True: 411, False: 176k]
  ------------------
 1765|    411|                    {
 1766|    411|                        au1_avail_chroma[2] = 0;
 1767|    411|                        au1_avail_chroma[4] = 0;
 1768|    411|                        au1_avail_chroma[5] = 0;
 1769|    411|                    }
 1770|       |
 1771|   176k|                    if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1771:24): [True: 0, False: 176k]
  ------------------
 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|   176k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   176k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1778:24): [True: 84.2k, False: 92.6k]
  ------------------
 1779|  84.2k|                    {
 1780|  84.2k|                        au1_src_top_right[0] = pu1_sao_src_top_left_chroma_top_right[0];
 1781|  84.2k|                        au1_src_top_right[1] = pu1_sao_src_top_left_chroma_top_right[1];
 1782|  84.2k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1783|  84.2k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1784|       |
 1785|  84.2k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1785:28): [True: 17.4k, False: 66.7k]
  ------------------
 1786|  17.4k|                        {
 1787|  17.4k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1788|  17.4k|                                                                         chroma_strd,
 1789|  17.4k|                                                                         pu1_src_left_chroma,
 1790|  17.4k|                                                                         pu1_src_top_chroma,
 1791|  17.4k|                                                                         pu1_sao_src_chroma_top_left_ctb,
 1792|  17.4k|                                                                         au1_src_top_right,
 1793|  17.4k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 1794|  17.4k|                                                                         au1_avail_chroma,
 1795|  17.4k|                                                                         ai1_offset_cr,
 1796|  17.4k|                                                                         ai1_offset_cb,
 1797|  17.4k|                                                                         sao_wd_chroma,
 1798|  17.4k|                                                                         sao_ht_chroma);
 1799|  17.4k|                        }
 1800|  66.7k|                        else
 1801|  66.7k|                        {
 1802|  66.7k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1803|  66.7k|                                                                         chroma_strd,
 1804|  66.7k|                                                                         pu1_src_left_chroma,
 1805|  66.7k|                                                                         pu1_src_top_chroma,
 1806|  66.7k|                                                                         pu1_sao_src_chroma_top_left_ctb,
 1807|  66.7k|                                                                         au1_src_top_right,
 1808|  66.7k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 1809|  66.7k|                                                                         au1_avail_chroma,
 1810|  66.7k|                                                                         ai1_offset_cb,
 1811|  66.7k|                                                                         ai1_offset_cr,
 1812|  66.7k|                                                                         sao_wd_chroma,
 1813|  66.7k|                                                                         sao_ht_chroma);
 1814|  66.7k|                        }
 1815|  84.2k|                    }
 1816|  92.6k|                    else
 1817|  92.6k|                    {
 1818|  92.6k|                        UWORD16 *pu2_sao_src_top_left_chroma_top_right = (UWORD16 *)pu1_sao_src_top_left_chroma_top_right;
 1819|  92.6k|                        UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 1820|       |
 1821|  92.6k|                        au2_src_top_right[0] = pu2_sao_src_top_left_chroma_top_right[0];
 1822|  92.6k|                        au2_src_top_right[1] = pu2_sao_src_top_left_chroma_top_right[1];
 1823|  92.6k|                        au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1824|  92.6k|                        au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1825|       |
 1826|  92.6k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1826:28): [True: 20.6k, False: 71.9k]
  ------------------
 1827|  20.6k|                        {
 1828|  20.6k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1829|  20.6k|                                                                             chroma_strd,
 1830|  20.6k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 1831|  20.6k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 1832|  20.6k|                                                                             (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1833|  20.6k|                                                                             au2_src_top_right,
 1834|  20.6k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 1835|  20.6k|                                                                             au1_avail_chroma,
 1836|  20.6k|                                                                             ai1_offset_cr,
 1837|  20.6k|                                                                             ai1_offset_cb,
 1838|  20.6k|                                                                             sao_wd_chroma,
 1839|  20.6k|                                                                             sao_ht_chroma,
 1840|  20.6k|                                                                             u4_bit_depth_chroma);
 1841|  20.6k|                        }
 1842|  71.9k|                        else
 1843|  71.9k|                        {
 1844|  71.9k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1845|  71.9k|                                                                             chroma_strd,
 1846|  71.9k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 1847|  71.9k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 1848|  71.9k|                                                                             (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1849|  71.9k|                                                                             au2_src_top_right,
 1850|  71.9k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 1851|  71.9k|                                                                             au1_avail_chroma,
 1852|  71.9k|                                                                             ai1_offset_cb,
 1853|  71.9k|                                                                             ai1_offset_cr,
 1854|  71.9k|                                                                             sao_wd_chroma,
 1855|  71.9k|                                                                             sao_ht_chroma,
 1856|  71.9k|                                                                             u4_bit_depth_chroma);
 1857|  71.9k|                        }
 1858|  92.6k|                    }
 1859|       |
 1860|   176k|                }
 1861|  3.20M|            }
 1862|  6.19M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1862:21): [True: 780k, False: 5.41M]
  |  Branch (1862:68): [True: 2.44M, False: 2.96M]
  ------------------
 1863|  3.22M|            {
 1864|  3.22M|                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|  3.22M|#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.22M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  3.22M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 3.21M, False: 13.8k]
  |  |  ------------------
  |  |  101|  28.9M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 25.7M, False: 3.21M]
  |  |  ------------------
  |  |  102|  25.7M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  25.7M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  25.7M|        } \
  |  |  105|  3.21M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  3.21M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  3.21M|    } else { \
  |  |  108|  13.8k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  13.8k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  13.8k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  13.8k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|   121k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 107k, False: 13.8k]
  |  |  ------------------
  |  |  113|   107k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|   107k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|   107k|        } \
  |  |  116|  13.8k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  13.8k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  13.8k|    } \
  |  |  119|  3.22M|    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.22M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 3.22M]
  |  |  ------------------
  ------------------
 1865|  3.22M|            }
 1866|  9.39M|        }
 1867|       |
 1868|  22.3M|        pu1_src_luma += sao_ht_luma * src_strd * pixel_size_y;
 1869|  22.3M|        pu1_src_chroma += sao_ht_chroma * chroma_strd * pixel_size_uv;
 1870|  22.3M|        ps_sao += (ps_sps->i2_pic_wd_in_ctb);
 1871|  22.3M|    }
 1872|       |
 1873|       |    /* Left CTB */
 1874|  23.5M|    if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (1874:8): [True: 22.2M, False: 1.21M]
  ------------------
 1875|  22.2M|    {
 1876|  22.2M|        WORD32 sao_wd_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.2M|#define SAO_SHIFT_CTB    8
  ------------------
 1877|  22.2M|        WORD32 sao_wd_chroma = 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.2M|#define SAO_SHIFT_CTB    8
  ------------------
 1878|  22.2M|        WORD32 sao_ht_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.2M|#define SAO_SHIFT_CTB    8
  ------------------
 1879|  22.2M|        WORD32 sao_ht_chroma = (ctb_size / v_samp_factor) - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  22.2M|#define SAO_SHIFT_CTB    8
  ------------------
 1880|       |
 1881|  22.2M|        WORD32 ctbx_l_t = 0, ctbx_l_l = 0, ctbx_l_r = 0, ctbx_l_d = 0, ctbx_l = 0;
 1882|  22.2M|        WORD32 ctby_l_t = 0, ctby_l_l = 0, ctby_l_r = 0, ctby_l_d = 0, ctby_l = 0;
 1883|  22.2M|        WORD32 au4_idx_l[8], idx_l;
 1884|       |
 1885|  22.2M|        WORD32 remaining_rows;
 1886|  22.2M|        slice_header_t *ps_slice_hdr_left;
 1887|  22.2M|        {
 1888|  22.2M|            WORD32 left_ctb_indx = (ps_sao_ctxt->i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb +
 1889|  22.2M|                                        (ps_sao_ctxt->i4_ctb_x - 1);
 1890|  22.2M|            ps_slice_hdr_left = ps_slice_hdr_base + pu1_slice_idx[left_ctb_indx];
 1891|  22.2M|        }
 1892|       |
 1893|  22.2M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + sao_ht_luma);
 1894|  22.2M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  22.2M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1894:12): [True: 881k, False: 21.4M]
  ------------------
 1895|   881k|        {
 1896|   881k|            sao_ht_luma += remaining_rows;
 1897|   881k|        }
 1898|  22.2M|        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|  22.2M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  22.2M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1899:12): [True: 881k, False: 21.4M]
  ------------------
 1900|   881k|        {
 1901|   881k|            sao_ht_chroma += remaining_rows;
 1902|   881k|        }
 1903|       |
 1904|  22.2M|        pu1_src_luma -= sao_wd_luma * pixel_size_y;
 1905|  22.2M|        pu1_src_chroma -= sao_wd_chroma * pixel_size_uv;
 1906|  22.2M|        ps_sao -= 1;
 1907|  22.2M|        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|  22.2M|        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|  22.2M|        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|  22.2M|        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|  22.2M|        if(0 != sao_ht_luma)
  ------------------
  |  Branch (1913:12): [True: 22.3M, False: 18.4E]
  ------------------
 1914|  22.3M|        {
 1915|  22.3M|            if(ps_slice_hdr_left->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (1915:16): [True: 9.01M, False: 13.2M]
  ------------------
 1916|  9.01M|            {
 1917|  9.01M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1917:20): [True: 8.68M, False: 331k]
  ------------------
 1918|  8.68M|                {
 1919|  8.68M|                    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|  8.68M|#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|  8.68M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.68M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 7.90M, False: 780k]
  |  |  ------------------
  |  |   82|   128M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 120M, False: 7.90M]
  |  |  ------------------
  |  |   83|   120M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|   120M|        } \
  |  |   85|  7.90M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  7.90M|    } else { \
  |  |   87|   780k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   780k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   780k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   780k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  34.9M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 34.1M, False: 780k]
  |  |  ------------------
  |  |   92|  34.1M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  34.1M|        } \
  |  |   94|   780k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   780k|    } \
  |  |   96|  8.68M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.68M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.68M]
  |  |  ------------------
  ------------------
 1920|  8.68M|                }
 1921|       |
 1922|   331k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1922:25): [True: 177k, False: 153k]
  ------------------
 1923|   177k|                {
 1924|   177k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 1925|   177k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 1926|   177k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 1927|   177k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 1928|       |
 1929|   177k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   177k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1929:24): [True: 70.7k, False: 106k]
  ------------------
 1930|  70.7k|                    {
 1931|  70.7k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
 1932|  70.7k|                            pu1_src_luma,
 1933|  70.7k|                            src_strd,
 1934|  70.7k|                            pu1_src_left_luma,
 1935|  70.7k|                            pu1_src_top_luma,
 1936|  70.7k|                            pu1_sao_src_top_left_luma_curr_ctb,
 1937|  70.7k|                            ps_sao->b5_y_band_pos,
 1938|  70.7k|                            ai1_offset_y,
 1939|  70.7k|                            sao_wd_luma,
 1940|  70.7k|                            sao_ht_luma);
 1941|  70.7k|                    }
 1942|   106k|                    else
 1943|   106k|                    {
 1944|   106k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
 1945|   106k|                            (UWORD16 *)pu1_src_luma,
 1946|   106k|                            src_strd,
 1947|   106k|                            (UWORD16 *)pu1_src_left_luma,
 1948|   106k|                            (UWORD16 *)pu1_src_top_luma,
 1949|   106k|                            (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 1950|   106k|                            ps_sao->b5_y_band_pos,
 1951|   106k|                            ai1_offset_y,
 1952|   106k|                            sao_wd_luma,
 1953|   106k|                            sao_ht_luma,
 1954|   106k|                            u4_bit_depth_luma);
 1955|   106k|                    }
 1956|   177k|                }
 1957|       |
 1958|   153k|                else // if(2 <= ps_sao->b3_y_type_idx)
 1959|   153k|                {
 1960|   153k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 1961|   153k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 1962|   153k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 1963|   153k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 1964|       |
 1965|  1.39M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1965:32): [True: 1.24M, False: 153k]
  ------------------
 1966|  1.24M|                    {
 1967|  1.24M|                        au1_avail_luma[i] = 255;
 1968|  1.24M|                        au1_tile_slice_boundary[i] = 0;
 1969|  1.24M|                        au4_idx_l[i] = 0;
 1970|  1.24M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1971|  1.24M|                    }
 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|   153k|                    {
 1991|   153k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1991:28): [True: 13.5k, False: 140k]
  |  Branch (1991:75): [True: 33.3k, False: 106k]
  ------------------
 1992|  48.4k|                        {
 1993|  48.4k|                            ctbx_l_t = ps_sao_ctxt->i4_ctb_x - 1;
 1994|  48.4k|                            ctby_l_t = ps_sao_ctxt->i4_ctb_y - 1;
 1995|       |
 1996|  48.4k|                            ctbx_l_l = ps_sao_ctxt->i4_ctb_x - 1;
 1997|  48.4k|                            ctby_l_l = ps_sao_ctxt->i4_ctb_y;
 1998|       |
 1999|  48.4k|                            ctbx_l_r = ps_sao_ctxt->i4_ctb_x;
 2000|  48.4k|                            ctby_l_r = ps_sao_ctxt->i4_ctb_y;
 2001|       |
 2002|  48.4k|                            ctbx_l_d =  ps_sao_ctxt->i4_ctb_x - 1;
 2003|  48.4k|                            ctby_l_d =  ps_sao_ctxt->i4_ctb_y;
 2004|       |
 2005|  48.4k|                            ctbx_l = ps_sao_ctxt->i4_ctb_x - 1;
 2006|  48.4k|                            ctby_l = ps_sao_ctxt->i4_ctb_y;
 2007|       |
 2008|  48.4k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2008:32): [True: 15.0k, False: 33.3k]
  ------------------
 2009|  15.0k|                            {
 2010|  15.0k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2010:36): [True: 2.18k, False: 12.8k]
  ------------------
 2011|  2.18k|                                {
 2012|  2.18k|                                    au4_idx_l[2] = -1;
 2013|  2.18k|                                    au4_idx_l[4] = -1;
 2014|  2.18k|                                    au4_idx_l[5] = -1;
 2015|  2.18k|                                }
 2016|  12.8k|                                else
 2017|  12.8k|                                {
 2018|  12.8k|                                    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.8k|                                    au4_idx_l[5] =  pu1_slice_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2020|  12.8k|                                }
 2021|  15.0k|                                idx_l   = au4_idx_l[6] = pu1_slice_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2022|  15.0k|                                au4_idx_l[0] = pu1_slice_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2023|  15.0k|                                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|  15.0k|                                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|  15.0k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2027:36): [True: 2.18k, False: 12.8k]
  ------------------
 2028|  2.18k|                                {
 2029|  2.18k|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2030|  2.18k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2031|  2.18k|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2032|  2.18k|                                }
 2033|  12.8k|                                else
 2034|  12.8k|                                {
 2035|  12.8k|                                    au4_ilf_across_tile_slice_enable[2] =  (ps_slice_hdr_base + idx_l)->i1_slice_loop_filter_across_slices_enabled_flag;
 2036|  12.8k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2037|       |
 2038|  12.8k|                                }
 2039|       |                                //TODO: ILF flag checks for [0] and [6] is missing.
 2040|  15.0k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_l[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2041|  15.0k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_l[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2042|  15.0k|                                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|  15.0k|                                if(idx_l < au4_idx_l[5])
  ------------------
  |  Branch (2044:36): [True: 470, False: 14.5k]
  ------------------
 2045|    470|                                {
 2046|    470|                                    au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_l[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 2047|    470|                                }
 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|   135k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2053:44): [True: 120k, False: 15.0k]
  ------------------
 2054|   120k|                                {
 2055|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2056|   120k|                                    if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2056:40): [True: 16.5k, False: 103k]
  ------------------
 2057|  16.5k|                                    {
 2058|  16.5k|                                        au1_tile_slice_boundary[i] = 1;
 2059|  16.5k|                                    }
 2060|   103k|                                    else
 2061|   103k|                                    {
 2062|   103k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2063|   103k|                                    }
 2064|   120k|                                }
 2065|       |                                /*Reset indices*/
 2066|   135k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2066:44): [True: 120k, False: 15.0k]
  ------------------
 2067|   120k|                                {
 2068|   120k|                                    au4_idx_l[i] = 0;
 2069|   120k|                                }
 2070|  15.0k|                            }
 2071|       |
 2072|  48.4k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2072:32): [True: 33.9k, False: 14.5k]
  ------------------
 2073|  33.9k|                            {
 2074|       |                                /* Calculate availability flags at slice boundary */
 2075|  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 (2075:37): [True: 3.15k, False: 30.7k]
  |  Branch (2075:85): [True: 15.2k, False: 15.4k]
  |  Branch (2075:137): [True: 12.1k, False: 6.24k]
  |  Branch (2075:165): [True: 6.49k, False: 5.68k]
  ------------------
 2076|  11.9k|                                {
 2077|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2078|  11.9k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2078:40): [True: 10.6k, False: 1.32k]
  ------------------
 2079|  10.6k|                                    {
 2080|  10.6k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2080:44): [True: 1.62k, False: 8.97k]
  ------------------
 2081|  1.62k|                                        {
 2082|  1.62k|                                            au4_idx_l[2] = -1;
 2083|  1.62k|                                            au4_idx_l[4] = -1;
 2084|  1.62k|                                            au4_idx_l[5] = -1;
 2085|  1.62k|                                        }
 2086|  8.97k|                                        else
 2087|  8.97k|                                        {
 2088|  8.97k|                                            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.97k|                                            au4_idx_l[5] =  pu1_tile_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2090|  8.97k|                                        }
 2091|       |
 2092|  10.6k|                                        idx_l   = au4_idx_l[6] = pu1_tile_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2093|  10.6k|                                        au4_idx_l[0] = pu1_tile_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2094|  10.6k|                                        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|  10.6k|                                        au4_idx_l[3] = pu1_tile_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2096|       |
 2097|  95.4k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2097:52): [True: 84.8k, False: 10.6k]
  ------------------
 2098|  84.8k|                                        {
 2099|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2100|  84.8k|                                            if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2100:48): [True: 33.0k, False: 51.8k]
  ------------------
 2101|  33.0k|                                            {
 2102|  33.0k|                                                au1_tile_slice_boundary[i] |= 1;
 2103|  33.0k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 2104|  33.0k|                                            }
 2105|  84.8k|                                        }
 2106|  10.6k|                                    }
 2107|  11.9k|                                }
 2108|  33.9k|                            }
 2109|       |
 2110|   435k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2110:40): [True: 387k, False: 48.4k]
  ------------------
 2111|   387k|                            {
 2112|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2113|   387k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2113:36): [True: 49.6k, False: 337k]
  |  Branch (2113:68): [True: 40.5k, False: 9.09k]
  ------------------
 2114|  40.5k|                                {
 2115|  40.5k|                                    au1_avail_luma[i] = 0;
 2116|  40.5k|                                }
 2117|   387k|                            }
 2118|  48.4k|                        }
 2119|   153k|                    }
 2120|   153k|                    if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma)
  ------------------
  |  Branch (2120:24): [True: 0, False: 153k]
  ------------------
 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|   153k|                    if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2126:24): [True: 0, False: 153k]
  ------------------
 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|   153k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2133:24): [True: 50.5k, False: 103k]
  ------------------
 2134|  50.5k|                    {
 2135|  50.5k|                        au1_avail_luma[2] = 0;
 2136|  50.5k|                        au1_avail_luma[4] = 0;
 2137|  50.5k|                        au1_avail_luma[5] = 0;
 2138|  50.5k|                    }
 2139|       |
 2140|   153k|                    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: 6.95k, False: 146k]
  ------------------
 2141|  6.95k|                    {
 2142|  6.95k|                        au1_avail_luma[3] = 0;
 2143|  6.95k|                        au1_avail_luma[6] = 0;
 2144|  6.95k|                        au1_avail_luma[7] = 0;
 2145|  6.95k|                    }
 2146|       |
 2147|   153k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   153k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2147:24): [True: 83.0k, False: 70.8k]
  ------------------
 2148|  83.0k|                    {
 2149|  83.0k|                        au1_src_top_right[0] = pu1_src_top_luma[sao_wd_luma];
 2150|  83.0k|                        u1_sao_src_top_left_luma_bot_left = pu1_sao_src_top_left_luma_bot_left[0];
 2151|  83.0k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 2152|  83.0k|                                                                  src_strd,
 2153|  83.0k|                                                                  pu1_src_left_luma,
 2154|  83.0k|                                                                  pu1_src_top_luma,
 2155|  83.0k|                                                                  pu1_sao_src_top_left_luma_curr_ctb,
 2156|  83.0k|                                                                  au1_src_top_right,
 2157|  83.0k|                                                                  &u1_sao_src_top_left_luma_bot_left,
 2158|  83.0k|                                                                  au1_avail_luma,
 2159|  83.0k|                                                                  ai1_offset_y,
 2160|  83.0k|                                                                  sao_wd_luma,
 2161|  83.0k|                                                                  sao_ht_luma);
 2162|  83.0k|                    }
 2163|  70.8k|                    else
 2164|  70.8k|                    {
 2165|  70.8k|                        UWORD16 *pu2_src_top_luma = (UWORD16 *)pu1_src_top_luma;
 2166|  70.8k|                        UWORD16 *pu2_sao_src_top_left_luma_bot_left = (UWORD16 *)pu1_sao_src_top_left_luma_bot_left;
 2167|  70.8k|                        au2_src_top_right[0] = pu2_src_top_luma[sao_wd_luma];
 2168|  70.8k|                        u2_sao_src_top_left_luma_bot_left = pu2_sao_src_top_left_luma_bot_left[0];
 2169|  70.8k|                        ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
 2170|  70.8k|                                                                      src_strd,
 2171|  70.8k|                                                                      (UWORD16 *)pu1_src_left_luma,
 2172|  70.8k|                                                                      (UWORD16 *)pu1_src_top_luma,
 2173|  70.8k|                                                                      (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 2174|  70.8k|                                                                      au2_src_top_right,
 2175|  70.8k|                                                                      &u2_sao_src_top_left_luma_bot_left,
 2176|  70.8k|                                                                      au1_avail_luma,
 2177|  70.8k|                                                                      ai1_offset_y,
 2178|  70.8k|                                                                      sao_wd_luma,
 2179|  70.8k|                                                                      sao_ht_luma,
 2180|  70.8k|                                                                      u4_bit_depth_luma);
 2181|  70.8k|                    }
 2182|       |
 2183|   153k|                }
 2184|  9.01M|            }
 2185|  13.2M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2185:21): [True: 5.63M, False: 7.64M]
  |  Branch (2185:68): [True: 2.98M, False: 4.66M]
  ------------------
 2186|  8.62M|            {
 2187|  8.62M|                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|  8.62M|#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|  8.62M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.62M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 8.50M, False: 115k]
  |  |  ------------------
  |  |   82|   136M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 127M, False: 8.50M]
  |  |  ------------------
  |  |   83|   127M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|   127M|        } \
  |  |   85|  8.50M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  8.50M|    } else { \
  |  |   87|   115k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   115k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   115k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   115k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  5.51M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 5.40M, False: 115k]
  |  |  ------------------
  |  |   92|  5.40M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  5.40M|        } \
  |  |   94|   115k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   115k|    } \
  |  |   96|  8.62M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.62M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.62M]
  |  |  ------------------
  ------------------
 2188|  8.62M|            }
 2189|  22.3M|        }
 2190|       |
 2191|  22.2M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 != sao_ht_chroma)
  ------------------
  |  Branch (2191:12): [True: 22.2M, False: 26.5k]
  |  Branch (2191:73): [True: 9.45M, False: 12.8M]
  ------------------
 2192|  9.45M|        {
 2193|  9.45M|            if(ps_slice_hdr_left->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (2193:16): [True: 3.51M, False: 5.94M]
  ------------------
 2194|  3.51M|            {
 2195|  3.51M|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2195:20): [True: 3.21M, False: 301k]
  ------------------
 2196|  3.21M|                {
 2197|  3.21M|                    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.21M|#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.21M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  3.21M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 2.35M, False: 853k]
  |  |  ------------------
  |  |  101|  43.7M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 41.3M, False: 2.35M]
  |  |  ------------------
  |  |  102|  41.3M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  41.3M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  41.3M|        } \
  |  |  105|  2.35M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  2.35M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  2.35M|    } else { \
  |  |  108|   853k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   853k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   853k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   853k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  39.2M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 38.4M, False: 853k]
  |  |  ------------------
  |  |  113|  38.4M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  38.4M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  38.4M|        } \
  |  |  116|   853k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   853k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   853k|    } \
  |  |  119|  3.21M|    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.21M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 3.21M]
  |  |  ------------------
  ------------------
 2198|  3.21M|                }
 2199|       |
 2200|   301k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2200:25): [True: 138k, False: 163k]
  ------------------
 2201|   138k|                {
 2202|   138k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 2203|   138k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 2204|   138k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 2205|   138k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 2206|       |
 2207|   138k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 2208|   138k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 2209|   138k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 2210|   138k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 2211|       |
 2212|   138k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2212:24): [True: 13.8k, False: 124k]
  ------------------
 2213|  13.8k|                    {
 2214|  13.8k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  13.8k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2214:28): [True: 8.07k, False: 5.73k]
  ------------------
 2215|  8.07k|                        {
 2216|  8.07k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 2217|  8.07k|                                pu1_src_chroma,
 2218|  8.07k|                                chroma_strd,
 2219|  8.07k|                                pu1_src_left_chroma,
 2220|  8.07k|                                pu1_src_top_chroma,
 2221|  8.07k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 2222|  8.07k|                                ps_sao->b5_cr_band_pos,
 2223|  8.07k|                                ps_sao->b5_cb_band_pos,
 2224|  8.07k|                                ai1_offset_cr,
 2225|  8.07k|                                ai1_offset_cb,
 2226|  8.07k|                                sao_wd_chroma,
 2227|  8.07k|                                sao_ht_chroma);
 2228|  8.07k|                        }
 2229|  5.73k|                        else
 2230|  5.73k|                        {
 2231|  5.73k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 2232|  5.73k|                                (UWORD16 *)pu1_src_chroma,
 2233|  5.73k|                                chroma_strd,
 2234|  5.73k|                                (UWORD16 *)pu1_src_left_chroma,
 2235|  5.73k|                                (UWORD16 *)pu1_src_top_chroma,
 2236|  5.73k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2237|  5.73k|                                ps_sao->b5_cr_band_pos,
 2238|  5.73k|                                ps_sao->b5_cb_band_pos,
 2239|  5.73k|                                ai1_offset_cr,
 2240|  5.73k|                                ai1_offset_cb,
 2241|  5.73k|                                sao_wd_chroma,
 2242|  5.73k|                                sao_ht_chroma,
 2243|  5.73k|                                u4_bit_depth_chroma);
 2244|  5.73k|                        }
 2245|  13.8k|                    }
 2246|   124k|                    else
 2247|   124k|                    {
 2248|   124k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   124k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2248:28): [True: 38.6k, False: 85.9k]
  ------------------
 2249|  38.6k|                        {
 2250|  38.6k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 2251|  38.6k|                                pu1_src_chroma,
 2252|  38.6k|                                chroma_strd,
 2253|  38.6k|                                pu1_src_left_chroma,
 2254|  38.6k|                                pu1_src_top_chroma,
 2255|  38.6k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 2256|  38.6k|                                ps_sao->b5_cb_band_pos,
 2257|  38.6k|                                ps_sao->b5_cr_band_pos,
 2258|  38.6k|                                ai1_offset_cb,
 2259|  38.6k|                                ai1_offset_cr,
 2260|  38.6k|                                sao_wd_chroma,
 2261|  38.6k|                                sao_ht_chroma);
 2262|  38.6k|                        }
 2263|  85.9k|                        else
 2264|  85.9k|                        {
 2265|  85.9k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 2266|  85.9k|                                (UWORD16 *)pu1_src_chroma,
 2267|  85.9k|                                chroma_strd,
 2268|  85.9k|                                (UWORD16 *)pu1_src_left_chroma,
 2269|  85.9k|                                (UWORD16 *)pu1_src_top_chroma,
 2270|  85.9k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2271|  85.9k|                                ps_sao->b5_cb_band_pos,
 2272|  85.9k|                                ps_sao->b5_cr_band_pos,
 2273|  85.9k|                                ai1_offset_cb,
 2274|  85.9k|                                ai1_offset_cr,
 2275|  85.9k|                                sao_wd_chroma,
 2276|  85.9k|                                sao_ht_chroma,
 2277|  85.9k|                                u4_bit_depth_chroma);
 2278|  85.9k|                        }
 2279|   124k|                    }
 2280|   138k|                }
 2281|       |
 2282|   163k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 2283|   163k|                {
 2284|   163k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 2285|   163k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 2286|   163k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 2287|   163k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 2288|       |
 2289|   163k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 2290|   163k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 2291|   163k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 2292|   163k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 2293|       |
 2294|  1.47M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2294:32): [True: 1.31M, False: 163k]
  ------------------
 2295|  1.31M|                    {
 2296|  1.31M|                        au1_avail_chroma[i] = 255;
 2297|  1.31M|                        au1_tile_slice_boundary[i] = 0;
 2298|  1.31M|                        au4_idx_l[i] = 0;
 2299|  1.31M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 2300|  1.31M|                    }
 2301|       |                    /*In case of slices*/
 2302|   163k|                    {
 2303|   163k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2303:28): [True: 14.3k, False: 149k]
  |  Branch (2303:75): [True: 29.1k, False: 119k]
  ------------------
 2304|  44.0k|                        {
 2305|  44.0k|                            ctbx_l_t = ps_sao_ctxt->i4_ctb_x - 1;
 2306|  44.0k|                            ctby_l_t = ps_sao_ctxt->i4_ctb_y - 1;
 2307|       |
 2308|  44.0k|                            ctbx_l_l = ps_sao_ctxt->i4_ctb_x - 1;
 2309|  44.0k|                            ctby_l_l = ps_sao_ctxt->i4_ctb_y;
 2310|       |
 2311|  44.0k|                            ctbx_l_r = ps_sao_ctxt->i4_ctb_x;
 2312|  44.0k|                            ctby_l_r = ps_sao_ctxt->i4_ctb_y;
 2313|       |
 2314|  44.0k|                            ctbx_l_d =  ps_sao_ctxt->i4_ctb_x - 1;
 2315|  44.0k|                            ctby_l_d =  ps_sao_ctxt->i4_ctb_y;
 2316|       |
 2317|  44.0k|                            ctbx_l = ps_sao_ctxt->i4_ctb_x - 1;
 2318|  44.0k|                            ctby_l = ps_sao_ctxt->i4_ctb_y;
 2319|       |
 2320|  44.0k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2320:32): [True: 14.8k, False: 29.1k]
  ------------------
 2321|  14.8k|                            {
 2322|  14.8k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2322:36): [True: 399, False: 14.4k]
  ------------------
 2323|    399|                                {
 2324|    399|                                    au4_idx_l[2] = -1;
 2325|    399|                                    au4_idx_l[4] = -1;
 2326|    399|                                    au4_idx_l[5] = -1;
 2327|    399|                                }
 2328|  14.4k|                                else
 2329|  14.4k|                                {
 2330|  14.4k|                                    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|  14.4k|                                    au4_idx_l[5] =  pu1_slice_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2332|  14.4k|                                }
 2333|  14.8k|                                idx_l   = au4_idx_l[6] = pu1_slice_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2334|  14.8k|                                au4_idx_l[0] = pu1_slice_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2335|  14.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)];
 2336|  14.8k|                                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|  14.8k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2339:36): [True: 399, False: 14.4k]
  ------------------
 2340|    399|                                {
 2341|    399|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2342|    399|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2343|    399|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2344|    399|                                }
 2345|  14.4k|                                else
 2346|  14.4k|                                {
 2347|  14.4k|                                    au4_ilf_across_tile_slice_enable[2] =  (ps_slice_hdr_base + idx_l)->i1_slice_loop_filter_across_slices_enabled_flag;
 2348|  14.4k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2349|  14.4k|                                }
 2350|       |
 2351|  14.8k|                                if(au4_idx_l[5] > idx_l)
  ------------------
  |  Branch (2351:36): [True: 741, False: 14.1k]
  ------------------
 2352|    741|                                {
 2353|    741|                                    au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_l[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 2354|    741|                                }
 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|  14.8k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_l[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2358|  14.8k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_l[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2359|  14.8k|                                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|   133k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2364:44): [True: 119k, False: 14.8k]
  ------------------
 2365|   119k|                                {
 2366|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2367|   119k|                                    if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2367:40): [True: 9.81k, False: 109k]
  ------------------
 2368|  9.81k|                                    {
 2369|  9.81k|                                        au1_tile_slice_boundary[i] = 1;
 2370|  9.81k|                                    }
 2371|   109k|                                    else
 2372|   109k|                                    {
 2373|   109k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2374|   109k|                                    }
 2375|   119k|                                }
 2376|       |                                /*Reset indices*/
 2377|   133k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2377:44): [True: 119k, False: 14.8k]
  ------------------
 2378|   119k|                                {
 2379|   119k|                                    au4_idx_l[i] = 0;
 2380|   119k|                                }
 2381|  14.8k|                            }
 2382|  44.0k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2382:32): [True: 30.1k, False: 13.8k]
  ------------------
 2383|  30.1k|                            {
 2384|       |                                /* Calculate availability flags at slice boundary */
 2385|  30.1k|                                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: 3.29k, False: 26.8k]
  |  Branch (2385:85): [True: 14.6k, False: 12.1k]
  |  Branch (2385:137): [True: 11.6k, False: 6.30k]
  |  Branch (2385:165): [True: 6.58k, False: 5.10k]
  ------------------
 2386|  11.4k|                                {
 2387|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2388|  11.4k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2388:40): [True: 9.75k, False: 1.65k]
  ------------------
 2389|  9.75k|                                    {
 2390|  9.75k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2390:44): [True: 1.63k, False: 8.11k]
  ------------------
 2391|  1.63k|                                        {
 2392|  1.63k|                                            au4_idx_l[2] = -1;
 2393|  1.63k|                                            au4_idx_l[4] = -1;
 2394|  1.63k|                                            au4_idx_l[5] = -1;
 2395|  1.63k|                                        }
 2396|  8.11k|                                        else
 2397|  8.11k|                                        {
 2398|  8.11k|                                            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.11k|                                            au4_idx_l[5] =  pu1_tile_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2400|  8.11k|                                        }
 2401|       |
 2402|  9.75k|                                        idx_l   = au4_idx_l[6] = pu1_tile_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2403|  9.75k|                                        au4_idx_l[0] = pu1_tile_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2404|  9.75k|                                        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.75k|                                        au4_idx_l[3] = pu1_tile_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2406|       |
 2407|  87.7k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2407:52): [True: 78.0k, False: 9.75k]
  ------------------
 2408|  78.0k|                                        {
 2409|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2410|  78.0k|                                            if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2410:48): [True: 30.5k, False: 47.4k]
  ------------------
 2411|  30.5k|                                            {
 2412|  30.5k|                                                au1_tile_slice_boundary[i] |= 1;
 2413|  30.5k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 2414|  30.5k|                                            }
 2415|  78.0k|                                        }
 2416|  9.75k|                                    }
 2417|  11.4k|                                }
 2418|  30.1k|                            }
 2419|   396k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2419:40): [True: 352k, False: 44.0k]
  ------------------
 2420|   352k|                            {
 2421|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2422|   352k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2422:36): [True: 40.3k, False: 311k]
  |  Branch (2422:68): [True: 33.1k, False: 7.17k]
  ------------------
 2423|  33.1k|                                {
 2424|  33.1k|                                    au1_avail_chroma[i] = 0;
 2425|  33.1k|                                }
 2426|   352k|                            }
 2427|  44.0k|                        }
 2428|   163k|                    }
 2429|   163k|                    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.70k, False: 161k]
  ------------------
 2430|  1.70k|                    {
 2431|  1.70k|                        au1_avail_chroma[0] = 0;
 2432|  1.70k|                        au1_avail_chroma[4] = 0;
 2433|  1.70k|                        au1_avail_chroma[6] = 0;
 2434|  1.70k|                    }
 2435|       |
 2436|   163k|                    if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2436:24): [True: 0, False: 163k]
  ------------------
 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|   163k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2443:24): [True: 56.1k, False: 107k]
  ------------------
 2444|  56.1k|                    {
 2445|  56.1k|                        au1_avail_chroma[2] = 0;
 2446|  56.1k|                        au1_avail_chroma[4] = 0;
 2447|  56.1k|                        au1_avail_chroma[5] = 0;
 2448|  56.1k|                    }
 2449|       |
 2450|   163k|                    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.01k, False: 155k]
  ------------------
 2451|  8.01k|                    {
 2452|  8.01k|                        au1_avail_chroma[3] = 0;
 2453|  8.01k|                        au1_avail_chroma[6] = 0;
 2454|  8.01k|                        au1_avail_chroma[7] = 0;
 2455|  8.01k|                    }
 2456|       |
 2457|   163k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   163k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2457:24): [True: 76.8k, False: 86.5k]
  ------------------
 2458|  76.8k|                    {
 2459|  76.8k|                        au1_src_top_right[0] = pu1_src_top_chroma[sao_wd_chroma];
 2460|  76.8k|                        au1_src_top_right[1] = pu1_src_top_chroma[sao_wd_chroma + 1];
 2461|  76.8k|                        au1_src_bot_left[0] = pu1_sao_src_top_left_chroma_bot_left[0];
 2462|  76.8k|                        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|  76.8k|                        if((ctb_size == (8 * h_samp_factor)) && (ps_sao_ctxt->i4_ctb_y != 0))
  ------------------
  |  Branch (2465:28): [True: 3.75k, False: 73.0k]
  |  Branch (2465:65): [True: 3.04k, False: 711]
  ------------------
 2466|  3.04k|                        {
 2467|  3.04k|                            au1_src_top_right[0] = pu1_src_chroma[sao_wd_chroma - chroma_strd];
 2468|  3.04k|                            au1_src_top_right[1] = pu1_src_chroma[sao_wd_chroma - chroma_strd + 1];
 2469|  3.04k|                        }
 2470|  76.8k|                        if (ctb_size == (8 * h_samp_factor))
  ------------------
  |  Branch (2470:29): [True: 3.75k, False: 73.0k]
  ------------------
 2471|  3.75k|                        {
 2472|  3.75k|                            au1_src_bot_left[0] = pu1_src_chroma[-2 + sao_ht_chroma * chroma_strd];
 2473|  3.75k|                            au1_src_bot_left[1] = pu1_src_chroma[-1 + sao_ht_chroma * chroma_strd];
 2474|  3.75k|                        }
 2475|       |
 2476|  76.8k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2476:28): [True: 16.1k, False: 60.6k]
  ------------------
 2477|  16.1k|                        {
 2478|  16.1k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2479|  16.1k|                                                                         chroma_strd,
 2480|  16.1k|                                                                         pu1_src_left_chroma,
 2481|  16.1k|                                                                         pu1_src_top_chroma,
 2482|  16.1k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 2483|  16.1k|                                                                         au1_src_top_right,
 2484|  16.1k|                                                                         au1_src_bot_left,
 2485|  16.1k|                                                                         au1_avail_chroma,
 2486|  16.1k|                                                                         ai1_offset_cr,
 2487|  16.1k|                                                                         ai1_offset_cb,
 2488|  16.1k|                                                                         sao_wd_chroma,
 2489|  16.1k|                                                                         sao_ht_chroma);
 2490|  16.1k|                        }
 2491|  60.6k|                        else
 2492|  60.6k|                        {
 2493|  60.6k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2494|  60.6k|                                                                         chroma_strd,
 2495|  60.6k|                                                                         pu1_src_left_chroma,
 2496|  60.6k|                                                                         pu1_src_top_chroma,
 2497|  60.6k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 2498|  60.6k|                                                                         au1_src_top_right,
 2499|  60.6k|                                                                         au1_src_bot_left,
 2500|  60.6k|                                                                         au1_avail_chroma,
 2501|  60.6k|                                                                         ai1_offset_cb,
 2502|  60.6k|                                                                         ai1_offset_cr,
 2503|  60.6k|                                                                         sao_wd_chroma,
 2504|  60.6k|                                                                         sao_ht_chroma);
 2505|  60.6k|                        }
 2506|  76.8k|                    }
 2507|  86.5k|                    else
 2508|  86.5k|                    {
 2509|  86.5k|                        UWORD16 *pu2_src_top_chroma = (UWORD16 *)pu1_src_top_chroma;
 2510|  86.5k|                        UWORD16 *pu2_sao_src_top_left_chroma_bot_left = (UWORD16 *)pu1_sao_src_top_left_chroma_bot_left;
 2511|  86.5k|                        UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 2512|       |
 2513|  86.5k|                        au2_src_top_right[0] = pu2_src_top_chroma[sao_wd_chroma];
 2514|  86.5k|                        au2_src_top_right[1] = pu2_src_top_chroma[sao_wd_chroma + 1];
 2515|  86.5k|                        au2_src_bot_left[0] = pu2_sao_src_top_left_chroma_bot_left[0];
 2516|  86.5k|                        au2_src_bot_left[1] = pu2_sao_src_top_left_chroma_bot_left[1];
 2517|  86.5k|                        if((ctb_size == (8 * h_samp_factor)) && (ps_sao_ctxt->i4_ctb_y != 0))
  ------------------
  |  Branch (2517:28): [True: 2.40k, False: 84.1k]
  |  Branch (2517:65): [True: 2.08k, False: 314]
  ------------------
 2518|  2.08k|                        {
 2519|  2.08k|                            au2_src_top_right[0] = pu2_src_chroma[sao_wd_chroma - chroma_strd];
 2520|  2.08k|                            au2_src_top_right[1] = pu2_src_chroma[sao_wd_chroma - chroma_strd + 1];
 2521|  2.08k|                        }
 2522|  86.5k|                        if (ctb_size == (8 * h_samp_factor))
  ------------------
  |  Branch (2522:29): [True: 2.40k, False: 84.1k]
  ------------------
 2523|  2.40k|                        {
 2524|  2.40k|                            au2_src_bot_left[0] = pu2_src_chroma[-2 + sao_ht_chroma * chroma_strd];
 2525|  2.40k|                            au2_src_bot_left[1] = pu2_src_chroma[-1 + sao_ht_chroma * chroma_strd];
 2526|  2.40k|                        }
 2527|       |
 2528|  86.5k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2528:28): [True: 16.2k, False: 70.2k]
  ------------------
 2529|  16.2k|                        {
 2530|  16.2k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 2531|  16.2k|                                                                             chroma_strd,
 2532|  16.2k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 2533|  16.2k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 2534|  16.2k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2535|  16.2k|                                                                             au2_src_top_right,
 2536|  16.2k|                                                                             au2_src_bot_left,
 2537|  16.2k|                                                                             au1_avail_chroma,
 2538|  16.2k|                                                                             ai1_offset_cr,
 2539|  16.2k|                                                                             ai1_offset_cb,
 2540|  16.2k|                                                                             sao_wd_chroma,
 2541|  16.2k|                                                                             sao_ht_chroma,
 2542|  16.2k|                                                                             u4_bit_depth_chroma);
 2543|  16.2k|                        }
 2544|  70.2k|                        else
 2545|  70.2k|                        {
 2546|  70.2k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 2547|  70.2k|                                                                             chroma_strd,
 2548|  70.2k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 2549|  70.2k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 2550|  70.2k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2551|  70.2k|                                                                             au2_src_top_right,
 2552|  70.2k|                                                                             au2_src_bot_left,
 2553|  70.2k|                                                                             au1_avail_chroma,
 2554|  70.2k|                                                                             ai1_offset_cb,
 2555|  70.2k|                                                                             ai1_offset_cr,
 2556|  70.2k|                                                                             sao_wd_chroma,
 2557|  70.2k|                                                                             sao_ht_chroma,
 2558|  70.2k|                                                                             u4_bit_depth_chroma);
 2559|  70.2k|                        }
 2560|  86.5k|                    }
 2561|       |
 2562|   163k|                }
 2563|  3.51M|            }
 2564|  5.94M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2564:21): [True: 765k, False: 5.17M]
  |  Branch (2564:68): [True: 2.47M, False: 2.70M]
  ------------------
 2565|  3.23M|            {
 2566|  3.23M|                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.23M|#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.23M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  3.23M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 3.22M, False: 13.3k]
  |  |  ------------------
  |  |  101|  35.4M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 32.2M, False: 3.22M]
  |  |  ------------------
  |  |  102|  32.2M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  32.2M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  32.2M|        } \
  |  |  105|  3.22M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  3.22M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  3.22M|    } else { \
  |  |  108|  13.3k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  13.3k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  13.3k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  13.3k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|   572k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 559k, False: 13.3k]
  |  |  ------------------
  |  |  113|   559k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|   559k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|   559k|        } \
  |  |  116|  13.3k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  13.3k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  13.3k|    } \
  |  |  119|  3.23M|    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.23M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 3.23M]
  |  |  ------------------
  ------------------
 2567|  3.23M|            }
 2568|       |
 2569|  9.45M|        }
 2570|  22.2M|        pu1_src_luma += sao_wd_luma * pixel_size_y;
 2571|  22.2M|        pu1_src_chroma += sao_wd_chroma * pixel_size_uv;
 2572|  22.2M|        ps_sao += 1;
 2573|  22.2M|    }
 2574|       |
 2575|       |
 2576|       |    /* Current CTB */
 2577|  23.5M|    {
 2578|  23.5M|        WORD32 sao_wd_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
 2579|  23.5M|        WORD32 sao_wd_chroma = ctb_size * (chroma_pixel_strd / h_samp_factor) - SAO_SHIFT_CTB * 2;
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
 2580|  23.5M|        WORD32 sao_ht_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
 2581|  23.5M|        WORD32 sao_ht_chroma = (ctb_size / v_samp_factor) - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
 2582|  23.5M|        WORD32 ctbx_c_t = 0, ctbx_c_l = 0, ctbx_c_r = 0, ctbx_c_d = 0, ctbx_c = 0;
 2583|  23.5M|        WORD32 ctby_c_t = 0, ctby_c_l = 0, ctby_c_r = 0, ctby_c_d = 0, ctby_c = 0;
 2584|  23.5M|        WORD32 au4_idx_c[8], idx_c;
 2585|  23.5M|        WORD32 chroma_strd = is_yuv444 ? src_strd * 2 : src_strd;
  ------------------
  |  Branch (2585:30): [True: 0, False: 23.5M]
  ------------------
 2586|       |
 2587|  23.5M|        WORD32 remaining_rows;
 2588|  23.5M|        WORD32 remaining_cols;
 2589|       |
 2590|  23.5M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_luma);
 2591|  23.5M|        if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2591:12): [True: 972k, False: 22.5M]
  ------------------
 2592|   972k|        {
 2593|   972k|            sao_wd_luma += remaining_cols;
 2594|   972k|        }
 2595|  23.5M|        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|  23.5M|        if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2596:12): [True: 972k, False: 22.5M]
  ------------------
 2597|   972k|        {
 2598|   972k|            sao_wd_chroma += remaining_cols;
 2599|   972k|        }
 2600|       |
 2601|  23.5M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + sao_ht_luma);
 2602|  23.5M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2602:12): [True: 954k, False: 22.5M]
  ------------------
 2603|   954k|        {
 2604|   954k|            sao_ht_luma += remaining_rows;
 2605|   954k|        }
 2606|  23.5M|        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|  23.5M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  23.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2607:12): [True: 954k, False: 22.5M]
  ------------------
 2608|   954k|        {
 2609|   954k|            sao_ht_chroma += remaining_rows;
 2610|   954k|        }
 2611|       |
 2612|  23.5M|        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|  23.5M|        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|  23.5M|        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|  23.5M|        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|  23.5M|        if((0 != sao_wd_luma) && (0 != sao_ht_luma))
  ------------------
  |  Branch (2617:12): [True: 23.2M, False: 235k]
  |  Branch (2617:34): [True: 23.2M, False: 18.4E]
  ------------------
 2618|  23.2M|        {
 2619|  23.2M|            if(ps_sao_ctxt->ps_slice_hdr->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (2619:16): [True: 9.29M, False: 13.9M]
  ------------------
 2620|  9.29M|            {
 2621|  9.29M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2621:20): [True: 8.92M, False: 368k]
  ------------------
 2622|  8.92M|                {
 2623|  8.92M|                    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|  8.92M|#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|  8.92M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.92M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 8.07M, False: 854k]
  |  |  ------------------
  |  |   82|   132M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 124M, False: 8.07M]
  |  |  ------------------
  |  |   83|   124M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|   124M|        } \
  |  |   85|  8.07M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  8.07M|    } else { \
  |  |   87|   854k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   854k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   854k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   854k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  37.6M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 36.8M, False: 854k]
  |  |  ------------------
  |  |   92|  36.8M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  36.8M|        } \
  |  |   94|   854k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   854k|    } \
  |  |   96|  8.92M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.92M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.92M]
  |  |  ------------------
  ------------------
 2624|  8.92M|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  8.92M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2624:24): [True: 8.05M, False: 869k]
  ------------------
 2625|  8.05M|                    {
 2626|  8.05M|                        pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2627|  8.05M|                    }
 2628|   869k|                    else
 2629|   869k|                    {
 2630|   869k|                        ((UWORD16 *)pu1_sao_src_top_left_luma_top_right)[0] = ((UWORD16 *)pu1_src_luma)[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2631|   869k|                    }
 2632|  8.92M|                }
 2633|       |
 2634|   368k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2634:25): [True: 198k, False: 170k]
  ------------------
 2635|   198k|                {
 2636|   198k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 2637|   198k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 2638|   198k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 2639|   198k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 2640|       |
 2641|   198k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   198k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2641:24): [True: 81.3k, False: 117k]
  ------------------
 2642|  81.3k|                    {
 2643|  81.3k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
 2644|  81.3k|                            pu1_src_luma,
 2645|  81.3k|                            src_strd,
 2646|  81.3k|                            pu1_src_left_luma,
 2647|  81.3k|                            pu1_src_top_luma,
 2648|  81.3k|                            pu1_sao_src_top_left_luma_curr_ctb,
 2649|  81.3k|                            ps_sao->b5_y_band_pos,
 2650|  81.3k|                            ai1_offset_y,
 2651|  81.3k|                            sao_wd_luma,
 2652|  81.3k|                            sao_ht_luma);
 2653|  81.3k|                    }
 2654|   117k|                    else
 2655|   117k|                    {
 2656|   117k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
 2657|   117k|                            (UWORD16 *)pu1_src_luma,
 2658|   117k|                            src_strd,
 2659|   117k|                            (UWORD16 *)pu1_src_left_luma,
 2660|   117k|                            (UWORD16 *)pu1_src_top_luma,
 2661|   117k|                            (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 2662|   117k|                            ps_sao->b5_y_band_pos,
 2663|   117k|                            ai1_offset_y,
 2664|   117k|                            sao_wd_luma,
 2665|   117k|                            sao_ht_luma,
 2666|   117k|                            u4_bit_depth_luma);
 2667|   117k|                    }
 2668|   198k|                }
 2669|       |
 2670|   170k|                else // if(2 <= ps_sao->b3_y_type_idx)
 2671|   170k|                {
 2672|   170k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 2673|   170k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 2674|   170k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 2675|   170k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 2676|       |
 2677|  1.58M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2677:32): [True: 1.41M, False: 170k]
  ------------------
 2678|  1.41M|                    {
 2679|  1.41M|                        au1_avail_luma[i] = 255;
 2680|  1.41M|                        au1_tile_slice_boundary[i] = 0;
 2681|  1.41M|                        au4_idx_c[i] = 0;
 2682|  1.41M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 2683|  1.41M|                    }
 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|   170k|                    {
 2703|   170k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2703:28): [True: 8.14k, False: 161k]
  |  Branch (2703:75): [True: 41.1k, False: 120k]
  ------------------
 2704|  56.2k|                        {
 2705|  56.2k|                            ctbx_c_t = ps_sao_ctxt->i4_ctb_x;
 2706|  56.2k|                            ctby_c_t = ps_sao_ctxt->i4_ctb_y - 1;
 2707|       |
 2708|  56.2k|                            ctbx_c_l = ps_sao_ctxt->i4_ctb_x - 1;
 2709|  56.2k|                            ctby_c_l = ps_sao_ctxt->i4_ctb_y;
 2710|       |
 2711|  56.2k|                            ctbx_c_r = ps_sao_ctxt->i4_ctb_x;
 2712|  56.2k|                            ctby_c_r = ps_sao_ctxt->i4_ctb_y;
 2713|       |
 2714|  56.2k|                            ctbx_c_d =  ps_sao_ctxt->i4_ctb_x;
 2715|  56.2k|                            ctby_c_d =  ps_sao_ctxt->i4_ctb_y;
 2716|       |
 2717|  56.2k|                            ctbx_c = ps_sao_ctxt->i4_ctb_x;
 2718|  56.2k|                            ctby_c = ps_sao_ctxt->i4_ctb_y;
 2719|       |
 2720|  56.2k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2720:32): [True: 15.1k, False: 41.1k]
  ------------------
 2721|  15.1k|                            {
 2722|  15.1k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2722:36): [True: 992, False: 14.1k]
  ------------------
 2723|    992|                                {
 2724|    992|                                    au4_idx_c[6] = -1;
 2725|    992|                                    au4_idx_c[0] = -1;
 2726|    992|                                    au4_idx_c[4] = -1;
 2727|    992|                                }
 2728|  14.1k|                                else
 2729|  14.1k|                                {
 2730|  14.1k|                                    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|  14.1k|                                }
 2732|       |
 2733|  15.1k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2733:36): [True: 2.13k, False: 13.0k]
  ------------------
 2734|  2.13k|                                {
 2735|  2.13k|                                    au4_idx_c[2] = -1;
 2736|  2.13k|                                    au4_idx_c[5] = -1;
 2737|  2.13k|                                    au4_idx_c[4] = -1;
 2738|  2.13k|                                }
 2739|  13.0k|                                else
 2740|  13.0k|                                {
 2741|  13.0k|                                    au4_idx_c[4] =  pu1_slice_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 2742|  13.0k|                                    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|  13.0k|                                }
 2744|  15.1k|                                idx_c   = pu1_slice_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 2745|  15.1k|                                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|  15.1k|                                au4_idx_c[3] = pu1_slice_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 2747|       |
 2748|  15.1k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2748:36): [True: 992, False: 14.1k]
  ------------------
 2749|    992|                                {
 2750|    992|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 2751|    992|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 2752|    992|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2753|    992|                                }
 2754|  14.1k|                                else
 2755|  14.1k|                                {
 2756|  14.1k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_c[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 2757|  14.1k|                                    au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;;
 2758|  14.1k|                                }
 2759|  15.1k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2759:36): [True: 2.13k, False: 13.0k]
  ------------------
 2760|  2.13k|                                {
 2761|  2.13k|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2762|  2.13k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2763|  2.13k|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2764|  2.13k|                                }
 2765|  13.0k|                                else
 2766|  13.0k|                                {
 2767|  13.0k|                                    au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 2768|  13.0k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2769|  13.0k|                                }
 2770|  15.1k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_c[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2771|  15.1k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_c[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2772|  15.1k|                                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|  15.1k|                                if(au4_idx_c[6] < idx_c)
  ------------------
  |  Branch (2774:36): [True: 1.40k, False: 13.7k]
  ------------------
 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|   136k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2783:44): [True: 121k, False: 15.1k]
  ------------------
 2784|   121k|                                {
 2785|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2786|   121k|                                    if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (2786:40): [True: 17.5k, False: 103k]
  ------------------
 2787|  17.5k|                                    {
 2788|  17.5k|                                        au1_tile_slice_boundary[i] = 1;
 2789|  17.5k|                                    }
 2790|   103k|                                    else
 2791|   103k|                                    {
 2792|   103k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2793|   103k|                                    }
 2794|   121k|                                }
 2795|       |                                /*Reset indices*/
 2796|   136k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2796:44): [True: 121k, False: 15.1k]
  ------------------
 2797|   121k|                                {
 2798|   121k|                                    au4_idx_c[i] = 0;
 2799|   121k|                                }
 2800|  15.1k|                            }
 2801|       |
 2802|  56.2k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2802:32): [True: 41.1k, False: 15.0k]
  ------------------
 2803|  41.1k|                            {
 2804|       |                                /* Calculate availability flags at slice boundary */
 2805|  41.1k|                                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.7k, False: 29.4k]
  |  Branch (2805:85): [True: 14.3k, False: 15.1k]
  |  Branch (2805:137): [True: 21.4k, False: 4.62k]
  |  Branch (2805:165): [True: 10.6k, False: 10.7k]
  ------------------
 2806|  15.4k|                                {
 2807|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2808|  15.4k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2808:40): [True: 14.1k, False: 1.28k]
  ------------------
 2809|  14.1k|                                    {
 2810|  14.1k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2810:44): [True: 4.56k, False: 9.57k]
  ------------------
 2811|  4.56k|                                        {
 2812|  4.56k|                                            au4_idx_c[6] = -1;
 2813|  4.56k|                                            au4_idx_c[0] = -1;
 2814|  4.56k|                                            au4_idx_c[4] = -1;
 2815|  4.56k|                                        }
 2816|  9.57k|                                        else
 2817|  9.57k|                                        {
 2818|  9.57k|                                            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|  9.57k|                                        }
 2820|       |
 2821|  14.1k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2821:44): [True: 1.54k, False: 12.5k]
  ------------------
 2822|  1.54k|                                        {
 2823|  1.54k|                                            au4_idx_c[2] = -1;
 2824|  1.54k|                                            au4_idx_c[5] = -1;
 2825|  1.54k|                                            au4_idx_c[4] = -1;
 2826|  1.54k|                                        }
 2827|  12.5k|                                        else
 2828|  12.5k|                                        {
 2829|  12.5k|                                            au4_idx_c[4] =  pu1_tile_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 2830|  12.5k|                                            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|  12.5k|                                        }
 2832|  14.1k|                                        idx_c   = pu1_tile_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 2833|  14.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)];
 2834|  14.1k|                                        au4_idx_c[3] = pu1_tile_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 2835|       |
 2836|   127k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2836:52): [True: 113k, False: 14.1k]
  ------------------
 2837|   113k|                                        {
 2838|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2839|   113k|                                            if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (2839:48): [True: 45.9k, False: 67.1k]
  ------------------
 2840|  45.9k|                                            {
 2841|  45.9k|                                                au1_tile_slice_boundary[i] |= 1;
 2842|  45.9k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 2843|  45.9k|                                            }
 2844|   113k|                                        }
 2845|  14.1k|                                    }
 2846|  15.4k|                                }
 2847|  41.1k|                            }
 2848|       |
 2849|   506k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2849:40): [True: 449k, False: 56.2k]
  ------------------
 2850|   449k|                            {
 2851|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2852|   449k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2852:36): [True: 63.4k, False: 386k]
  |  Branch (2852:68): [True: 54.7k, False: 8.73k]
  ------------------
 2853|  54.7k|                                {
 2854|  54.7k|                                    au1_avail_luma[i] = 0;
 2855|  54.7k|                                }
 2856|   449k|                            }
 2857|       |
 2858|  56.2k|                        }
 2859|   170k|                    }
 2860|   170k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2860:24): [True: 30.0k, False: 139k]
  ------------------
 2861|  30.0k|                    {
 2862|  30.0k|                        au1_avail_luma[0] = 0;
 2863|  30.0k|                        au1_avail_luma[4] = 0;
 2864|  30.0k|                        au1_avail_luma[6] = 0;
 2865|  30.0k|                    }
 2866|       |
 2867|   170k|                    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: 21.7k, False: 148k]
  ------------------
 2868|  21.7k|                    {
 2869|  21.7k|                        au1_avail_luma[1] = 0;
 2870|  21.7k|                        au1_avail_luma[5] = 0;
 2871|  21.7k|                        au1_avail_luma[7] = 0;
 2872|  21.7k|                    }
 2873|       |
 2874|   170k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2874:24): [True: 54.5k, False: 115k]
  ------------------
 2875|  54.5k|                    {
 2876|  54.5k|                        au1_avail_luma[2] = 0;
 2877|  54.5k|                        au1_avail_luma[4] = 0;
 2878|  54.5k|                        au1_avail_luma[5] = 0;
 2879|  54.5k|                    }
 2880|       |
 2881|   170k|                    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: 7.97k, False: 162k]
  ------------------
 2882|  7.97k|                    {
 2883|  7.97k|                        au1_avail_luma[3] = 0;
 2884|  7.97k|                        au1_avail_luma[6] = 0;
 2885|  7.97k|                        au1_avail_luma[7] = 0;
 2886|  7.97k|                    }
 2887|       |
 2888|   170k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   170k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2888:24): [True: 96.1k, False: 73.9k]
  ------------------
 2889|  96.1k|                    {
 2890|  96.1k|                        au1_src_top_right[0] = pu1_src_luma[sao_wd_luma - src_strd];
 2891|  96.1k|                        u1_sao_src_top_left_luma_bot_left = pu1_src_luma[sao_ht_luma * src_strd - 1];
 2892|       |
 2893|  96.1k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 2894|  96.1k|                                                                  src_strd,
 2895|  96.1k|                                                                  pu1_src_left_luma,
 2896|  96.1k|                                                                  pu1_src_top_luma,
 2897|  96.1k|                                                                  pu1_sao_src_top_left_luma_curr_ctb,
 2898|  96.1k|                                                                  au1_src_top_right,
 2899|  96.1k|                                                                  &u1_sao_src_top_left_luma_bot_left,
 2900|  96.1k|                                                                  au1_avail_luma,
 2901|  96.1k|                                                                  ai1_offset_y,
 2902|  96.1k|                                                                  sao_wd_luma,
 2903|  96.1k|                                                                  sao_ht_luma);
 2904|  96.1k|                        pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2905|  96.1k|                        pu1_sao_src_top_left_luma_bot_left[0] = pu1_src_luma[(sao_ht_luma)*src_strd + sao_wd_luma - 1];
 2906|  96.1k|                    }
 2907|  73.9k|                    else
 2908|  73.9k|                    {
 2909|  73.9k|                        UWORD16 *pu2_src_luma = (UWORD16 *)pu1_src_luma;
 2910|  73.9k|                        au2_src_top_right[0] = pu2_src_luma[sao_wd_luma - src_strd];
 2911|  73.9k|                        u2_sao_src_top_left_luma_bot_left = pu2_src_luma[sao_ht_luma * src_strd - 1];
 2912|       |
 2913|  73.9k|                        ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
 2914|  73.9k|                                                                      src_strd,
 2915|  73.9k|                                                                      (UWORD16 *)pu1_src_left_luma,
 2916|  73.9k|                                                                      (UWORD16 *)pu1_src_top_luma,
 2917|  73.9k|                                                                      (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 2918|  73.9k|                                                                      au2_src_top_right,
 2919|  73.9k|                                                                      &u2_sao_src_top_left_luma_bot_left,
 2920|  73.9k|                                                                      au1_avail_luma,
 2921|  73.9k|                                                                      ai1_offset_y,
 2922|  73.9k|                                                                      sao_wd_luma,
 2923|  73.9k|                                                                      sao_ht_luma,
 2924|  73.9k|                                                                      u4_bit_depth_luma);
 2925|  73.9k|                        ((UWORD16 *)pu1_sao_src_top_left_luma_top_right)[0] = pu2_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2926|  73.9k|                        ((UWORD16 *)pu1_sao_src_top_left_luma_bot_left)[0] = pu2_src_luma[(sao_ht_luma)*src_strd + sao_wd_luma - 1];
 2927|  73.9k|                    }
 2928|   170k|                }
 2929|  9.29M|            }
 2930|  13.9M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2930:21): [True: 5.71M, False: 8.26M]
  |  Branch (2930:68): [True: 3.04M, False: 5.21M]
  ------------------
 2931|  8.76M|            {
 2932|  8.76M|                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|  8.76M|#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|  8.76M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  8.76M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 8.64M, False: 124k]
  |  |  ------------------
  |  |   82|   139M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 131M, False: 8.64M]
  |  |  ------------------
  |  |   83|   131M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|   131M|        } \
  |  |   85|  8.64M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  8.64M|    } else { \
  |  |   87|   124k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   124k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   124k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   124k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  5.98M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 5.85M, False: 124k]
  |  |  ------------------
  |  |   92|  5.85M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  5.85M|        } \
  |  |   94|   124k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   124k|    } \
  |  |   96|  8.76M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  8.76M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 8.76M]
  |  |  ------------------
  ------------------
 2933|  8.76M|                if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  8.76M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2933:20): [True: 8.62M, False: 141k]
  ------------------
 2934|  8.62M|                {
 2935|  8.62M|                    pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2936|  8.62M|                }
 2937|   141k|                else
 2938|   141k|                {
 2939|   141k|                    ((UWORD16 *)pu1_sao_src_top_left_luma_top_right)[0] = ((UWORD16 *)pu1_src_luma)[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2940|   141k|                }
 2941|  8.76M|            }
 2942|  23.2M|        }
 2943|       |
 2944|  23.5M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && (0 != sao_wd_chroma) && (0 != sao_ht_chroma))
  ------------------
  |  Branch (2944:12): [True: 23.2M, False: 278k]
  |  Branch (2944:73): [True: 10.1M, False: 13.0M]
  |  Branch (2944:97): [True: 9.95M, False: 221k]
  ------------------
 2945|  9.95M|        {
 2946|  9.95M|            if(ps_sao_ctxt->ps_slice_hdr->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (2946:16): [True: 3.60M, False: 6.35M]
  ------------------
 2947|  3.60M|            {
 2948|  3.60M|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2948:20): [True: 3.26M, False: 334k]
  ------------------
 2949|  3.26M|                {
 2950|  3.26M|                    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.26M|#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.26M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  3.26M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 2.34M, False: 922k]
  |  |  ------------------
  |  |  101|  44.9M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 42.6M, False: 2.34M]
  |  |  ------------------
  |  |  102|  42.6M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  42.6M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  42.6M|        } \
  |  |  105|  2.34M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  2.34M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  2.34M|    } else { \
  |  |  108|   922k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   922k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   922k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   922k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  42.6M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 41.7M, False: 922k]
  |  |  ------------------
  |  |  113|  41.7M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  41.7M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  41.7M|        } \
  |  |  116|   922k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   922k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   922k|    } \
  |  |  119|  3.26M|    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.26M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 3.26M]
  |  |  ------------------
  ------------------
 2951|  3.26M|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  3.26M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2951:24): [True: 2.33M, False: 930k]
  ------------------
 2952|  2.33M|                    {
 2953|  2.33M|                        pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 2954|  2.33M|                        pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 2955|  2.33M|                    }
 2956|   930k|                    else
 2957|   930k|                    {
 2958|   930k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[0] = ((UWORD16 *)pu1_src_chroma)[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 2959|   930k|                        ((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|   930k|                    }
 2961|  3.26M|                }
 2962|       |
 2963|   334k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2963:25): [True: 150k, False: 183k]
  ------------------
 2964|   150k|                {
 2965|   150k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 2966|   150k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 2967|   150k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 2968|   150k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 2969|       |
 2970|   150k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 2971|   150k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 2972|   150k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 2973|   150k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 2974|       |
 2975|   150k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2975:24): [True: 16.8k, False: 133k]
  ------------------
 2976|  16.8k|                    {
 2977|  16.8k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  16.8k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2977:28): [True: 9.45k, False: 7.37k]
  ------------------
 2978|  9.45k|                        {
 2979|  9.45k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 2980|  9.45k|                                pu1_src_chroma,
 2981|  9.45k|                                chroma_strd,
 2982|  9.45k|                                pu1_src_left_chroma,
 2983|  9.45k|                                pu1_src_top_chroma,
 2984|  9.45k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 2985|  9.45k|                                ps_sao->b5_cr_band_pos,
 2986|  9.45k|                                ps_sao->b5_cb_band_pos,
 2987|  9.45k|                                ai1_offset_cr,
 2988|  9.45k|                                ai1_offset_cb,
 2989|  9.45k|                                sao_wd_chroma,
 2990|  9.45k|                                sao_ht_chroma);
 2991|  9.45k|                        }
 2992|  7.37k|                        else
 2993|  7.37k|                        {
 2994|  7.37k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 2995|  7.37k|                                (UWORD16 *)pu1_src_chroma,
 2996|  7.37k|                                chroma_strd,
 2997|  7.37k|                                (UWORD16 *)pu1_src_left_chroma,
 2998|  7.37k|                                (UWORD16 *)pu1_src_top_chroma,
 2999|  7.37k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3000|  7.37k|                                ps_sao->b5_cr_band_pos,
 3001|  7.37k|                                ps_sao->b5_cb_band_pos,
 3002|  7.37k|                                ai1_offset_cr,
 3003|  7.37k|                                ai1_offset_cb,
 3004|  7.37k|                                sao_wd_chroma,
 3005|  7.37k|                                sao_ht_chroma,
 3006|  7.37k|                                u4_bit_depth_chroma);
 3007|  7.37k|                        }
 3008|  16.8k|                    }
 3009|   133k|                    else
 3010|   133k|                    {
 3011|   133k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   133k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (3011:28): [True: 45.4k, False: 88.3k]
  ------------------
 3012|  45.4k|                        {
 3013|  45.4k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 3014|  45.4k|                                pu1_src_chroma,
 3015|  45.4k|                                chroma_strd,
 3016|  45.4k|                                pu1_src_left_chroma,
 3017|  45.4k|                                pu1_src_top_chroma,
 3018|  45.4k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 3019|  45.4k|                                ps_sao->b5_cb_band_pos,
 3020|  45.4k|                                ps_sao->b5_cr_band_pos,
 3021|  45.4k|                                ai1_offset_cb,
 3022|  45.4k|                                ai1_offset_cr,
 3023|  45.4k|                                sao_wd_chroma,
 3024|  45.4k|                                sao_ht_chroma);
 3025|  45.4k|                        }
 3026|  88.3k|                        else
 3027|  88.3k|                        {
 3028|  88.3k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 3029|  88.3k|                                (UWORD16 *)pu1_src_chroma,
 3030|  88.3k|                                chroma_strd,
 3031|  88.3k|                                (UWORD16 *)pu1_src_left_chroma,
 3032|  88.3k|                                (UWORD16 *)pu1_src_top_chroma,
 3033|  88.3k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3034|  88.3k|                                ps_sao->b5_cb_band_pos,
 3035|  88.3k|                                ps_sao->b5_cr_band_pos,
 3036|  88.3k|                                ai1_offset_cb,
 3037|  88.3k|                                ai1_offset_cr,
 3038|  88.3k|                                sao_wd_chroma,
 3039|  88.3k|                                sao_ht_chroma,
 3040|  88.3k|                                u4_bit_depth_chroma);
 3041|  88.3k|                        }
 3042|   133k|                    }
 3043|   150k|                }
 3044|       |
 3045|   183k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 3046|   183k|                {
 3047|   183k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 3048|   183k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 3049|   183k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 3050|   183k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 3051|       |
 3052|   183k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 3053|   183k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 3054|   183k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 3055|   183k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 3056|       |
 3057|  1.66M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3057:32): [True: 1.47M, False: 183k]
  ------------------
 3058|  1.47M|                    {
 3059|  1.47M|                        au1_avail_chroma[i] = 255;
 3060|  1.47M|                        au1_tile_slice_boundary[i] = 0;
 3061|  1.47M|                        au4_idx_c[i] = 0;
 3062|  1.47M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 3063|  1.47M|                    }
 3064|   183k|                    {
 3065|   183k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (3065:28): [True: 13.5k, False: 170k]
  |  Branch (3065:75): [True: 36.3k, False: 134k]
  ------------------
 3066|  50.8k|                        {
 3067|  50.8k|                            ctbx_c_t = ps_sao_ctxt->i4_ctb_x;
 3068|  50.8k|                            ctby_c_t = ps_sao_ctxt->i4_ctb_y - 1;
 3069|       |
 3070|  50.8k|                            ctbx_c_l = ps_sao_ctxt->i4_ctb_x - 1;
 3071|  50.8k|                            ctby_c_l = ps_sao_ctxt->i4_ctb_y;
 3072|       |
 3073|  50.8k|                            ctbx_c_r = ps_sao_ctxt->i4_ctb_x;
 3074|  50.8k|                            ctby_c_r = ps_sao_ctxt->i4_ctb_y;
 3075|       |
 3076|  50.8k|                            ctbx_c_d =  ps_sao_ctxt->i4_ctb_x;
 3077|  50.8k|                            ctby_c_d =  ps_sao_ctxt->i4_ctb_y;
 3078|       |
 3079|  50.8k|                            ctbx_c = ps_sao_ctxt->i4_ctb_x;
 3080|  50.8k|                            ctby_c = ps_sao_ctxt->i4_ctb_y;
 3081|       |
 3082|  50.8k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (3082:32): [True: 14.4k, False: 36.3k]
  ------------------
 3083|  14.4k|                            {
 3084|  14.4k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3084:36): [True: 1.87k, False: 12.5k]
  ------------------
 3085|  1.87k|                                {
 3086|  1.87k|                                    au4_idx_c[0] = -1;
 3087|  1.87k|                                    au4_idx_c[4] = -1;
 3088|  1.87k|                                    au4_idx_c[6] = -1;
 3089|  1.87k|                                }
 3090|  12.5k|                                else
 3091|  12.5k|                                {
 3092|  12.5k|                                    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|  12.5k|                                }
 3094|       |
 3095|  14.4k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3095:36): [True: 234, False: 14.2k]
  ------------------
 3096|    234|                                {
 3097|    234|                                    au4_idx_c[2] = -1;
 3098|    234|                                    au4_idx_c[4] = -1;
 3099|    234|                                    au4_idx_c[5] = -1;
 3100|    234|                                }
 3101|  14.2k|                                else
 3102|  14.2k|                                {
 3103|  14.2k|                                    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|  14.2k|                                    au4_idx_c[4] =  pu1_slice_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 3105|  14.2k|                                }
 3106|  14.4k|                                idx_c = pu1_slice_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 3107|  14.4k|                                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|  14.4k|                                au4_idx_c[3] = pu1_slice_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 3109|       |
 3110|  14.4k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3110:36): [True: 1.87k, False: 12.5k]
  ------------------
 3111|  1.87k|                                {
 3112|  1.87k|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 3113|  1.87k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 3114|  1.87k|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 3115|  1.87k|                                }
 3116|  12.5k|                                else
 3117|  12.5k|                                {
 3118|  12.5k|                                    au4_ilf_across_tile_slice_enable[6] &= (ps_slice_hdr_base + au4_idx_c[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 3119|  12.5k|                                    au4_ilf_across_tile_slice_enable[0] &= (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3120|  12.5k|                                }
 3121|       |
 3122|  14.4k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3122:36): [True: 234, False: 14.2k]
  ------------------
 3123|    234|                                {
 3124|    234|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 3125|    234|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 3126|    234|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 3127|    234|                                }
 3128|  14.2k|                                else
 3129|  14.2k|                                {
 3130|  14.2k|                                    au4_ilf_across_tile_slice_enable[2] &= (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3131|  14.2k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 3132|  14.2k|                                }
 3133|       |
 3134|  14.4k|                                au4_ilf_across_tile_slice_enable[1] &= (ps_slice_hdr_base + au4_idx_c[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 3135|  14.4k|                                au4_ilf_across_tile_slice_enable[3] &= (ps_slice_hdr_base + au4_idx_c[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 3136|  14.4k|                                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|  14.4k|                                if(idx_c > au4_idx_c[6])
  ------------------
  |  Branch (3138:36): [True: 2.25k, False: 12.1k]
  ------------------
 3139|  2.25k|                                {
 3140|  2.25k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3141|  2.25k|                                }
 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|   130k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3147:44): [True: 115k, False: 14.4k]
  ------------------
 3148|   115k|                                {
 3149|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 3150|   115k|                                    if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (3150:40): [True: 11.3k, False: 104k]
  ------------------
 3151|  11.3k|                                    {
 3152|  11.3k|                                        au1_tile_slice_boundary[i] = 1;
 3153|  11.3k|                                    }
 3154|   104k|                                    else
 3155|   104k|                                    {
 3156|   104k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 3157|   104k|                                    }
 3158|   115k|                                }
 3159|       |                                /*Reset indices*/
 3160|   130k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3160:44): [True: 115k, False: 14.4k]
  ------------------
 3161|   115k|                                {
 3162|   115k|                                    au4_idx_c[i] = 0;
 3163|   115k|                                }
 3164|  14.4k|                            }
 3165|       |
 3166|  50.8k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3166:32): [True: 36.4k, False: 14.3k]
  ------------------
 3167|  36.4k|                            {
 3168|       |                                /* Calculate availability flags at slice boundary */
 3169|  36.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 (3169:37): [True: 10.5k, False: 25.8k]
  |  Branch (3169:85): [True: 13.9k, False: 11.9k]
  |  Branch (3169:137): [True: 19.8k, False: 4.72k]
  |  Branch (3169:165): [True: 10.1k, False: 9.66k]
  ------------------
 3170|  14.3k|                                {
 3171|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 3172|  14.3k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (3172:40): [True: 13.2k, False: 1.09k]
  ------------------
 3173|  13.2k|                                    {
 3174|  13.2k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3174:44): [True: 4.18k, False: 9.10k]
  ------------------
 3175|  4.18k|                                        {
 3176|  4.18k|                                            au4_idx_c[6] = -1;
 3177|  4.18k|                                            au4_idx_c[0] = -1;
 3178|  4.18k|                                            au4_idx_c[4] = -1;
 3179|  4.18k|                                        }
 3180|  9.10k|                                        else
 3181|  9.10k|                                        {
 3182|  9.10k|                                            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|  9.10k|                                        }
 3184|       |
 3185|  13.2k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3185:44): [True: 1.47k, False: 11.8k]
  ------------------
 3186|  1.47k|                                        {
 3187|  1.47k|                                            au4_idx_c[2] = -1;
 3188|  1.47k|                                            au4_idx_c[5] = -1;
 3189|  1.47k|                                            au4_idx_c[4] = -1;
 3190|  1.47k|                                        }
 3191|  11.8k|                                        else
 3192|  11.8k|                                        {
 3193|  11.8k|                                            au4_idx_c[4] =  pu1_tile_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 3194|  11.8k|                                            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|  11.8k|                                        }
 3196|  13.2k|                                        idx_c   = pu1_tile_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 3197|  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)];
 3198|  13.2k|                                        au4_idx_c[3] = pu1_tile_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 3199|       |
 3200|   119k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3200:52): [True: 106k, False: 13.2k]
  ------------------
 3201|   106k|                                        {
 3202|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 3203|   106k|                                            if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (3203:48): [True: 43.4k, False: 62.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|   106k|                                        }
 3209|  13.2k|                                    }
 3210|  14.3k|                                }
 3211|  36.4k|                            }
 3212|       |
 3213|   457k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3213:40): [True: 406k, False: 50.8k]
  ------------------
 3214|   406k|                            {
 3215|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 3216|   406k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (3216:36): [True: 54.7k, False: 351k]
  |  Branch (3216:68): [True: 49.2k, False: 5.51k]
  ------------------
 3217|  49.2k|                                {
 3218|  49.2k|                                    au1_avail_chroma[i] = 0;
 3219|  49.2k|                                }
 3220|   406k|                            }
 3221|  50.8k|                        }
 3222|   183k|                    }
 3223|       |
 3224|   183k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3224:24): [True: 37.3k, False: 146k]
  ------------------
 3225|  37.3k|                    {
 3226|  37.3k|                        au1_avail_chroma[0] = 0;
 3227|  37.3k|                        au1_avail_chroma[4] = 0;
 3228|  37.3k|                        au1_avail_chroma[6] = 0;
 3229|  37.3k|                    }
 3230|       |
 3231|   183k|                    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: 27.0k, False: 156k]
  ------------------
 3232|  27.0k|                    {
 3233|  27.0k|                        au1_avail_chroma[1] = 0;
 3234|  27.0k|                        au1_avail_chroma[5] = 0;
 3235|  27.0k|                        au1_avail_chroma[7] = 0;
 3236|  27.0k|                    }
 3237|       |
 3238|   183k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3238:24): [True: 60.7k, False: 123k]
  ------------------
 3239|  60.7k|                    {
 3240|  60.7k|                        au1_avail_chroma[2] = 0;
 3241|  60.7k|                        au1_avail_chroma[4] = 0;
 3242|  60.7k|                        au1_avail_chroma[5] = 0;
 3243|  60.7k|                    }
 3244|       |
 3245|   183k|                    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: 8.20k, False: 175k]
  ------------------
 3246|  8.20k|                    {
 3247|  8.20k|                        au1_avail_chroma[3] = 0;
 3248|  8.20k|                        au1_avail_chroma[6] = 0;
 3249|  8.20k|                        au1_avail_chroma[7] = 0;
 3250|  8.20k|                    }
 3251|       |
 3252|   183k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   183k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (3252:24): [True: 88.7k, False: 95.2k]
  ------------------
 3253|  88.7k|                    {
 3254|  88.7k|                        au1_src_top_right[0] = pu1_src_chroma[sao_wd_chroma - chroma_strd];
 3255|  88.7k|                        au1_src_top_right[1] = pu1_src_chroma[sao_wd_chroma - chroma_strd + 1];
 3256|       |
 3257|  88.7k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 2];
 3258|  88.7k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 1];
 3259|       |
 3260|  88.7k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (3260:28): [True: 18.0k, False: 70.7k]
  ------------------
 3261|  18.0k|                        {
 3262|  18.0k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 3263|  18.0k|                                                                         chroma_strd,
 3264|  18.0k|                                                                         pu1_src_left_chroma,
 3265|  18.0k|                                                                         pu1_src_top_chroma,
 3266|  18.0k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 3267|  18.0k|                                                                         au1_src_top_right,
 3268|  18.0k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 3269|  18.0k|                                                                         au1_avail_chroma,
 3270|  18.0k|                                                                         ai1_offset_cr,
 3271|  18.0k|                                                                         ai1_offset_cb,
 3272|  18.0k|                                                                         sao_wd_chroma,
 3273|  18.0k|                                                                         sao_ht_chroma);
 3274|  18.0k|                        }
 3275|  70.7k|                        else
 3276|  70.7k|                        {
 3277|  70.7k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 3278|  70.7k|                                                                         chroma_strd,
 3279|  70.7k|                                                                         pu1_src_left_chroma,
 3280|  70.7k|                                                                         pu1_src_top_chroma,
 3281|  70.7k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 3282|  70.7k|                                                                         au1_src_top_right,
 3283|  70.7k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 3284|  70.7k|                                                                         au1_avail_chroma,
 3285|  70.7k|                                                                         ai1_offset_cb,
 3286|  70.7k|                                                                         ai1_offset_cr,
 3287|  70.7k|                                                                         sao_wd_chroma,
 3288|  70.7k|                                                                         sao_ht_chroma);
 3289|  70.7k|                        }
 3290|  88.7k|                        pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3291|  88.7k|                        pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 3292|       |
 3293|  88.7k|                        pu1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 2];
 3294|  88.7k|                        pu1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 1];
 3295|  88.7k|                    }
 3296|  95.2k|                    else
 3297|  95.2k|                    {
 3298|  95.2k|                        UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 3299|       |
 3300|  95.2k|                        au2_src_top_right[0] = pu2_src_chroma[sao_wd_chroma - chroma_strd];
 3301|  95.2k|                        au2_src_top_right[1] = pu2_src_chroma[sao_wd_chroma - chroma_strd + 1];
 3302|       |
 3303|  95.2k|                        au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 2];
 3304|  95.2k|                        au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 1];
 3305|       |
 3306|  95.2k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (3306:28): [True: 21.7k, False: 73.4k]
  ------------------
 3307|  21.7k|                        {
 3308|  21.7k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 3309|  21.7k|                                                                             chroma_strd,
 3310|  21.7k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 3311|  21.7k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 3312|  21.7k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3313|  21.7k|                                                                             au2_src_top_right,
 3314|  21.7k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 3315|  21.7k|                                                                             au1_avail_chroma,
 3316|  21.7k|                                                                             ai1_offset_cr,
 3317|  21.7k|                                                                             ai1_offset_cb,
 3318|  21.7k|                                                                             sao_wd_chroma,
 3319|  21.7k|                                                                             sao_ht_chroma,
 3320|  21.7k|                                                                             u4_bit_depth_chroma);
 3321|  21.7k|                        }
 3322|  73.4k|                        else
 3323|  73.4k|                        {
 3324|  73.4k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 3325|  73.4k|                                                                             chroma_strd,
 3326|  73.4k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 3327|  73.4k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 3328|  73.4k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3329|  73.4k|                                                                             au2_src_top_right,
 3330|  73.4k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 3331|  73.4k|                                                                             au1_avail_chroma,
 3332|  73.4k|                                                                             ai1_offset_cb,
 3333|  73.4k|                                                                             ai1_offset_cr,
 3334|  73.4k|                                                                             sao_wd_chroma,
 3335|  73.4k|                                                                             sao_ht_chroma,
 3336|  73.4k|                                                                             u4_bit_depth_chroma);
 3337|  73.4k|                        }
 3338|  95.2k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[0] = pu2_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3339|  95.2k|                        ((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|  95.2k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_bot_left)[0] = pu2_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 2];
 3342|  95.2k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_bot_left)[1] = pu2_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 1];
 3343|  95.2k|                    }
 3344|   183k|                }
 3345|  3.60M|            }
 3346|  6.35M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (3346:21): [True: 775k, False: 5.57M]
  |  Branch (3346:68): [True: 2.50M, False: 3.07M]
  ------------------
 3347|  3.28M|            {
 3348|  3.28M|                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.28M|#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.28M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  3.28M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 3.26M, False: 15.7k]
  |  |  ------------------
  |  |  101|  36.4M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 33.2M, False: 3.26M]
  |  |  ------------------
  |  |  102|  33.2M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  33.2M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  33.2M|        } \
  |  |  105|  3.26M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  3.26M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  3.26M|    } else { \
  |  |  108|  15.7k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  15.7k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  15.7k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  15.7k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|   667k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 651k, False: 15.7k]
  |  |  ------------------
  |  |  113|   651k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|   651k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|   651k|        } \
  |  |  116|  15.7k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  15.7k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  15.7k|    } \
  |  |  119|  3.28M|    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.28M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 3.28M]
  |  |  ------------------
  ------------------
 3349|  3.28M|                if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  3.28M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (3349:20): [True: 3.26M, False: 20.2k]
  ------------------
 3350|  3.26M|                {
 3351|  3.26M|                    pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3352|  3.26M|                    pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 3353|  3.26M|                }
 3354|  20.2k|                else
 3355|  20.2k|                {
 3356|  20.2k|                    ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[0] = ((UWORD16 *)pu1_src_chroma)[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3357|  20.2k|                    ((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|  20.2k|                }
 3359|  3.28M|            }
 3360|       |
 3361|  9.95M|        }
 3362|  23.5M|    }
 3363|       |
 3364|       |
 3365|       |
 3366|       |
 3367|       |/* If no loop filter is enabled copy the backed up values */
 3368|  23.5M|    {
 3369|       |        /* Luma */
 3370|  23.5M|        if(no_loop_filter_enabled_luma)
  ------------------
  |  Branch (3370:12): [True: 191k, False: 23.3M]
  ------------------
 3371|   191k|        {
 3372|   191k|            UWORD32 u4_no_loop_filter_flag;
 3373|   191k|            WORD32 loop_filter_bit_pos;
 3374|   191k|            WORD32 log2_min_cu = 3;
 3375|   191k|            WORD32 min_cu = (1 << log2_min_cu);
 3376|   191k|            UWORD8 *pu1_src_tmp_luma = pu1_src_luma;
 3377|   191k|            WORD32 sao_blk_ht = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|   191k|#define SAO_SHIFT_CTB    8
  ------------------
 3378|   191k|            WORD32 sao_blk_wd = ctb_size;
 3379|   191k|            WORD32 remaining_rows;
 3380|   191k|            WORD32 remaining_cols;
 3381|       |
 3382|   191k|            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|   191k|#define SAO_SHIFT_CTB    8
  ------------------
 3383|   191k|            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|   191k|#define SAO_SHIFT_CTB    8
  ------------------
 3384|   191k|            if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|   191k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3384:16): [True: 24.1k, False: 167k]
  ------------------
 3385|  24.1k|                sao_blk_ht += remaining_rows;
 3386|   191k|            if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|   191k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3386:16): [True: 33.5k, False: 158k]
  ------------------
 3387|  33.5k|                sao_blk_wd += remaining_cols;
 3388|       |
 3389|   191k|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * pixel_size_y : 0;
  ------------------
  |  |   78|   154k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3389:33): [True: 154k, False: 37.5k]
  ------------------
 3390|   191k|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd * pixel_size_y : 0;
  ------------------
  |  |   78|   125k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3390:33): [True: 125k, False: 66.4k]
  ------------------
 3391|       |
 3392|   191k|            pu1_src_backup_luma = ps_sao_ctxt->pu1_tmp_buf_luma;
 3393|       |
 3394|   191k|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
 3395|   191k|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
 3396|   191k|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (3396:16): [True: 154k, False: 37.5k]
  ------------------
 3397|   154k|                loop_filter_bit_pos -= 1;
 3398|       |
 3399|   191k|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
 3400|   191k|                            (loop_filter_bit_pos >> 3);
 3401|       |
 3402|   191k|            for(i = -(ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|   125k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3402:23): [True: 125k, False: 66.4k]
  ------------------
 3403|  1.42M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (3403:29): [True: 1.23M, False: 191k]
  ------------------
 3404|  1.23M|            {
 3405|  1.23M|                WORD32 tmp_wd = sao_blk_wd;
 3406|       |
 3407|  1.23M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
 3408|  1.23M|                                (loop_filter_bit_pos & 7);
 3409|  1.23M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
 3410|       |
 3411|  1.23M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (3411:20): [True: 687k, False: 545k]
  ------------------
 3412|   687k|                {
 3413|  1.96M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (3413:27): [True: 1.27M, False: 687k]
  ------------------
 3414|  1.27M|                    {
 3415|  1.27M|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (3415:28): [True: 533k, False: 739k]
  ------------------
 3416|   533k|                        {
 3417|   533k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   533k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 288k, False: 245k]
  |  |  ------------------
  ------------------
 3418|   533k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   533k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 288k, False: 245k]
  |  |  ------------------
  ------------------
 3419|   533k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
 3420|   533k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
 3421|   533k|                        }
 3422|   739k|                        else
 3423|   739k|                        {
 3424|  6.59M|                            for(row = 0; row < min_cu; row++)
  ------------------
  |  Branch (3424:42): [True: 5.85M, False: 739k]
  ------------------
 3425|  5.85M|                            {
 3426|   347M|                                for(col = 0; col < MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y; col++)
  ------------------
  |  |   43|   347M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 65.9M, False: 281M]
  |  |  ------------------
  ------------------
  |  Branch (3426:46): [True: 341M, False: 5.85M]
  ------------------
 3427|   341M|                                {
 3428|   341M|                                    pu1_src_tmp_luma[row * src_strd * pixel_size_y + col] = pu1_src_backup_luma[row * backup_strd * pixel_size_y + col];
 3429|   341M|                                }
 3430|  5.85M|                            }
 3431|   739k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   739k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 298k, False: 441k]
  |  |  ------------------
  ------------------
 3432|   739k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   739k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 298k, False: 441k]
  |  |  ------------------
  ------------------
 3433|   739k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
 3434|   739k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
 3435|   739k|                        }
 3436|  1.27M|                    }
 3437|       |
 3438|   687k|                    pu1_src_tmp_luma -= sao_blk_wd * pixel_size_y;
 3439|   687k|                    pu1_src_backup_luma -= sao_blk_wd * pixel_size_y;
 3440|   687k|                }
 3441|       |
 3442|  1.23M|                pu1_src_tmp_luma += ((src_strd << log2_min_cu) * pixel_size_y);
 3443|  1.23M|                pu1_src_backup_luma += ((backup_strd << log2_min_cu) * pixel_size_y);
 3444|  1.23M|            }
 3445|   191k|        }
 3446|       |
 3447|       |        /* Chroma */
 3448|  23.5M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && no_loop_filter_enabled_chroma)
  ------------------
  |  Branch (3448:12): [True: 23.2M, False: 284k]
  |  Branch (3448:73): [True: 184k, False: 23.0M]
  ------------------
 3449|   184k|        {
 3450|   184k|            UWORD32 u4_no_loop_filter_flag;
 3451|   184k|            WORD32 loop_filter_bit_pos;
 3452|   184k|            WORD32 log2_min_cu = 3;
 3453|   184k|            WORD32 min_cu = (1 << log2_min_cu);
 3454|   184k|            UWORD8 *pu1_src_tmp_chroma = pu1_src_chroma;
 3455|   184k|            WORD32 sao_blk_ht = ctb_size - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|   184k|#define SAO_SHIFT_CTB    8
  ------------------
 3456|   184k|            WORD32 sao_blk_wd = ctb_size;
 3457|   184k|            WORD32 remaining_rows;
 3458|   184k|            WORD32 remaining_cols;
 3459|       |
 3460|   184k|            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|   184k|#define SAO_SHIFT_CTB    8
  ------------------
 3461|   184k|            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|   184k|#define SAO_SHIFT_CTB    8
  ------------------
 3462|   184k|            if(remaining_rows <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|   184k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3462:16): [True: 24.0k, False: 160k]
  ------------------
 3463|  24.0k|                sao_blk_ht += remaining_rows;
 3464|   184k|            if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|   184k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3464:16): [True: 32.9k, False: 151k]
  ------------------
 3465|  32.9k|                sao_blk_wd += remaining_cols;
 3466|       |
 3467|   184k|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * 2 : 0) * pixel_size_uv;
  ------------------
  |  |   78|   147k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3467:36): [True: 147k, False: 36.4k]
  ------------------
 3468|   184k|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * chroma_strd : 0) * pixel_size_uv;
  ------------------
  |  |   78|   122k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3468:36): [True: 122k, False: 61.6k]
  ------------------
 3469|       |
 3470|   184k|            pu1_src_backup_chroma = ps_sao_ctxt->pu1_tmp_buf_chroma;
 3471|       |
 3472|   184k|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
 3473|   184k|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
 3474|   184k|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (3474:16): [True: 147k, False: 36.4k]
  ------------------
 3475|   147k|                loop_filter_bit_pos -= (is_yuv444 ? 1 : 2);
  ------------------
  |  Branch (3475:41): [True: 0, False: 147k]
  ------------------
 3476|       |
 3477|   184k|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
 3478|   184k|                            (loop_filter_bit_pos >> 3);
 3479|       |
 3480|   184k|            for(i = -(ps_sao_ctxt->i4_ctb_y ? 2 * SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|   122k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3480:23): [True: 122k, False: 61.6k]
  ------------------
 3481|  1.36M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (3481:29): [True: 1.18M, False: 184k]
  ------------------
 3482|  1.18M|            {
 3483|  1.18M|                WORD32 tmp_wd = sao_blk_wd;
 3484|       |
 3485|  1.18M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
 3486|  1.18M|                                (loop_filter_bit_pos & 7);
 3487|  1.18M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
 3488|       |
 3489|  1.18M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (3489:20): [True: 678k, False: 506k]
  ------------------
 3490|   678k|                {
 3491|  1.92M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (3491:27): [True: 1.24M, False: 678k]
  ------------------
 3492|  1.24M|                    {
 3493|  1.24M|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (3493:28): [True: 524k, False: 721k]
  ------------------
 3494|   524k|                        {
 3495|   524k|                            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|   524k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 274k, False: 249k]
  |  |  ------------------
  ------------------
 3496|   524k|                            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|   524k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 274k, False: 249k]
  |  |  ------------------
  ------------------
 3497|   524k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
 3498|   524k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
 3499|   524k|                        }
 3500|   721k|                        else
 3501|   721k|                        {
 3502|  5.53M|                            for(row = 0; row < min_cu / v_samp_factor; row++)
  ------------------
  |  Branch (3502:42): [True: 4.81M, False: 721k]
  ------------------
 3503|  4.81M|                            {
 3504|   309M|                                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|   309M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 74.1M, False: 235M]
  |  |  ------------------
  ------------------
  |  Branch (3504:46): [True: 304M, False: 4.81M]
  ------------------
 3505|   304M|                                {
 3506|   304M|                                    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|   304M|                                }
 3508|  4.81M|                            }
 3509|       |
 3510|   721k|                            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|   721k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 293k, False: 428k]
  |  |  ------------------
  ------------------
 3511|   721k|                            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|   721k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 293k, False: 428k]
  |  |  ------------------
  ------------------
 3512|   721k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
 3513|   721k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
 3514|   721k|                        }
 3515|  1.24M|                    }
 3516|       |
 3517|   678k|                    pu1_src_tmp_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
 3518|   678k|                    pu1_src_backup_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
 3519|   678k|                }
 3520|       |
 3521|  1.18M|                pu1_src_tmp_chroma += ((((src_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
 3522|  1.18M|                pu1_src_backup_chroma += ((((backup_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
 3523|  1.18M|            }
 3524|   184k|        }
 3525|  23.5M|    }
 3526|       |
 3527|  23.5M|}

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

ihevcd_fmt_conv_420sp_to_420p_ssse3:
   60|  15.9k|{
   61|  15.9k|    UWORD8 *pu1_src, *pu1_dst;
   62|  15.9k|    UWORD8 *pu1_u_src, *pu1_v_src;
   63|  15.9k|    WORD32 num_rows, num_cols, src_strd, dst_strd, cols, rows;
   64|  15.9k|    WORD32 i, j;
   65|       |
   66|  15.9k|    cols = 0;
   67|  15.9k|    pu1_u_src = (UWORD8 *)pu1_uv_src;
   68|  15.9k|    pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
   69|  15.9k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (69:8): [True: 0, False: 15.9k]
  ------------------
   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|  15.9k|    if(!is_u_first)
  ------------------
  |  Branch (89:8): [True: 0, False: 15.9k]
  ------------------
   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|  15.9k|    {
  100|  15.9k|        __m128i src_uv0_8x16b, src_uv1_8x16b, src_u_8x16b, src_v_8x16b;
  101|  15.9k|        __m128i temp0_8x16b, temp1_8x16b, alt_first_mask;
  102|       |
  103|  15.9k|        UWORD8 FIRST_ALT_SHUFFLE[16] = {
  104|  15.9k|            0x00, 0x02, 0x04, 0x06,
  105|  15.9k|            0x08, 0x0A, 0x0C, 0x0E,
  106|  15.9k|            0x01, 0x03, 0x05, 0x07,
  107|  15.9k|            0x09, 0x0B, 0x0D, 0x0F };
  108|       |
  109|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (0 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  110|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (1 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  111|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (2 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  112|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (3 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  113|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (4 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  114|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (5 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  115|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (6 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  116|  15.9k|        PREFETCH((char const *)(pu1_uv_src + (7 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  15.9k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  117|       |
  118|  15.9k|        num_rows = ht >> 1;
  119|  15.9k|        num_cols = wd >> 1;
  120|       |
  121|  15.9k|        src_strd = src_uv_strd;
  122|  15.9k|        dst_strd = dst_uv_strd;
  123|       |
  124|  15.9k|        alt_first_mask = _mm_loadu_si128((__m128i *)&FIRST_ALT_SHUFFLE[0]);
  125|       |
  126|  15.9k|        if(num_cols > 15)
  ------------------
  |  Branch (126:12): [True: 15.9k, False: 18.4E]
  ------------------
  127|  15.9k|        {
  128|  15.9k|            cols = num_cols >> 4;
  129|       |
  130|   234k|            for(i = 0; i < (num_rows >> 2); i++)
  ------------------
  |  Branch (130:24): [True: 218k, False: 15.9k]
  ------------------
  131|   218k|            {
  132|   218k|                UWORD8 *pu1_uv_src_temp, *pu1_u_dst_temp, *pu1_v_dst_temp;
  133|       |
  134|   218k|                PREFETCH((char const *)(pu1_uv_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   218k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  135|   218k|                PREFETCH((char const *)(pu1_uv_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   218k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  136|   218k|                PREFETCH((char const *)(pu1_uv_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   218k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  137|   218k|                PREFETCH((char const *)(pu1_uv_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   218k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  138|       |
  139|   218k|                pu1_uv_src_temp = pu1_uv_src;
  140|   218k|                pu1_u_dst_temp =  pu1_u_dst;
  141|   218k|                pu1_v_dst_temp =  pu1_v_dst;
  142|       |
  143|  9.96M|                for(j = 0; j < cols; j++)
  ------------------
  |  Branch (143:28): [True: 9.74M, False: 218k]
  ------------------
  144|  9.74M|                {
  145|       |
  146|       |                    /**** Row 0 ***/
  147|  9.74M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)pu1_uv_src_temp);
  148|  9.74M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + 16));
  149|       |
  150|  9.74M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  151|  9.74M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  152|       |
  153|  9.74M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  154|  9.74M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  155|       |
  156|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp), src_u_8x16b);
  157|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp), src_v_8x16b);
  158|       |
  159|       |                    /**** Row 1 ***/
  160|  9.74M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (1 * src_strd)));
  161|  9.74M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (1 * src_strd) + 16));
  162|       |
  163|  9.74M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  164|  9.74M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  165|       |
  166|  9.74M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  167|  9.74M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  168|       |
  169|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp + (1 * dst_strd)), src_u_8x16b);
  170|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp + (1 * dst_strd)), src_v_8x16b);
  171|       |
  172|       |                    /**** Row 2 ***/
  173|  9.74M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (2 * src_strd)));
  174|  9.74M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (2 * src_strd) + 16));
  175|       |
  176|  9.74M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  177|  9.74M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  178|       |
  179|  9.74M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  180|  9.74M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  181|       |
  182|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp + (2 * dst_strd)), src_u_8x16b);
  183|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp + (2 * dst_strd)), src_v_8x16b);
  184|       |
  185|       |                    /**** Row 3 ***/
  186|  9.74M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (3 * src_strd)));
  187|  9.74M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (3 * src_strd) + 16));
  188|       |
  189|  9.74M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  190|  9.74M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  191|       |
  192|  9.74M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  193|  9.74M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  194|       |
  195|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp + (3 * dst_strd)), src_u_8x16b);
  196|  9.74M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp + (3 * dst_strd)), src_v_8x16b);
  197|       |
  198|  9.74M|                    pu1_u_dst_temp += 16;
  199|  9.74M|                    pu1_v_dst_temp += 16;
  200|  9.74M|                    pu1_uv_src_temp += 32;
  201|  9.74M|                }
  202|       |
  203|   218k|                pu1_u_dst += 4 * dst_strd;
  204|   218k|                pu1_v_dst += 4 * dst_strd;
  205|   218k|                pu1_uv_src += 4 * src_strd;
  206|       |                //pu1_v_src += src_strd;
  207|   218k|            }
  208|  15.9k|            rows = num_rows & 0x3;
  209|  15.9k|            if(rows)
  ------------------
  |  Branch (209:16): [True: 352, False: 15.6k]
  ------------------
  210|    352|            {
  211|  1.04k|                for(i = 0; i < rows; i++)
  ------------------
  |  Branch (211:28): [True: 693, False: 352]
  ------------------
  212|    693|                {
  213|    693|                    UWORD8 *pu1_uv_src_temp, *pu1_u_dst_temp, *pu1_v_dst_temp;
  214|       |
  215|    693|                    pu1_uv_src_temp = pu1_uv_src;
  216|    693|                    pu1_u_dst_temp =  pu1_u_dst;
  217|    693|                    pu1_v_dst_temp =  pu1_v_dst;
  218|       |
  219|  21.3k|                    for(j = 0; j < cols; j++)
  ------------------
  |  Branch (219:32): [True: 20.6k, False: 693]
  ------------------
  220|  20.6k|                    {
  221|       |
  222|  20.6k|                        src_uv0_8x16b = _mm_loadu_si128((__m128i *)pu1_uv_src_temp);
  223|  20.6k|                        src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + 16));
  224|       |
  225|  20.6k|                        temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  226|  20.6k|                        temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  227|       |
  228|  20.6k|                        src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  229|  20.6k|                        src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  230|       |
  231|  20.6k|                        _mm_storeu_si128((__m128i *)(pu1_u_dst_temp), src_u_8x16b);
  232|  20.6k|                        _mm_storeu_si128((__m128i *)(pu1_v_dst_temp), src_v_8x16b);
  233|       |
  234|  20.6k|                        pu1_u_dst_temp += 16;
  235|  20.6k|                        pu1_v_dst_temp += 16;
  236|  20.6k|                        pu1_uv_src_temp += 32;
  237|  20.6k|                    }
  238|       |
  239|    693|                    pu1_u_dst += dst_strd;
  240|    693|                    pu1_v_dst += dst_strd;
  241|    693|                    pu1_uv_src += src_strd;
  242|    693|                }
  243|    352|            }
  244|  15.9k|            pu1_u_dst -= (num_rows * dst_strd);
  245|  15.9k|            pu1_v_dst -= (num_rows * dst_strd);
  246|  15.9k|            num_cols &= 0x0F;
  247|  15.9k|        }
  248|  15.9k|        if(num_cols)
  ------------------
  |  Branch (248:12): [True: 9.96k, False: 5.98k]
  ------------------
  249|  9.96k|        {
  250|  9.96k|            pu1_u_dst += (cols << 4);
  251|  9.96k|            pu1_v_dst += (cols << 4);
  252|  9.96k|            pu1_u_src += 2 * (cols << 4);
  253|  9.96k|            pu1_v_src += 2 * (cols << 4);
  254|   651k|            for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (254:24): [True: 641k, False: 9.96k]
  ------------------
  255|   641k|            {
  256|  3.07M|                for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (256:28): [True: 2.43M, False: 641k]
  ------------------
  257|  2.43M|                {
  258|  2.43M|                    pu1_u_dst[j] = pu1_u_src[j * 2];
  259|  2.43M|                    pu1_v_dst[j] = pu1_v_src[j * 2];
  260|  2.43M|                }
  261|       |
  262|   641k|                pu1_u_dst += dst_strd;
  263|   641k|                pu1_v_dst += dst_strd;
  264|   641k|                pu1_u_src += src_strd;
  265|   641k|                pu1_v_src += src_strd;
  266|   641k|            }
  267|  9.96k|        }
  268|  15.9k|    }
  269|  15.9k|    return;
  270|  15.9k|}

ihevcd_init_function_ptr:
   62|  53.3k|{
   63|  53.3k|    codec_t *ps_codec = (codec_t *)pv_codec;
   64|  53.3k|    ihevcd_init_function_ptr_generic(&ps_codec->s_func_selector);
   65|  53.3k|    switch(ps_codec->e_processor_arch)
   66|  53.3k|    {
   67|  6.02k|        case ARCH_X86_GENERIC:
  ------------------
  |  Branch (67:9): [True: 6.02k, False: 47.3k]
  ------------------
   68|  6.02k|            ihevcd_init_function_ptr_generic(&ps_codec->s_func_selector);
   69|  6.02k|            break;
   70|  2.61k|        case ARCH_X86_SSSE3:
  ------------------
  |  Branch (70:9): [True: 2.61k, False: 50.7k]
  ------------------
   71|  2.61k|            ihevcd_init_function_ptr_ssse3(&ps_codec->s_func_selector);
   72|  2.61k|            break;
   73|  30.9k|        case ARCH_X86_SSE42:
  ------------------
  |  Branch (73:9): [True: 30.9k, False: 22.3k]
  ------------------
   74|  30.9k|            ihevcd_init_function_ptr_sse42(&ps_codec->s_func_selector);
   75|  30.9k|            break;
   76|      0|        case ARCH_X86_AVX2:
  ------------------
  |  Branch (76:9): [True: 0, False: 53.3k]
  ------------------
   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.7k|        default:
  ------------------
  |  Branch (83:9): [True: 13.7k, False: 39.5k]
  ------------------
   84|  13.7k|            ihevcd_init_function_ptr_ssse3(&ps_codec->s_func_selector);
   85|  13.7k|            break;
   86|  53.3k|    }
   87|  53.3k|}
ihevcd_init_arch:
   90|  28.3k|{
   91|  28.3k|    codec_t *ps_codec = (codec_t *)pv_codec;
   92|       |
   93|  28.3k|#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|  28.3k|}

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

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

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

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

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

